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

#include <ored/portfolio/tlockdata.hpp>

+ Inheritance diagram for TreasuryLockData:
+ Collaboration diagram for TreasuryLockData:

Public Member Functions

 TreasuryLockData ()
 Default constructor. More...
 
 TreasuryLockData (bool payer, const BondData &bondData, Real referenceRate, string dayCounter, string terminationDate, int paymentGap, string paymentCalendar)
 Constructor that takes an explicit creditCurveId. More...
 
bool empty () const
 
bool payer () const
 
BondData & bondData ()
 
const BondData & bondData () const
 
const BondData & originalBondData () const
 
Real referenceRate () const
 
const string & dayCounter () const
 
const string & terminationDate () const
 
int paymentGap () const
 
const string & paymentCalendar () const
 
virtual void fromXML (XMLNode *node) override
 XMLSerializable interface. More...
 
virtual XMLNode * toXML (XMLDocument &doc) const override
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNode * toXML (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

bool empty_
 
bool payer_
 
BondData originalBondData_
 
BondData bondData_
 
Real referenceRate_
 
string dayCounter_
 
string terminationDate_
 
int paymentGap_
 
string paymentCalendar_
 

Detailed Description

Serializable credit default swap data

Definition at line 38 of file tlockdata.hpp.

Constructor & Destructor Documentation

◆ TreasuryLockData() [1/2]

Default constructor.

Definition at line 41 of file tlockdata.hpp.

41: empty_(true) {}

◆ TreasuryLockData() [2/2]

TreasuryLockData ( bool  payer,
const BondData &  bondData,
Real  referenceRate,
string  dayCounter,
string  terminationDate,
int  paymentGap,
string  paymentCalendar 
)

Constructor that takes an explicit creditCurveId.

Definition at line 44 of file tlockdata.hpp.

const string & dayCounter() const
Definition: tlockdata.hpp:55
const string & terminationDate() const
Definition: tlockdata.hpp:56
const string & paymentCalendar() const
Definition: tlockdata.hpp:58

Member Function Documentation

◆ empty()

bool empty ( ) const

Definition at line 49 of file tlockdata.hpp.

49{ return empty_; }

◆ payer()

bool payer ( ) const

Definition at line 50 of file tlockdata.hpp.

50{ return payer_; }

◆ bondData() [1/2]

BondData & bondData ( )

Definition at line 51 of file tlockdata.hpp.

51{ return bondData_; }

◆ bondData() [2/2]

const BondData & bondData ( ) const

Definition at line 52 of file tlockdata.hpp.

52{ return bondData_; }

◆ originalBondData()

const BondData & originalBondData ( ) const

Definition at line 53 of file tlockdata.hpp.

53{ return originalBondData_; }

◆ referenceRate()

Real referenceRate ( ) const

Definition at line 54 of file tlockdata.hpp.

54{ return referenceRate_; }

◆ dayCounter()

const string & dayCounter ( ) const

Definition at line 55 of file tlockdata.hpp.

55{ return dayCounter_; }

◆ terminationDate()

const string & terminationDate ( ) const

Definition at line 56 of file tlockdata.hpp.

56{ return terminationDate_; }

◆ paymentGap()

int paymentGap ( ) const

Definition at line 57 of file tlockdata.hpp.

57{ return paymentGap_; }

◆ paymentCalendar()

const string & paymentCalendar ( ) const

Definition at line 58 of file tlockdata.hpp.

58{ return paymentCalendar_; }

◆ fromXML()

void fromXML ( XMLNode *  node)
overridevirtual

XMLSerializable interface.

Implements XMLSerializable.

Definition at line 30 of file tlockdata.cpp.

30 {
31 XMLUtils::checkNode(node, "TreasuryLockData");
32 QL_REQUIRE(node, "No TreasuryLockData Node");
33 payer_ = XMLUtils::getChildValueAsBool(node, "Payer", true);
36 referenceRate_ = XMLUtils::getChildValueAsDouble(node, "ReferenceRate", true);
37 dayCounter_ = XMLUtils::getChildValue(node, "DayCounter", false);
38 terminationDate_ = XMLUtils::getChildValue(node, "TerminationDate", true);
39 paymentGap_ = XMLUtils::getChildValueAsInt(node, "PaymentGap", false, 0);
40 paymentCalendar_ = XMLUtils::getChildValue(node, "PaymentCalendar", true);
41 empty_ = false;
42}
virtual void fromXML(XMLNode *node) override
XMLSerializable interface.
Definition: bond.cpp:59
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 string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
Definition: xmlutils.cpp:296
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
Definition: xmlutils.cpp:291
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument &  doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 44 of file tlockdata.cpp.

44 {
45 XMLNode* tlockNode = doc.allocNode("TreasuryLockData");
46 XMLUtils::addChild(doc, tlockNode, "Payer", payer_);
48 XMLUtils::addChild(doc, tlockNode, "ReferenceRate", referenceRate_);
49 if (!dayCounter_.empty())
50 XMLUtils::addChild(doc, tlockNode, "DayCounter", dayCounter_);
51 XMLUtils::addChild(doc, tlockNode, "TerminationDate", terminationDate_);
52 XMLUtils::addChild(doc, tlockNode, "PaymentGap", paymentGap_);
53 XMLUtils::addChild(doc, tlockNode, "PaymentCalendar", paymentCalendar_);
54 return tlockNode;
55}
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: bond.cpp:95
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
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ empty_

bool empty_
private

Definition at line 65 of file tlockdata.hpp.

◆ payer_

bool payer_
private

Definition at line 66 of file tlockdata.hpp.

◆ originalBondData_

BondData originalBondData_
private

Definition at line 67 of file tlockdata.hpp.

◆ bondData_

BondData bondData_
private

Definition at line 67 of file tlockdata.hpp.

◆ referenceRate_

Real referenceRate_
private

Definition at line 68 of file tlockdata.hpp.

◆ dayCounter_

string dayCounter_
private

Definition at line 69 of file tlockdata.hpp.

◆ terminationDate_

string terminationDate_
private

Definition at line 70 of file tlockdata.hpp.

◆ paymentGap_

int paymentGap_
private

Definition at line 71 of file tlockdata.hpp.

◆ paymentCalendar_

string paymentCalendar_
private

Definition at line 72 of file tlockdata.hpp.