QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
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 const Period &lag,
62 const Currency &ccy,
64 : YoYInflationIndex("YY_CPI",
66 revised,
68 lag,
69 ccy,
70 ts) {}
71
73
74 /*! \deprecated Use the overload without the interpolated parameter.
75 Deprecated in version 1.38.
76 */
77 [[deprecated("Use the overload without the interpolated parameter")]]
79 bool revised,
80 bool interpolated,
81 const Period &lag,
82 const Currency &ccy,
84 : YoYInflationIndex("YY_CPI",
86 revised,
89 lag,
90 ccy,
91 ts) {}
92
94 };
95
96}
97
98#endif
99
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, const Period &lag, const Currency &ccy, const Handle< YoYInflationTermStructure > &ts={})
QL_DEPRECATED_DISABLE_WARNING YYGenericCPI(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:37
#define QL_DEPRECATED_DISABLE_WARNING
Definition: qldefines.hpp:216
#define QL_DEPRECATED_ENABLE_WARNING
Definition: qldefines.hpp:217