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

Serializable object holding Derived schedule data. More...

#include <ored/portfolio/schedule.hpp>

+ Inheritance diagram for ScheduleDerived:
+ Collaboration diagram for ScheduleDerived:

Public Member Functions

 ScheduleDerived ()
 Default constructor. More...
 
 ScheduleDerived (const string &baseSchedule, const string &calendar, const string &convention, const string &shift, const bool removeFirstDate=false, const bool removeLastDate=false)
 Constructor. More...
 
Inspectors
const string & baseSchedule () const
 
const string & calendar () const
 
const string & convention () const
 
const string & shift () const
 
bool removeFirstDate () const
 
bool removeLastDate () const
 
Modifiers
string & modifyCalendar ()
 
string & modifyConvention ()
 
string & modifyShift ()
 
- 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 baseSchedule_
 
string calendar_
 
string convention_
 
string shift_
 
bool removeFirstDate_ = false
 
bool removeLastDate_ = false
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 

Detailed Description

Serializable object holding Derived schedule data.

Definition at line 157 of file schedule.hpp.

Constructor & Destructor Documentation

◆ ScheduleDerived() [1/2]

Default constructor.

Definition at line 160 of file schedule.hpp.

160{}

◆ ScheduleDerived() [2/2]

ScheduleDerived ( const string &  baseSchedule,
const string &  calendar,
const string &  convention,
const string &  shift,
const bool  removeFirstDate = false,
const bool  removeLastDate = false 
)

Member Function Documentation

◆ baseSchedule()

const string & baseSchedule ( ) const

Definition at line 169 of file schedule.hpp.

169{ return baseSchedule_; }

◆ calendar()

const string & calendar ( ) const

Definition at line 170 of file schedule.hpp.

170{ return calendar_; }

◆ convention()

const string & convention ( ) const

Definition at line 171 of file schedule.hpp.

171{ return convention_; }

◆ shift()

const string & shift ( ) const

Definition at line 172 of file schedule.hpp.

172{ return shift_; }

◆ removeFirstDate()

bool removeFirstDate ( ) const

Definition at line 173 of file schedule.hpp.

173{ return removeFirstDate_; }

◆ removeLastDate()

bool removeLastDate ( ) const

Definition at line 174 of file schedule.hpp.

174{ return removeLastDate_; }

◆ modifyCalendar()

string & modifyCalendar ( )

Definition at line 179 of file schedule.hpp.

179{ return calendar_; }

◆ modifyConvention()

string & modifyConvention ( )

Definition at line 180 of file schedule.hpp.

180{ return convention_; }

◆ modifyShift()

string & modifyShift ( )

Definition at line 181 of file schedule.hpp.

181{ return shift_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 146 of file schedule.cpp.

146 {
147 XMLUtils::checkNode(node, "Derived");
148 baseSchedule_ = XMLUtils::getChildValue(node, "BaseSchedule");
149 shift_ = XMLUtils::getChildValue(node, "Shift", false);
150 calendar_ = XMLUtils::getChildValue(node, "Calendar", false);
151 convention_ = XMLUtils::getChildValue(node, "Convention", false);
152 removeFirstDate_ = XMLUtils::getChildValueAsBool(node, "RemoveFirstDate", false, false);
153 removeLastDate_ = XMLUtils::getChildValueAsBool(node, "RemoveLastDate", false, false);
154}
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 bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
Definition: xmlutils.cpp:296
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 156 of file schedule.cpp.

156 {
157 XMLNode* node = doc.allocNode("Derived");
158 XMLUtils::addChild(doc, node, "BaseSchedule", baseSchedule_);
159 if (!shift_.empty())
160 XMLUtils::addChild(doc, node, "Shift", shift_);
161 if (!calendar_.empty())
162 XMLUtils::addChild(doc, node, "Calendar", calendar_);
163 if (!convention_.empty())
164 XMLUtils::addChild(doc, node, "Convention", convention_);
166 XMLUtils::addChild(doc, node, "RemoveFirstDate", removeFirstDate_);
168 XMLUtils::addChild(doc, node, "RemoveLastDate", removeLastDate_);
169 return node;
170}
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

◆ baseSchedule_

string baseSchedule_
private

Definition at line 190 of file schedule.hpp.

◆ calendar_

string calendar_
private

Definition at line 191 of file schedule.hpp.

◆ convention_

string convention_
private

Definition at line 192 of file schedule.hpp.

◆ shift_

string shift_
private

Definition at line 193 of file schedule.hpp.

◆ removeFirstDate_

bool removeFirstDate_ = false
private

Definition at line 194 of file schedule.hpp.

◆ removeLastDate_

bool removeLastDate_ = false
private

Definition at line 195 of file schedule.hpp.