Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InflationIndexObserver Class Reference

Inflation Index observer. More...

#include <qle/indexes/inflationindexobserver.hpp>

+ Inheritance diagram for InflationIndexObserver:
+ Collaboration diagram for InflationIndexObserver:

Public Member Functions

 InflationIndexObserver (const QuantLib::ext::shared_ptr< InflationIndex > &index, const Handle< Quote > &quote, const Period &observationLag, const DayCounter &dayCounter=DayCounter())
 
void update () override
 
Date maxDate () const override
 

Private Member Functions

void setFixing ()
 

Private Attributes

QuantLib::ext::shared_ptr< InflationIndex > index_
 
Handle< Quote > quote_
 
Period observationLag_
 

Detailed Description

Inflation Index observer.

Definition at line 31 of file inflationindexobserver.hpp.

Constructor & Destructor Documentation

◆ InflationIndexObserver()

InflationIndexObserver ( const QuantLib::ext::shared_ptr< InflationIndex > &  index,
const Handle< Quote > &  quote,
const Period &  observationLag,
const DayCounter &  dayCounter = DayCounter() 
)

Definition at line 33 of file inflationindexobserver.hpp.

35 : TermStructure(dayCounter), index_(index), quote_(quote), observationLag_(observationLag) {
36 registerWith(quote_);
37 }
QuantLib::ext::shared_ptr< InflationIndex > index_

Member Function Documentation

◆ update()

void update ( )
override

Definition at line 39 of file inflationindexobserver.hpp.

39 { // called when the quote changes
40 setFixing();
41 }
+ Here is the call graph for this function:

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 43 of file inflationindexobserver.hpp.

43 {
44 Date today = Settings::instance().evaluationDate();
45 return today;
46 }

◆ setFixing()

void setFixing ( )
private

Definition at line 49 of file inflationindexobserver.hpp.

49 {
50 // something like this
51 Date today = Settings::instance().evaluationDate();
52 Date fixingDate = today - observationLag_;
53 // overwrite the current fixing in the QuantLib::FixingManager
54 index_->addFixing(fixingDate, quote_->value(), true);
55 }
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
Definition: inflation.cpp:183
+ Here is the caller graph for this function:

Member Data Documentation

◆ index_

QuantLib::ext::shared_ptr<InflationIndex> index_
private

Definition at line 57 of file inflationindexobserver.hpp.

◆ quote_

Handle<Quote> quote_
private

Definition at line 58 of file inflationindexobserver.hpp.

◆ observationLag_

Period observationLag_
private

Definition at line 59 of file inflationindexobserver.hpp.