Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
List of all members
FXSpotConfig Class Reference

FXSpot configuration. More...

#include <ored/configuration/fxspotconfig.hpp>

+ Inheritance diagram for FXSpotConfig:
+ Collaboration diagram for FXSpotConfig:

Public Member Functions

Constructors/Destructors
 FXSpotConfig (const string &curveID, const string &curveDescription)
 Detailed constructor. More...
 
 FXSpotConfig ()
 Default constructor. More...
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
- Public Member Functions inherited from CurveConfig
 CurveConfig (const string &curveID, const string &curveDescription, const vector< string > &quotes=vector< string >())
 Detailed constructor. More...
 
 CurveConfig ()
 Default constructor. More...
 
const string & curveID () const
 
const string & curveDescription () const
 
const set< string > & requiredCurveIds (const CurveSpec::CurveType &curveType) const
 
const map< CurveSpec::CurveType, set< string > > & requiredCurveIds () const
 
string & curveID ()
 
string & curveDescription ()
 
set< string > & requiredCurveIds (const CurveSpec::CurveType &curveType)
 
map< CurveSpec::CurveType, set< string > > & requiredCurveIds ()
 
virtual const vector< string > & quotes ()
 Return all the market quotes required for this config. More...
 
- 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...
 

Additional Inherited Members

- Protected Attributes inherited from CurveConfig
string curveID_
 
string curveDescription_
 
vector< string > quotes_
 
map< CurveSpec::CurveType, set< string > > requiredCurveIds_
 

Detailed Description

FXSpot configuration.

Definition at line 42 of file fxspotconfig.hpp.

Constructor & Destructor Documentation

◆ FXSpotConfig() [1/2]

FXSpotConfig ( const string &  curveID,
const string &  curveDescription 
)

Detailed constructor.

Definition at line 47 of file fxspotconfig.hpp.

48 QL_REQUIRE(curveID.size() == 6, "FXSpot curveID must be of the form Ccy1Ccy2");
49 Currency ccy1 = parseCurrency(curveID.substr(0, 3));
50 Currency ccy2 = parseCurrency(curveID.substr(3, 3));
51 quotes_.push_back("FX/RATE/" + ccy1.code() + "/" + ccy2.code());
52 };
vector< string > quotes_
Definition: curveconfig.hpp:74
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
CurveConfig()
Default constructor.
Definition: curveconfig.hpp:49
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
+ Here is the call graph for this function:

◆ FXSpotConfig() [2/2]

Default constructor.

Definition at line 54 of file fxspotconfig.hpp.

54{}

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 57 of file fxspotconfig.hpp.

57 {
58 XMLUtils::checkNode(node, "FXSpot");
59 curveID_ = XMLUtils::getChildValue(node, "CurveId", true);
60 QL_REQUIRE(curveID_.size() == 6, "FXSpot curveID must be of the form Ccy1Ccy2");
61 Currency ccy1 = parseCurrency(curveID_.substr(0, 3));
62 Currency ccy2 = parseCurrency(curveID_.substr(3, 3));
63 quotes_.push_back("FX/RATE/" + ccy1.code() + "/" + ccy2.code());
64
65 curveDescription_ = XMLUtils::getChildValue(node, "CurveDescription", true);
66 }
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
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 68 of file fxspotconfig.hpp.

68 {
69 XMLNode* node = doc.allocNode("FXSpot");
70 XMLUtils::addChild(doc, node, "CurveId", curveID_);
71 XMLUtils::addChild(doc, node, "CurveDescription", curveDescription_);
72 return node;
73 }
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: