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

Generic Index. More...

#include <qle/indexes/genericindex.hpp>

+ Inheritance diagram for GenericIndex:
+ Collaboration diagram for GenericIndex:

Public Member Functions

 GenericIndex (const std::string &name, const QuantLib::Date &expiry=QuantLib::Date())
 

Index interface

std::string name_
 
QuantLib::Date expiry_
 
std::string name () const override
 
const QuantLib::Date & expiry () const
 
QuantLib::Calendar fixingCalendar () const override
 
bool isValidFixingDate (const QuantLib::Date &fixingDate) const override
 
QuantLib::Real fixing (const QuantLib::Date &fixingDate, bool forecastTodaysFixing=false) const override
 

Detailed Description

Generic Index.

Definition at line 33 of file genericindex.hpp.

Constructor & Destructor Documentation

◆ GenericIndex()

GenericIndex ( const std::string &  name,
const QuantLib::Date &  expiry = QuantLib::Date() 
)
explicit

Definition at line 35 of file genericindex.hpp.

35 :
QuantLib::Date expiry_
std::string name() const override
const QuantLib::Date & expiry() const

Member Function Documentation

◆ name()

std::string name ( ) const
override

Definition at line 39 of file genericindex.hpp.

39{ return name_; }
+ Here is the caller graph for this function:

◆ expiry()

const QuantLib::Date & expiry ( ) const

Definition at line 40 of file genericindex.hpp.

40{ return expiry_; }

◆ fixingCalendar()

QuantLib::Calendar fixingCalendar ( ) const
override

Definition at line 41 of file genericindex.hpp.

41{ return QuantLib::NullCalendar(); }

◆ isValidFixingDate()

bool isValidFixingDate ( const QuantLib::Date &  fixingDate) const
override

Definition at line 42 of file genericindex.hpp.

42{ return true; }

◆ fixing()

QuantLib::Real fixing ( const QuantLib::Date &  fixingDate,
bool  forecastTodaysFixing = false 
) const
override

Definition at line 43 of file genericindex.hpp.

43 {
44 if (expiry_ != QuantLib::Date() && fixingDate >= expiry_)
45 QL_FAIL("GenericIndex, fixingDate is after expiry");
46 QuantLib::Real tmp = timeSeries()[fixingDate];
47 QL_REQUIRE(tmp != QuantLib::Null<QuantLib::Real>(), "Missing " << name() << " fixing for " << fixingDate);
48 return tmp;
49 }
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
Definition: inflation.cpp:183
+ Here is the call graph for this function:

Member Data Documentation

◆ name_

std::string name_
private

Definition at line 52 of file genericindex.hpp.

◆ expiry_

QuantLib::Date expiry_
private

Definition at line 53 of file genericindex.hpp.