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

Security configuration. More...

#include <ored/configuration/securityconfig.hpp>

+ Inheritance diagram for SecurityConfig:
+ Collaboration diagram for SecurityConfig:

Public Member Functions

Constructors/Destructors
 SecurityConfig (const string &curveID, const string &curveDescription, const string &spreadQuote="", const string &recoveryQuote="", const string &cprQuote="", const string &priceQuote="")
 Detailed constructor. More...
 
 SecurityConfig ()
 Default constructor. More...
 
- 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...
 

Inspectors

string spreadQuote_
 
string recoveryQuote_
 
string cprQuote_
 
string priceQuote_
 
const string & spreadQuote ()
 
const string & recoveryRatesQuote ()
 
const string & cprQuote ()
 
const string & priceQuote ()
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
void setQuotes ()
 

Additional Inherited Members

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

Detailed Description

Security configuration.

Definition at line 39 of file securityconfig.hpp.

Constructor & Destructor Documentation

◆ SecurityConfig() [1/2]

SecurityConfig ( const string &  curveID,
const string &  curveDescription,
const string &  spreadQuote = "",
const string &  recoveryQuote = "",
const string &  cprQuote = "",
const string &  priceQuote = "" 
)

Detailed constructor.

Definition at line 44 of file securityconfig.hpp.

+ Here is the call graph for this function:

◆ SecurityConfig() [2/2]

Default constructor.

Definition at line 51 of file securityconfig.hpp.

51{}

Member Function Documentation

◆ spreadQuote()

const string & spreadQuote ( )

Definition at line 56 of file securityconfig.hpp.

56{ return spreadQuote_; }

◆ recoveryRatesQuote()

const string & recoveryRatesQuote ( )

Definition at line 57 of file securityconfig.hpp.

57{ return recoveryQuote_; }

◆ cprQuote()

const string & cprQuote ( )

Definition at line 58 of file securityconfig.hpp.

58{ return cprQuote_; }

◆ priceQuote()

const string & priceQuote ( )

Definition at line 59 of file securityconfig.hpp.

59{ return priceQuote_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 62 of file securityconfig.hpp.

62 {
63 XMLUtils::checkNode(node, "Security");
64
65 curveID_ = XMLUtils::getChildValue(node, "CurveId", true);
66 curveDescription_ = XMLUtils::getChildValue(node, "CurveDescription", true);
67 spreadQuote_ = XMLUtils::getChildValue(node, "SpreadQuote", false);
68 recoveryQuote_ = XMLUtils::getChildValue(node, "RecoveryRateQuote", false);
69 cprQuote_ = XMLUtils::getChildValue(node, "CPRQuote", false);
70 priceQuote_ = XMLUtils::getChildValue(node, "PriceQuote", false);
71 setQuotes();
72 }
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 74 of file securityconfig.hpp.

74 {
75 XMLNode* node = doc.allocNode("Security");
76
77 XMLUtils::addChild(doc, node, "CurveId", curveID_);
78 XMLUtils::addChild(doc, node, "CurveDescription", curveDescription_);
79 if (!spreadQuote_.empty())
80 XMLUtils::addChild(doc, node, "SpreadQuote", spreadQuote_);
81 if (!recoveryQuote_.empty())
82 XMLUtils::addChild(doc, node, "RecoveryRateQuote", recoveryQuote_);
83 if (!cprQuote_.empty())
84 XMLUtils::addChild(doc, node, "CPRQuote", cprQuote_);
85 if (!priceQuote_.empty())
86 XMLUtils::addChild(doc, node, "PriceQuote", priceQuote_);
87 return node;
88 }
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:

◆ setQuotes()

void setQuotes ( )
private

Definition at line 91 of file securityconfig.hpp.

91 {
92 quotes_.clear();
93 if (!spreadQuote_.empty())
94 quotes_.push_back(spreadQuote_);
95 if (!recoveryQuote_.empty())
96 quotes_.push_back(recoveryQuote_);
97 if (!cprQuote_.empty())
98 quotes_.push_back(cprQuote_);
99 if (!priceQuote_.empty())
100 quotes_.push_back(priceQuote_);
101 }
vector< string > quotes_
Definition: curveconfig.hpp:74
+ Here is the caller graph for this function:

Member Data Documentation

◆ spreadQuote_

string spreadQuote_
private

Definition at line 102 of file securityconfig.hpp.

◆ recoveryQuote_

string recoveryQuote_
private

Definition at line 102 of file securityconfig.hpp.

◆ cprQuote_

string cprQuote_
private

Definition at line 102 of file securityconfig.hpp.

◆ priceQuote_

string priceQuote_
private

Definition at line 102 of file securityconfig.hpp.