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

#include <ored/portfolio/optionexercisedata.hpp>

+ Inheritance diagram for OptionExerciseData:
+ Collaboration diagram for OptionExerciseData:

Public Member Functions

 OptionExerciseData ()
 Default constructor. More...
 
 OptionExerciseData (const std::string &date, const std::string &price)
 Constructor taking an exercise date and exercise price. More...
 
Inspectors
const QuantLib::Date & date () const
 
QuantLib::Real price () const
 
- 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...
 

Serialisation

std::string strDate_
 
std::string strPrice_
 
QuantLib::Date date_
 
QuantLib::Real price_
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
void init ()
 Initialisation. More...
 

Detailed Description

Serializable object holding option exercise data for options that have been exercised.

Definition at line 35 of file optionexercisedata.hpp.

Constructor & Destructor Documentation

◆ OptionExerciseData() [1/2]

Default constructor.

Definition at line 31 of file optionexercisedata.cpp.

31: price_(Null<Real>()) {}

◆ OptionExerciseData() [2/2]

OptionExerciseData ( const std::string &  date,
const std::string &  price 
)

Constructor taking an exercise date and exercise price.

Definition at line 33 of file optionexercisedata.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ date()

const QuantLib::Date & date ( ) const

Definition at line 45 of file optionexercisedata.hpp.

45{ return date_; }

◆ price()

QuantLib::Real price ( ) const

Definition at line 46 of file optionexercisedata.hpp.

46{ return price_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 37 of file optionexercisedata.cpp.

37 {
38 XMLUtils::checkNode(node, "ExerciseData");
39 strDate_ = XMLUtils::getChildValue(node, "Date", true);
40 strPrice_ = XMLUtils::getChildValue(node, "Price", false);
41 init();
42}
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 44 of file optionexercisedata.cpp.

44 {
45 XMLNode* node = doc.allocNode("ExerciseData");
46 XMLUtils::addChild(doc, node, "Date", strDate_);
47 if (!strPrice_.empty())
48 XMLUtils::addChild(doc, node, "Price", strPrice_);
49 return node;
50}
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ init()

void init ( )
private

Initialisation.

Definition at line 52 of file optionexercisedata.cpp.

52 {
54 if (!strPrice_.empty())
56}
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ strDate_

std::string strDate_
private

Definition at line 56 of file optionexercisedata.hpp.

◆ strPrice_

std::string strPrice_
private

Definition at line 57 of file optionexercisedata.hpp.

◆ date_

QuantLib::Date date_
private

Definition at line 59 of file optionexercisedata.hpp.

◆ price_

QuantLib::Real price_
private

Definition at line 60 of file optionexercisedata.hpp.