Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EquityOptionUnderlyingData Class Reference

Serializable Equity Option Underlying Data, this represents one underlying in EquityOptionPositionData. More...

#include <ored/portfolio/equityoptionposition.hpp>

+ Inheritance diagram for EquityOptionUnderlyingData:
+ Collaboration diagram for EquityOptionUnderlyingData:

Public Member Functions

 EquityOptionUnderlyingData ()
 
 EquityOptionUnderlyingData (const EquityUnderlying &underlying, const OptionData &optionData, const Real strike)
 
const EquityUnderlyingunderlying () const
 
const OptionDataoptionData () const
 
Real strike () const
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Private Attributes

EquityUnderlying underlying_
 
OptionData optionData_
 
Real strike_
 

Detailed Description

Serializable Equity Option Underlying Data, this represents one underlying in EquityOptionPositionData.

Definition at line 39 of file equityoptionposition.hpp.

Constructor & Destructor Documentation

◆ EquityOptionUnderlyingData() [1/2]

Definition at line 41 of file equityoptionposition.hpp.

41{}

◆ EquityOptionUnderlyingData() [2/2]

EquityOptionUnderlyingData ( const EquityUnderlying underlying,
const OptionData optionData,
const Real  strike 
)

Member Function Documentation

◆ underlying()

const EquityUnderlying & underlying ( ) const

Definition at line 45 of file equityoptionposition.hpp.

45{ return underlying_; }

◆ optionData()

const OptionData & optionData ( ) const

Definition at line 46 of file equityoptionposition.hpp.

46{ return optionData_; }

◆ strike()

Real strike ( ) const

Definition at line 47 of file equityoptionposition.hpp.

47{ return strike_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 28 of file equityoptionposition.cpp.

28 {
29 XMLUtils::checkNode(node, "Underlying");
30 XMLNode* n = XMLUtils::getChildNode(node, "Underlying");
31 QL_REQUIRE(n != nullptr, "EquityOptionUnderlyingData: expected child node Underlying");
33 n = XMLUtils::getChildNode(node, "OptionData");
34 QL_REQUIRE(n != nullptr, "EquityOptionUnderlyingData: expected child node OptionData");
37}
void fromXML(XMLNode *node) override
Definition: underlying.cpp:81
virtual void fromXML(XMLNode *node) override
Definition: optiondata.cpp:32
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
Definition: xmlutils.cpp:286
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 39 of file equityoptionposition.cpp.

39 {
40 XMLNode* n = doc.allocNode("Underlying");
43 XMLUtils::addChild(doc, n, "Strike", strike_);
44 return n;
45}
XMLNode * toXML(XMLDocument &doc) const override
Definition: underlying.cpp:102
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: optiondata.cpp:86
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
+ Here is the call graph for this function:

Member Data Documentation

◆ underlying_

EquityUnderlying underlying_
private

Definition at line 53 of file equityoptionposition.hpp.

◆ optionData_

OptionData optionData_
private

Definition at line 54 of file equityoptionposition.hpp.

◆ strike_

Real strike_
private

Definition at line 55 of file equityoptionposition.hpp.