Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
inflationmodeldata.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
20
21using std::string;
22using std::vector;
23
24namespace ore {
25namespace data {
26
28
30 CalibrationType calibrationType,
31 const vector<CalibrationBasket>& calibrationBaskets,
32 const string& currency,
33 const string& index,
34 const bool ignoreDuplicateCalibrationExpiryTimes)
35 : ModelData(calibrationType, calibrationBaskets),
36 currency_(currency),
37 index_(index),
38 ignoreDuplicateCalibrationExpiryTimes_(ignoreDuplicateCalibrationExpiryTimes) {}
39
40const std::string& InflationModelData::currency() const {
41 return currency_;
42}
43
44const std::string& InflationModelData::index() const {
45 return index_;
46}
47
50}
51
53 index_ = XMLUtils::getAttribute(node, "index");
54 currency_ = XMLUtils::getChildValue(node, "Currency", true);
56}
57
59 XMLUtils::addAttribute(doc, node, "index", index_);
60 XMLUtils::addChild(doc, node, "Currency", currency_);
61 ModelData::append(doc, node);
62}
63
64}
65}
void append(XMLDocument &doc, XMLNode *node) const override
Method used by toXML in derived classes to add the members here to a node.
const std::string & index() const
const std::string & currency() const
bool ignoreDuplicateCalibrationExpiryTimes() const
void fromXML(XMLNode *node) override
InflationModelData()
Default constructor. The currency and inflation index are empty.
virtual void append(XMLDocument &doc, XMLNode *node) const
Method used by toXML in derived classes to add the members here to a node.
Definition: modeldata.cpp:56
void fromXML(XMLNode *node) override
Definition: modeldata.cpp:42
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
Definition: xmlutils.cpp:412
static string getAttribute(XMLNode *node, const string &attrName)
Definition: xmlutils.cpp:419
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
base class for holding inflation model data
@ data
Definition: log.hpp:77
CalibrationType
Supported calibration types.
Definition: irmodeldata.hpp:46
Serializable Credit Default Swap.
Definition: namespaces.docs:23