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

Serializable Fixed Leg Data. More...

#include <ored/portfolio/legdata.hpp>

+ Inheritance diagram for FixedLegData:
+ Collaboration diagram for FixedLegData:

Public Member Functions

 FixedLegData ()
 Default constructor. More...
 
 FixedLegData (const vector< double > &rates, const vector< string > &rateDates=vector< string >())
 Constructor. More...
 
Inspectors
const vector< double > & rates () const
 
const vector< string > & rateDates () const
 
- Public Member Functions inherited from LegAdditionalData
 LegAdditionalData (const string &legType, const string &legNodeName)
 
 LegAdditionalData (const string &legType)
 
const string & legType () const
 
const string & legNodeName () const
 
const std::set< std::string > & indices () 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

vector< double > rates_
 
vector< string > rateDates_
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 

Additional Inherited Members

- Protected Attributes inherited from LegAdditionalData
std::set< std::string > indices_
 

Detailed Description

Serializable Fixed Leg Data.

Definition at line 117 of file legdata.hpp.

Constructor & Destructor Documentation

◆ FixedLegData() [1/2]

Default constructor.

Definition at line 120 of file legdata.hpp.

120: LegAdditionalData("Fixed") {}
LegAdditionalData(const string &legType, const string &legNodeName)
Definition: legdata.hpp:65

◆ FixedLegData() [2/2]

FixedLegData ( const vector< double > &  rates,
const vector< string > &  rateDates = vector<string>() 
)

Constructor.

Definition at line 122 of file legdata.hpp.

const vector< double > & rates() const
Definition: legdata.hpp:127
vector< string > rateDates_
Definition: legdata.hpp:138
const vector< string > & rateDates() const
Definition: legdata.hpp:128
vector< double > rates_
Definition: legdata.hpp:137

Member Function Documentation

◆ rates()

const vector< double > & rates ( ) const

Definition at line 127 of file legdata.hpp.

127{ return rates_; }

◆ rateDates()

const vector< string > & rateDates ( ) const

Definition at line 128 of file legdata.hpp.

128{ return rateDates_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 113 of file legdata.cpp.

113 {
115 rates_ = XMLUtils::getChildrenValuesWithAttributes<Real>(node, "Rates", "Rate", "startDate", rateDates_, parseReal,
116 true);
117}
const string & legNodeName() const
Definition: legdata.hpp:70
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 119 of file legdata.cpp.

119 {
120 XMLNode* node = doc.allocNode(legNodeName());
121 XMLUtils::addChildrenWithOptionalAttributes(doc, node, "Rates", "Rate", rates_, "startDate", rateDates_);
122 return node;
123}
static void addChildrenWithOptionalAttributes(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values, const string &attrName, const vector< string > &attrs)
Definition: xmlutils.cpp:542
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ rates_

vector<double> rates_
private

Definition at line 137 of file legdata.hpp.

◆ rateDates_

vector<string> rateDates_
private

Definition at line 138 of file legdata.hpp.