QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
genericindexes.hpp
Go to the documentation of this file.
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
21/*! \file genericindexes.hpp
22 \brief Generic inflation indexes
23*/
24
25#ifndef quantlib_generic_inflation_indexes_hpp
26#define quantlib_generic_inflation_indexes_hpp
27
29
30namespace QuantLib {
31
32 //! Generic geographical/economic region
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
43 //! Generic CPI index
45 public:
48 bool revised,
49 const Period& lag,
50 const Currency& ccy,
52 : ZeroInflationIndex("CPI", GenericRegion(), revised, frequency, lag, ccy, ts) {}
53 };
54
55
56 //! Quoted year-on-year Generic CPI (i.e. not a ratio)
58 public:
60 bool revised,
61 bool interpolated,
62 const Period &lag,
63 const Currency &ccy,
65 : YoYInflationIndex("YY_CPI",
67 revised,
70 lag,
71 ccy,
72 ts) {}
73 };
74
76
77 //! Year-on-year GenericCPI (i.e. a ratio)
78 /*! \deprecated Pass a zero-inflation index to YoYInflationIndex instead.
79 Deprecated in version 1.31.
80 */
81 class [[deprecated("Pass a zero-inflation index to YoYInflationIndex instead")]] YYGenericCPIr : public YoYInflationIndex {
82 public:
84 bool revised,
85 bool interpolated,
86 const Period &lag,
87 const Currency &ccy,
89 : YoYInflationIndex("YYR_CPI",
91 revised,
92 interpolated,
93 true,
94 frequency,
95 lag,
96 ccy,
97 ts) {}
98 };
99
101}
102
103#endif
104
Currency specification
Definition: currency.hpp:36
Generic CPI index.
GenericCPI(Frequency frequency, bool revised, const Period &lag, const Currency &ccy, const Handle< ZeroInflationTermStructure > &ts={})
Generic geographical/economic region.
Shared handle to an observable.
Definition: handle.hpp:41
Frequency frequency() const
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
base classes for inflation indexes
Definition: any.hpp:35
#define QL_DEPRECATED_DISABLE_WARNING
Definition: qldefines.hpp:216
#define QL_DEPRECATED_ENABLE_WARNING
Definition: qldefines.hpp:217