Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
durationadjustedcmslegdata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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
19/*! \file durationadjustedcmslegdata.hpp
20 \brief leg data for duration adjusted cms
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30using namespace QuantLib;
31
33
34public:
36 : ore::data::LegAdditionalData("DurationAdjustedCMS"), fixingDays_(Null<Size>()), isInArrears_(true),
37 nakedOption_(false) {}
38
39 //! Detailed constructor
41 const std::vector<double>& spreads,
42 const std::vector<std::string>& spreadDates = std::vector<std::string>(),
43 const std::vector<double>& caps = std::vector<double>(),
44 const std::vector<std::string>& capDates = std::vector<std::string>(),
45 const std::vector<double>& floors = std::vector<double>(),
46 const std::vector<std::string>& floorDates = std::vector<std::string>(),
47 const std::vector<double>& gearings = std::vector<double>(),
48 const std::vector<std::string>& gearingDates = std::vector<std::string>(),
49 bool nakedOption = false)
54 indices_.insert(swapIndex_);
55 }
56
57 //! \name Inspectors
58 //@{
59 const std::string& swapIndex() const { return swapIndex_; }
60 Size duration() const { return duration_; }
61 Size fixingDays() const { return fixingDays_; }
62 bool isInArrears() const { return isInArrears_; }
63 const std::vector<double>& spreads() const { return spreads_; }
64 const std::vector<std::string>& spreadDates() const { return spreadDates_; }
65 const std::vector<double>& caps() const { return caps_; }
66 const std::vector<std::string>& capDates() const { return capDates_; }
67 const std::vector<double>& floors() const { return floors_; }
68 const std::vector<std::string>& floorDates() const { return floorDates_; }
69 const std::vector<double>& gearings() const { return gearings_; }
70 const std::vector<std::string>& gearingDates() const { return gearingDates_; }
71 bool nakedOption() const { return nakedOption_; }
72 //@}
73
74 //! \name Modifiers
75 //@{
76 vector<double>& caps() { return caps_; }
77 vector<string>& capDates() { return capDates_; }
78 vector<double>& floors() { return floors_; }
79 vector<string>& floorDates() { return floorDates_; }
80 bool& nakedOption() { return nakedOption_; }
81 //@}
82
83 //! \name Serialisation
84 //@{
85 virtual void fromXML(XMLNode* node) override;
86 virtual XMLNode* toXML(XMLDocument& doc) const override;
87 //@}
88private:
89 std::string swapIndex_;
93 std::vector<double> spreads_;
94 std::vector<std::string> spreadDates_;
95 std::vector<double> caps_;
96 std::vector<std::string> capDates_;
97 std::vector<double> floors_;
98 std::vector<std::string> floorDates_;
99 std::vector<double> gearings_;
100 std::vector<std::string> gearingDates_;
102};
103
104} // namespace data
105} // namespace ore
const std::vector< std::string > & capDates() const
const std::vector< double > & gearings() const
const std::vector< double > & spreads() const
const std::vector< double > & floors() const
const std::vector< std::string > & gearingDates() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const std::vector< double > & caps() const
DurationAdjustedCmsLegData(const std::string &swapIndex, Size duration, Size fixingDays, bool isInArrears, const std::vector< double > &spreads, const std::vector< std::string > &spreadDates=std::vector< std::string >(), const std::vector< double > &caps=std::vector< double >(), const std::vector< std::string > &capDates=std::vector< std::string >(), const std::vector< double > &floors=std::vector< double >(), const std::vector< std::string > &floorDates=std::vector< std::string >(), const std::vector< double > &gearings=std::vector< double >(), const std::vector< std::string > &gearingDates=std::vector< std::string >(), bool nakedOption=false)
Detailed constructor.
const std::vector< std::string > & floorDates() const
const std::vector< std::string > & spreadDates() const
Serializable Additional Leg Data.
Definition: legdata.hpp:63
std::set< std::string > indices_
Definition: legdata.hpp:77
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23