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

Serializable object holding schedule Dates data. More...

#include <ored/portfolio/schedule.hpp>

+ Inheritance diagram for ScheduleDates:
+ Collaboration diagram for ScheduleDates:

Public Member Functions

 ScheduleDates ()
 Default constructor. More...
 
 ScheduleDates (const string &calendar, const string &convention, const string &tenor, const vector< string > &dates, const string &endOfMonth="", const string &endOfMonthConvention="")
 Constructor. More...
 
bool hasData () const
 Check if key attributes are empty. More...
 
Inspectors
const string & calendar () const
 
const string & convention () const
 
const string & tenor () const
 
const string & endOfMonth () const
 
const string & endOfMonthConvention () const
 
const vector< string > & dates () const
 
Modifiers
vector< string > & modifyDates ()
 
- 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

string calendar_
 
string convention_
 
string tenor_
 
string endOfMonth_
 
string endOfMonthConvention_
 
vector< string > dates_
 
bool was1T_ = false
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 

Detailed Description

Serializable object holding schedule Dates data.

Definition at line 110 of file schedule.hpp.

Constructor & Destructor Documentation

◆ ScheduleDates() [1/2]

Default constructor.

Definition at line 113 of file schedule.hpp.

113{}

◆ ScheduleDates() [2/2]

ScheduleDates ( const string &  calendar,
const string &  convention,
const string &  tenor,
const vector< string > &  dates,
const string &  endOfMonth = "",
const string &  endOfMonthConvention = "" 
)

Constructor.

Definition at line 115 of file schedule.hpp.

vector< string > dates_
Definition: schedule.hpp:149
const string & endOfMonthConvention() const
Definition: schedule.hpp:129
const string & convention() const
Definition: schedule.hpp:126
const string & tenor() const
Definition: schedule.hpp:127
const vector< string > & dates() const
Definition: schedule.hpp:130
const string & calendar() const
Definition: schedule.hpp:125
const string & endOfMonth() const
Definition: schedule.hpp:128

Member Function Documentation

◆ hasData()

bool hasData ( ) const

Check if key attributes are empty.

Definition at line 121 of file schedule.hpp.

121{ return dates_.size() > 0 && !tenor_.empty(); }

◆ calendar()

const string & calendar ( ) const

Definition at line 125 of file schedule.hpp.

125{ return calendar_; }

◆ convention()

const string & convention ( ) const

Definition at line 126 of file schedule.hpp.

126{ return convention_; }

◆ tenor()

const string & tenor ( ) const

Definition at line 127 of file schedule.hpp.

127{ return tenor_; }

◆ endOfMonth()

const string & endOfMonth ( ) const

Definition at line 128 of file schedule.hpp.

128{ return endOfMonth_; }

◆ endOfMonthConvention()

const string & endOfMonthConvention ( ) const

Definition at line 129 of file schedule.hpp.

129{ return endOfMonthConvention_; }

◆ dates()

const vector< string > & dates ( ) const

Definition at line 130 of file schedule.hpp.

130{ return dates_; }

◆ modifyDates()

vector< string > & modifyDates ( )

Definition at line 135 of file schedule.hpp.

135{ return dates_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 124 of file schedule.cpp.

124 {
125 XMLUtils::checkNode(node, "Dates");
126 calendar_ = XMLUtils::getChildValue(node, "Calendar");
127 convention_ = XMLUtils::getChildValue(node, "Convention");
128 tenor_ = XMLUtils::getChildValue(node, "Tenor") == "1T" ? "0D" : XMLUtils::getChildValue(node, "Tenor");
129 was1T_ = XMLUtils::getChildValue(node, "Tenor") == "1T" ? true : false;
130 endOfMonth_ = XMLUtils::getChildValue(node, "EndOfMonth");
131 dates_ = XMLUtils::getChildrenValues(node, "Dates", "Date");
132}
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
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:306
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 134 of file schedule.cpp.

134 {
135 XMLNode* node = doc.allocNode("Dates");
136 XMLUtils::addChild(doc, node, "Calendar", calendar_);
137 if (!convention_.empty())
138 XMLUtils::addChild(doc, node, "Convention", convention_);
139 XMLUtils::addChild(doc, node, "Tenor", was1T_ ? "1T" : tenor_);
140 if (!endOfMonth_.empty())
141 XMLUtils::addChild(doc, node, "EndOfMonth", endOfMonth_);
142 XMLUtils::addChildren(doc, node, "Dates", "Date", dates_);
143 return node;
144}
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
Definition: xmlutils.cpp:502
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:

Member Data Documentation

◆ calendar_

string calendar_
private

Definition at line 144 of file schedule.hpp.

◆ convention_

string convention_
private

Definition at line 145 of file schedule.hpp.

◆ tenor_

string tenor_
private

Definition at line 146 of file schedule.hpp.

◆ endOfMonth_

string endOfMonth_
private

Definition at line 147 of file schedule.hpp.

◆ endOfMonthConvention_

string endOfMonthConvention_
private

Definition at line 148 of file schedule.hpp.

◆ dates_

vector<string> dates_
private

Definition at line 149 of file schedule.hpp.

◆ was1T_

bool was1T_ = false
private

Definition at line 150 of file schedule.hpp.