41 DLOG(
"Processing the GlobalParameters node");
50 DLOG(
"EngineData product=" << productName <<
" model=" <<
model_[productName]);
53 map<string, string> modelParamMap;
58 modelParamMap[paramName] = paramValue;
59 DLOG(
"EngineData product=" << productName <<
" paramName=" << paramName <<
" paramValue=" << paramValue);
64 DLOG(
"EngineData product=" << productName <<
" engine=" <<
engine_[productName]);
67 map<string, string> engineParamMap;
72 engineParamMap[paramName] = paramValue;
73 DLOG(
"EngineData product=" << productName <<
" paramName=" << paramName <<
" paramValue=" << paramValue);
89 TLOG(
"Added pair [" << kv.first <<
"," << kv.second <<
"] to the GlobalParameters node");
92 for (
auto modelIterator =
model_.begin(); modelIterator !=
model_.end(); modelIterator++) {
96 auto engineIterator =
engine_.find(modelIterator->first);
100 for (
auto modelParamsIterator =
modelParams_.find(modelIterator->first)->second.begin();
101 modelParamsIterator !=
modelParams_.find(modelIterator->first)->second.end(); modelParamsIterator++) {
102 XMLNode* parameterNode = doc.
allocNode(
"Parameter", modelParamsIterator->second);
107 for (
auto engineParamsIterator =
engineParams_.find(modelIterator->first)->second.begin();
108 engineParamsIterator !=
engineParams_.find(modelIterator->first)->second.end(); engineParamsIterator++) {
109 XMLNode* parameterNode = doc.
allocNode(
"Parameter", engineParamsIterator->second);
114 return pricingEnginesNode;
123 res.push_back(it.first);
128 vector<string> products = lhs.
products();
133 for (
auto product : products) {
Pricing engine description.
map< string, map< string, string > > engineParams_
map< string, string > model_
std::map< std::string, std::string > globalParams_
map< string, string > engine_
bool hasProduct(const string &productName)
vector< string > products() const
Return all products.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const map< string, string > & modelParameters(const string &productName) const
void clear()
Clear all data.
const map< string, string > & engineParameters(const string &productName) const
const string & model(const string &productName) const
map< string, map< string, string > > modelParams_
const string & engine(const string &productName) const
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
static string getAttribute(XMLNode *node, const string &attrName)
static void checkNode(XMLNode *n, const string &expectedName)
static map< string, string > getChildrenAttributesAndValues(XMLNode *parent, const string &names, const string &attributeName, bool mandatory=false)
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
Get a node's next sibling node.
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
A class to hold pricing engine parameters.
Classes and functions for log message handling.
#define DLOG(text)
Logging Macro (Level = Debug)
#define TLOG(text)
Logging Macro (Level = Data)
bool operator!=(const Filter &a, const Filter &b)
bool operator==(const Dividend &d1, const Dividend &d)
Serializable Credit Default Swap.