QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
CPICashFlow Class Reference

Cash flow paying the performance of a CPI (zero inflation) index. More...

#include <cpicoupon.hpp>

+ Inheritance diagram for CPICashFlow:
+ Collaboration diagram for CPICashFlow:

Public Member Functions

 CPICashFlow (Real notional, const ext::shared_ptr< ZeroInflationIndex > &index, const Date &baseDate, Real baseFixing, const Date &observationDate, const Period &observationLag, CPI::InterpolationType interpolation, const Date &paymentDate, bool growthOnly=false)
 
Real baseFixing () const override
 value used on base date More...
 
Date baseDate () const override
 you may not have a valid date More...
 
Date observationDate () const
 
Period observationLag () const
 
virtual CPI::InterpolationType interpolation () const
 do you want linear/constant/as-index interpolation of future data? More...
 
virtual Frequency frequency () const
 
ext::shared_ptr< ZeroInflationIndexcpiIndex () const
 
Real indexFixing () const override
 
Real amount () const override
 returns the amount of the cash flow More...
 
- Public Member Functions inherited from IndexedCashFlow
 IndexedCashFlow (Real notional, ext::shared_ptr< Index > index, const Date &baseDate, const Date &fixingDate, const Date &paymentDate, bool growthOnly=false)
 
Date date () const override
 
virtual Real notional () const
 
virtual Date fixingDate () const
 
virtual ext::shared_ptr< Indexindex () const
 
virtual bool growthOnly () const
 
Real amount () const override
 returns the amount of the cash flow More...
 
void accept (AcyclicVisitor &) override
 
void performCalculations () const override
 
- Public Member Functions inherited from CashFlow
 ~CashFlow () override=default
 
bool hasOccurred (const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const override
 returns true if an event has already occurred before a date More...
 
virtual Date exCouponDate () const
 returns the date that the cash flow trades exCoupon More...
 
bool tradingExCoupon (const Date &refDate=Date()) const
 returns true if the cashflow is trading ex-coupon on the refDate More...
 
- Public Member Functions inherited from Event
 ~Event () override=default
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
void update () override
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Protected Attributes

Real baseFixing_
 
Date observationDate_
 
Period observationLag_
 
CPI::InterpolationType interpolation_
 
Frequency frequency_
 
- Protected Attributes inherited from IndexedCashFlow
Real amount_
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from LazyObject
virtual void calculate () const
 

Detailed Description

Cash flow paying the performance of a CPI (zero inflation) index.

It is NOT a coupon, i.e. no accruals.

Definition at line 230 of file cpicoupon.hpp.

Constructor & Destructor Documentation

◆ CPICashFlow()

CPICashFlow ( Real  notional,
const ext::shared_ptr< ZeroInflationIndex > &  index,
const Date baseDate,
Real  baseFixing,
const Date observationDate,
const Period observationLag,
CPI::InterpolationType  interpolation,
const Date paymentDate,
bool  growthOnly = false 
)

Definition at line 199 of file cpicoupon.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ baseFixing()

Real baseFixing ( ) const
overridevirtual

value used on base date

This does not have to agree with index on that date.

Reimplemented from IndexedCashFlow.

Definition at line 228 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ baseDate()

Date baseDate ( ) const
overridevirtual

you may not have a valid date

Reimplemented from IndexedCashFlow.

Definition at line 219 of file cpicoupon.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ observationDate()

Date observationDate ( ) const

Definition at line 248 of file cpicoupon.hpp.

◆ observationLag()

Period observationLag ( ) const

Definition at line 249 of file cpicoupon.hpp.

◆ interpolation()

virtual CPI::InterpolationType interpolation ( ) const
virtual

do you want linear/constant/as-index interpolation of future data?

Definition at line 251 of file cpicoupon.hpp.

◆ frequency()

virtual Frequency frequency ( ) const
virtual

Definition at line 254 of file cpicoupon.hpp.

◆ cpiIndex()

ext::shared_ptr< ZeroInflationIndex > cpiIndex ( ) const

Definition at line 375 of file cpicoupon.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ indexFixing()

Real indexFixing ( ) const
overridevirtual

Reimplemented from IndexedCashFlow.

Definition at line 232 of file cpicoupon.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ amount()

Real amount ( ) const
overridevirtual

returns the amount of the cash flow

Note
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow.

Definition at line 242 of file cpicoupon.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ baseFixing_

Real baseFixing_
protected

Definition at line 263 of file cpicoupon.hpp.

◆ observationDate_

Date observationDate_
protected

Definition at line 264 of file cpicoupon.hpp.

◆ observationLag_

Period observationLag_
protected

Definition at line 265 of file cpicoupon.hpp.

◆ interpolation_

CPI::InterpolationType interpolation_
protected

Definition at line 266 of file cpicoupon.hpp.

◆ frequency_

Frequency frequency_
protected

Definition at line 267 of file cpicoupon.hpp.