Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
indexing.hpp
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
19/*! \file portfolio/indexing.hpp
20 \brief leg indexing data model and serialization
21 \ingroup tradedata
22*/
23
24#pragma once
25
27
28#include <ql/cashflow.hpp>
29
30namespace ore {
31namespace data {
32
33using namespace QuantLib;
34
35//! Serializable object holding indexing data
36/*!
37 \ingroup tradedata
38*/
39class Indexing : public XMLSerializable {
40public:
42 : hasData_(false), quantity_(1.0), initialFixing_(Null<Real>()), fixingDays_(0), inArrearsFixing_(false) {}
43 explicit Indexing(const std::string& index, const string& indexFixingCalendar = "", const bool indexIsDirty = false,
44 const bool indexIsRelative = true, const bool indexIsConditionalOnSurvival = true,
45 const Real quantity = 1.0, const Real initialFixing = Null<Real>(),
46 const Real initialNotionalFixing = Null<Real>(),
47 const ScheduleData& valuationSchedule = ScheduleData(), const Size fixingDays = 0,
48 const string& fixingCalendar = "", const string& fixingConvention = "",
49 const bool inArrearsFixing = false)
55
56 //! \name Inspectors
57 //@{
58 bool hasData() const { return hasData_; }
59 Real quantity() const { return quantity_; }
60 const string& index() const { return index_; }
61 // only used for FX, Bond indices
62 const string& indexFixingCalendar() const { return indexFixingCalendar_; }
63 // only used for Bond indices
64 bool indexIsDirty() const { return indexIsDirty_; }
65 bool indexIsRelative() const { return indexIsRelative_; }
67 //
68 Real initialFixing() const { return initialFixing_; }
71 Size fixingDays() const { return fixingDays_; }
72 const string& fixingCalendar() const { return fixingCalendar_; }
73 const string& fixingConvention() const { return fixingConvention_; }
74 bool inArrearsFixing() const { return inArrearsFixing_; }
75 //@}
76
77 //! \name Modifiers
78 //@{
79 Real& quantity() { return quantity_; }
80 string& index() { return index_; }
81 // only used for Bond indices
83 // only used for Bond indices
84 bool& indexIsDirty() { return indexIsDirty_; }
87 //
88 Real& initialFixing() { return initialFixing_; }
91 Size& fixingDays() { return fixingDays_; }
92 string& fixingCalendar() { return fixingCalendar_; }
93 string& fixingConvention() { return fixingConvention_; }
95 //@}
96
97 //! \name Serialisation
98 //@{
99 virtual void fromXML(XMLNode* node) override;
100 virtual XMLNode* toXML(XMLDocument& doc) const override;
101 //@}
102private:
105 string index_;
117};
118
119} // namespace data
120} // namespace ore
Serializable object holding indexing data.
Definition: indexing.hpp:39
Real initialFixing() const
Definition: indexing.hpp:68
string & index()
Definition: indexing.hpp:80
string & fixingConvention()
Definition: indexing.hpp:93
bool inArrearsFixing() const
Definition: indexing.hpp:74
ScheduleData valuationSchedule_
Definition: indexing.hpp:112
bool & indexIsConditionalOnSurvival()
Definition: indexing.hpp:86
bool & indexIsDirty()
Definition: indexing.hpp:84
bool hasData() const
Definition: indexing.hpp:58
const string & fixingCalendar() const
Definition: indexing.hpp:72
string & indexFixingCalendar()
Definition: indexing.hpp:82
const ScheduleData & valuationSchedule() const
Definition: indexing.hpp:70
const string & index() const
Definition: indexing.hpp:60
string fixingConvention_
Definition: indexing.hpp:115
Size fixingDays() const
Definition: indexing.hpp:71
virtual void fromXML(XMLNode *node) override
Definition: indexing.cpp:26
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: indexing.cpp:61
Real initialNotionalFixing() const
Definition: indexing.hpp:69
const string & indexFixingCalendar() const
Definition: indexing.hpp:62
Size & fixingDays()
Definition: indexing.hpp:91
string indexFixingCalendar_
Definition: indexing.hpp:106
bool indexIsRelative() const
Definition: indexing.hpp:65
ScheduleData & valuationSchedule()
Definition: indexing.hpp:90
const string & fixingConvention() const
Definition: indexing.hpp:73
Real & initialNotionalFixing()
Definition: indexing.hpp:89
bool indexIsDirty() const
Definition: indexing.hpp:64
bool & indexIsRelative()
Definition: indexing.hpp:85
Real quantity() const
Definition: indexing.hpp:59
bool indexIsConditionalOnSurvival_
Definition: indexing.hpp:109
bool & inArrearsFixing()
Definition: indexing.hpp:94
Real & initialFixing()
Definition: indexing.hpp:88
bool indexIsConditionalOnSurvival() const
Definition: indexing.hpp:66
Indexing(const std::string &index, const string &indexFixingCalendar="", const bool indexIsDirty=false, const bool indexIsRelative=true, const bool indexIsConditionalOnSurvival=true, const Real quantity=1.0, const Real initialFixing=Null< Real >(), const Real initialNotionalFixing=Null< Real >(), const ScheduleData &valuationSchedule=ScheduleData(), const Size fixingDays=0, const string &fixingCalendar="", const string &fixingConvention="", const bool inArrearsFixing=false)
Definition: indexing.hpp:43
string & fixingCalendar()
Definition: indexing.hpp:92
Serializable schedule data.
Definition: schedule.hpp:202
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade schedule data model and serialization