QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
genericindexes.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 Chris Kenyon
5 Copyright (C) 2021 Ralf Konrad Eckel
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_generic_inflation_indexes_hpp
26#define quantlib_generic_inflation_indexes_hpp
27
28#include <ql/indexes/inflationindex.hpp>
29
30namespace QuantLib {
31
33 class GenericRegion : public Region {
34 public:
36 static ext::shared_ptr<Data> GENERICdata(
37 new Data("Generic","GENERIC"));
38 data_ = GENERICdata;
39 }
40 };
41
42
45 public:
48 bool revised,
49 const Period& lag,
50 const Currency& ccy,
52 : ZeroInflationIndex("CPI", GenericRegion(), revised, frequency, lag, ccy, ts) {}
53
57 QL_DEPRECATED
59 bool revised,
60 bool interpolated,
61 const Period &lag,
62 const Currency &ccy,
64 : GenericCPI(frequency, revised, lag, ccy, ts) {
65 QL_DEPRECATED_DISABLE_WARNING
67 QL_DEPRECATED_ENABLE_WARNING
68 }
69 };
70
71
74 public:
76 bool revised,
77 bool interpolated,
78 const Period &lag,
79 const Currency &ccy,
81 : YoYInflationIndex("YY_CPI",
83 revised,
86 lag,
87 ccy,
88 ts) {}
89 };
90
91 QL_DEPRECATED_DISABLE_WARNING
92
94
97 class [[deprecated("Pass a zero-inflation index to YoYInflationIndex instead")]] YYGenericCPIr : public YoYInflationIndex {
98 public:
100 bool revised,
101 bool interpolated,
102 const Period &lag,
103 const Currency &ccy,
105 : YoYInflationIndex("YYR_CPI",
107 revised,
108 interpolated,
109 true,
110 frequency,
111 lag,
112 ccy,
113 ts) {}
114 };
115
116 QL_DEPRECATED_ENABLE_WARNING
117}
118
119#endif
120
Currency specification
Definition: currency.hpp:36
Generic CPI index.
GenericCPI(Frequency frequency, bool revised, const Period &lag, const Currency &ccy, const Handle< ZeroInflationTermStructure > &ts={})
QL_DEPRECATED GenericCPI(Frequency frequency, bool revised, bool interpolated, const Period &lag, const Currency &ccy, const Handle< ZeroInflationTermStructure > &ts={})
Generic geographical/economic region.
Shared handle to an observable.
Definition: handle.hpp:41
QL_DEPRECATED bool interpolated() const
Frequency frequency() const
QL_DEPRECATED bool interpolated_
Region class, used for inflation applicability.
Definition: region.hpp:36
ext::shared_ptr< Data > data_
Definition: region.hpp:46
Quoted year-on-year Generic CPI (i.e. not a ratio)
YYGenericCPI(Frequency frequency, bool revised, bool interpolated, const Period &lag, const Currency &ccy, const Handle< YoYInflationTermStructure > &ts={})
Year-on-year GenericCPI (i.e. a ratio)
YYGenericCPIr(Frequency frequency, bool revised, bool interpolated, const Period &lag, const Currency &ccy, const Handle< YoYInflationTermStructure > &ts={})
Base class for year-on-year inflation indices.
Base class for zero inflation indices.
Frequency
Frequency of events.
Definition: frequency.hpp:37
Definition: any.hpp:35