Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
yoyswap.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
22
23using QuantLib::Period;
24
25namespace ore {
26namespace data {
27
29
30YoYSwap::YoYSwap(const Period& tenor)
31 : CalibrationInstrument("YoYSwap"),
32 tenor_(tenor) {}
33
34const QuantLib::Period& YoYSwap::tenor() const {
35 return tenor_;
36}
37
40 tenor_ = parsePeriod(XMLUtils::getChildValue(node, "Tenor", true));
41}
42
45 XMLUtils::addChild(doc, node, "Tenor", to_string(tenor_));
46 return node;
47}
48
49}
50}
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
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
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
void fromXML(XMLNode *node) override
Definition: yoyswap.cpp:38
XMLNode * toXML(XMLDocument &doc) const override
Definition: yoyswap.cpp:43
const QuantLib::Period & tenor() const
Definition: yoyswap.cpp:34
YoYSwap()
Default constructor.
Definition: yoyswap.cpp:28
QuantLib::Period tenor_
Definition: yoyswap.hpp:55
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
@ data
Definition: log.hpp:77
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Map text representations to QuantLib/QuantExt types.
string conversion utilities
class for holding details of a year on year inflation swap calibration instrument.