Default curve configuration.
More...
#include <ored/configuration/defaultcurveconfig.hpp>
|
| DefaultCurveConfig (const string &curveId, const string &curveDescription, const string ¤cy, const std::map< int, Config > &configs) |
| the curve builder will try to build the configs by ascending key in the map, first success wins More...
|
|
| DefaultCurveConfig (const string &curveID, const string &curveDescription, const string ¤cy, const Config &config) |
| single config ctor More...
|
|
| DefaultCurveConfig () |
| default ctor More...
|
|
| CurveConfig (const string &curveID, const string &curveDescription, const vector< string > "es=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...
|
|
virtual | ~XMLSerializable () |
|
virtual void | fromXML (XMLNode *node)=0 |
|
virtual XMLNode * | toXML (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...
|
|
Default curve configuration.
Definition at line 49 of file defaultcurveconfig.hpp.
◆ DefaultCurveConfig() [1/3]
DefaultCurveConfig |
( |
const string & |
curveId, |
|
|
const string & |
curveDescription, |
|
|
const string & |
currency, |
|
|
const std::map< int, Config > & |
configs |
|
) |
| |
the curve builder will try to build the configs by ascending key in the map, first success wins
Definition at line 33 of file defaultcurveconfig.cpp.
38
40 c.second.priority() = c.first;
41}
const string & curveDescription() const
CurveConfig()
Default constructor.
void populateRequiredCurveIds()
const string & currency() const
const std::map< int, Config > & configs() const
std::map< int, Config > configs_
◆ DefaultCurveConfig() [2/3]
DefaultCurveConfig |
( |
const string & |
curveID, |
|
|
const string & |
curveDescription, |
|
|
const string & |
currency, |
|
|
const Config & |
config |
|
) |
| |
single config ctor
Definition at line 173 of file defaultcurveconfig.hpp.
const string & curveID() const
DefaultCurveConfig()
default ctor
◆ DefaultCurveConfig() [3/3]
◆ fromXML()
Implements XMLSerializable.
Definition at line 78 of file defaultcurveconfig.cpp.
78 {
85 Config tmp;
86 tmp.fromXML(config);
88 "DefaultCurveConfig::fromXML(): several configurations with same priority '" << tmp.priority()
89 << "' found.");
91 }
92 } else {
93 Config tmp;
94 tmp.fromXML(node);
96 }
99}
static void checkNode(XMLNode *n, const string &expectedName)
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
◆ toXML()
Implements XMLSerializable.
Definition at line 101 of file defaultcurveconfig.cpp.
101 {
102 XMLNode* node = doc.allocNode(
"DefaultCurve");
103
108
111 }
112
113 return node;
114}
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
rapidxml::xml_node< char > XMLNode
◆ currency()
const string & currency |
( |
| ) |
const |
◆ configs()
const std::map< int, Config > & configs |
( |
| ) |
const |
◆ populateQuotes()
Definition at line 65 of file defaultcurveconfig.cpp.
65 {
67 for (
auto const& config :
configs_) {
68 for (const auto& kv : config.second.cdsQuotes()) {
70 }
71
72 Real dummy;
73 if (!config.second.recoveryRateQuote().empty() && !
tryParseReal(config.second.recoveryRateQuote(), dummy))
74 quotes_.insert(
quotes_.begin(), config.second.recoveryRateQuote());
75 }
76}
bool tryParseReal(const string &s, QuantLib::Real &result)
Attempt to convert text to Real.
◆ populateRequiredCurveIds() [1/2]
void populateRequiredCurveIds |
( |
| ) |
|
|
private |
Definition at line 58 of file defaultcurveconfig.cpp.
58 {
59 for (
auto const& config :
configs_) {
61 config.second.sourceCurveID(), config.second.multiSectionSourceCurveIds());
62 }
63}
◆ populateRequiredCurveIds() [2/2]
void populateRequiredCurveIds |
( |
const std::string & |
discountCurveID, |
|
|
const std::string & |
benchmarkCurveID, |
|
|
const std::string & |
sourceCurveID, |
|
|
const std::vector< std::string > & |
multiSectionSourceCurveIds |
|
) |
| |
|
private |
Definition at line 43 of file defaultcurveconfig.cpp.
45 {
46 if (!discountCurveID.empty())
48 if (!benchmarkCurveID.empty())
50 if (!sourceCurveID.empty())
52 for (auto const& s : multiSectionSourceCurveIds) {
53 if (!s.empty())
55 }
56}
map< CurveSpec::CurveType, set< string > > requiredCurveIds_
QuantLib::ext::shared_ptr< CurveSpec > parseCurveSpec(const string &s)
function to convert a string into a curve spec
◆ currency_
◆ configs_
std::map<int, Config> configs_ |
|
private |