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

Linear Gauss Markov Model Parameters. More...

#include <ored/model/irmodeldata.hpp>

+ Inheritance diagram for IrModelData:
+ Collaboration diagram for IrModelData:

Public Member Functions

 IrModelData (const std::string &name)
 minimal constructor More...
 
 IrModelData (const std::string &name, const std::string &qualifier, CalibrationType calibrationType)
 Detailed constructor. More...
 
virtual void clear ()
 Clear list of calibration instruments. More...
 
virtual void reset ()
 Reset member variables to defaults. More...
 
Serialisation
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
- 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...
 

Setters/Getters

std::string name_
 
std::string qualifier_
 
CalibrationType calibrationType_
 
const std::string & name ()
 
std::string & qualifier ()
 
CalibrationTypecalibrationType ()
 
virtual std::string ccy () const
 

Detailed Description

Linear Gauss Markov Model Parameters.

This class contains the description of a Linear Gauss Markov interest rate model and instructions for how to calibrate it.

Definition at line 88 of file irmodeldata.hpp.

Constructor & Destructor Documentation

◆ IrModelData() [1/2]

IrModelData ( const std::string &  name)

minimal constructor

Definition at line 91 of file irmodeldata.hpp.

◆ IrModelData() [2/2]

IrModelData ( const std::string &  name,
const std::string &  qualifier,
CalibrationType  calibrationType 
)

Detailed constructor.

Definition at line 94 of file irmodeldata.hpp.

Member Function Documentation

◆ clear()

void clear ( )
virtual

Clear list of calibration instruments.

Reimplemented in CrLgmData, HwModelData, IrLgmData, and LgmData.

Definition at line 101 of file irmodeldata.cpp.

101{}
+ Here is the caller graph for this function:

◆ reset()

void reset ( )
virtual

Reset member variables to defaults.

Reimplemented in CrLgmData, HwModelData, IrLgmData, and LgmData.

Definition at line 103 of file irmodeldata.cpp.

103 {
104 clear();
105 qualifier_ = "";
107}
virtual void clear()
Clear list of calibration instruments.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Reimplemented in CrLgmData, HwModelData, IrLgmData, and LgmData.

Definition at line 109 of file irmodeldata.cpp.

109 {
110 std::string calibTypeString = XMLUtils::getChildValue(node, "CalibrationType", true);
111
112 calibrationType_ = parseCalibrationType(calibTypeString);
113 LOG(name_ + " with calibrationType_ = " << qualifier_);
114}
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
#define LOG(text)
Logging Macro (Level = Notice)
Definition: log.hpp:552
CalibrationType parseCalibrationType(const string &s)
Convert calibration type string into enumerated class value.
Definition: irmodeldata.cpp:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Reimplemented in CrLgmData, HwModelData, IrLgmData, and LgmData.

Definition at line 116 of file irmodeldata.cpp.

116 {
117
118 XMLNode* irModelNode = doc.allocNode(name_);
119
120 XMLUtils::addGenericChild(doc, irModelNode, "CalibrationType", calibrationType_);
121 return irModelNode;
122}
static void addGenericChild(XMLDocument &doc, XMLNode *n, const char *name, const T &value)
Adds <Name>p1,p2,p3</Name>
Definition: xmlutils.hpp:137
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ name()

const std::string & name ( )

Definition at line 111 of file irmodeldata.hpp.

111{ return name_; }

◆ qualifier()

std::string & qualifier ( )

Definition at line 112 of file irmodeldata.hpp.

112{ return qualifier_; }

◆ calibrationType()

CalibrationType & calibrationType ( )

Definition at line 113 of file irmodeldata.hpp.

113{ return calibrationType_; }

◆ ccy()

std::string ccy ( ) const
virtual

Definition at line 124 of file irmodeldata.cpp.

124 {
125 QuantLib::ext::shared_ptr<QuantLib::IborIndex> index;
126 return tryParseIborIndex(qualifier_, index) ? index->currency().code() : qualifier_;
127}
bool tryParseIborIndex(const string &s, QuantLib::ext::shared_ptr< IborIndex > &index)
Try to convert std::string to QuantLib::IborIndex.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ name_

std::string name_
protected

Definition at line 120 of file irmodeldata.hpp.

◆ qualifier_

std::string qualifier_
protected

Definition at line 121 of file irmodeldata.hpp.

◆ calibrationType_

CalibrationType calibrationType_
protected

Definition at line 122 of file irmodeldata.hpp.