QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
purely virtual base class for indexes More...
#include <index.hpp>
Public Member Functions | |
~Index () override=default | |
virtual std::string | name () const =0 |
Returns the name of the index. More... | |
virtual Calendar | fixingCalendar () const =0 |
returns the calendar defining valid fixing dates More... | |
virtual bool | isValidFixingDate (const Date &fixingDate) const =0 |
returns TRUE if the fixing date is a valid one More... | |
bool | hasHistoricalFixing (const Date &fixingDate) const |
returns whether a historical fixing was stored for the given date More... | |
virtual Real | fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const =0 |
returns the fixing at the given date More... | |
virtual Real | pastFixing (const Date &fixingDate) const |
returns a past fixing at the given date More... | |
const TimeSeries< Real > & | timeSeries () const |
returns the fixing TimeSeries More... | |
virtual bool | allowsNativeFixings () |
check if index allows for native fixings. More... | |
![]() | |
Observable ()=default | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
![]() | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (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 () |
Observer interface | |
stores the historical fixing at the given date the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used. | |
void | update () override |
virtual void | addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false) |
void | addFixings (const TimeSeries< Real > &t, bool forceOverwrite=false) |
stores historical fixings from a TimeSeries More... | |
template<class DateIterator , class ValueIterator > | |
void | addFixings (DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false) |
stores historical fixings at the given dates More... | |
void | clearFixings () |
clears all stored historical fixings More... | |
ext::shared_ptr< Observable > | notifier () const |
void | checkNativeFixingsAllowed () |
check if index allows for native fixings More... | |
Additional Inherited Members | |
![]() | |
typedef set_type::iterator | iterator |
purely virtual base class for indexes
|
overridedefault |
|
pure virtual |
Returns the name of the index.
Implemented in CommodityIndex, EquityIndex, InflationIndex, and InterestRateIndex.
|
pure virtual |
returns the calendar defining valid fixing dates
Implemented in CommodityIndex, EquityIndex, InflationIndex, and InterestRateIndex.
returns TRUE if the fixing date is a valid one
Implemented in InflationIndex, CommodityIndex, BMAIndex, EquityIndex, and InterestRateIndex.
|
pure virtual |
returns the fixing at the given date
the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
Implemented in CommodityIndex, EquityIndex, ZeroInflationIndex, YoYInflationIndex, InterestRateIndex, and InflationIndex.
returns a past fixing at the given date
the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
Reimplemented in SwapSpreadIndex, ZeroInflationIndex, YoYInflationIndex, and InflationIndex.
Definition at line 131 of file index.hpp.
const TimeSeries< Real > & timeSeries | ( | ) | const |
returns the fixing TimeSeries
Definition at line 71 of file index.hpp.
|
virtual |
check if index allows for native fixings.
If this returns false, calls to addFixing and similar methods will raise an exception.
Reimplemented in SwapSpreadIndex.
Definition at line 80 of file index.hpp.
|
overridevirtual |
This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.
Implements Observer.
Definition at line 136 of file index.hpp.
Reimplemented in InflationIndex.
Definition at line 24 of file index.cpp.
void addFixings | ( | const TimeSeries< Real > & | t, |
bool | forceOverwrite = false |
||
) |
stores historical fixings from a TimeSeries
the dates in the TimeSeries must be the actual calendar dates of the fixings; no settlement days must be used.
Definition at line 31 of file index.cpp.
void addFixings | ( | DateIterator | dBegin, |
DateIterator | dEnd, | ||
ValueIterator | vBegin, | ||
bool | forceOverwrite = false |
||
) |
void clearFixings | ( | ) |
|
protected |