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

global repository for past index fixings More...

#include <indexmanager.hpp>

+ Inheritance diagram for IndexManager:
+ Collaboration diagram for IndexManager:

Classes

struct  CaseInsensitiveCompare
 

Public Member Functions

std::vector< std::string > histories () const
 returns all names of the indexes for which fixings were stored More...
 
void clearHistories ()
 clears all stored fixings More...
 
bool hasHistory (const std::string &name) const
 
const TimeSeries< Real > & getHistory (const std::string &name) const
 
void clearHistory (const std::string &name)
 
bool hasHistoricalFixing (const std::string &name, const Date &fixingDate) const
 
void setHistory (const std::string &name, TimeSeries< Real > history)
 
ext::shared_ptr< Observablenotifier (const std::string &name) const
 
- Public Member Functions inherited from Singleton< IndexManager >
 Singleton (const Singleton &)=delete
 
 Singleton (Singleton &&)=delete
 
Singletonoperator= (const Singleton &)=delete
 
Singletonoperator= (Singleton &&)=delete
 
 ~Singleton ()=default
 

Private Member Functions

 IndexManager ()=default
 
void addFixing (const std::string &name, const Date &fixingDate, Real fixing, bool forceOverwrite=false)
 add a fixing More...
 
template<class DateIterator , class ValueIterator >
void addFixings (const std::string &name, DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false, const std::function< bool(const Date &d)> &isValidFixingDate={})
 add fixings More...
 

Private Attributes

std::map< std::string, TimeSeries< Real >, CaseInsensitiveComparedata_
 
std::map< std::string, ext::shared_ptr< Observable > > notifiers_
 

Friends

class Singleton< IndexManager >
 
class Index
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< IndexManager >
static IndexManagerinstance ()
 access to the unique instance More...
 
- Protected Member Functions inherited from Singleton< IndexManager >
 Singleton ()=default
 

Detailed Description

global repository for past index fixings

Note
index names are case insensitive

Definition at line 38 of file indexmanager.hpp.

Constructor & Destructor Documentation

◆ IndexManager()

IndexManager ( )
privatedefault

Member Function Documentation

◆ histories()

std::vector< std::string > histories ( ) const

returns all names of the indexes for which fixings were stored

Definition at line 55 of file indexmanager.cpp.

◆ clearHistories()

void clearHistories ( )

clears all stored fixings

Definition at line 70 of file indexmanager.cpp.

+ Here is the call graph for this function:

◆ hasHistory()

bool hasHistory ( const std::string &  name) const
Deprecated:
Use Index::hasHistoricalFixing instead. Deprecated in version 1.37.

Definition at line 24 of file indexmanager.cpp.

◆ getHistory()

const TimeSeries< Real > & getHistory ( const std::string &  name) const
Deprecated:
Use Index::timeSeries instead. Deprecated in version 1.37.

Definition at line 28 of file indexmanager.cpp.

+ Here is the caller graph for this function:

◆ clearHistory()

void clearHistory ( const std::string &  name)
Deprecated:
Use Index::clearFixings instead. Deprecated in version 1.37.

Definition at line 63 of file indexmanager.cpp.

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

◆ hasHistoricalFixing()

bool hasHistoricalFixing ( const std::string &  name,
const Date fixingDate 
) const
Deprecated:
Use Index::hasHistoricalFixing instead. Deprecated in version 1.37.

Definition at line 78 of file indexmanager.cpp.

+ Here is the caller graph for this function:

◆ setHistory()

void setHistory ( const std::string &  name,
TimeSeries< Real history 
)
Deprecated:
Use Index::addFixings instead. Deprecated in version 1.37.

Definition at line 32 of file indexmanager.cpp.

+ Here is the call graph for this function:

◆ notifier()

ext::shared_ptr< Observable > notifier ( const std::string &  name) const
Deprecated:
Register with the relevant index instead. Deprecated in version 1.37.

Definition at line 46 of file indexmanager.cpp.

+ Here is the caller graph for this function:

◆ addFixing()

void addFixing ( const std::string &  name,
const Date fixingDate,
Real  fixing,
bool  forceOverwrite = false 
)
private

add a fixing

Definition at line 39 of file indexmanager.cpp.

+ Here is the call graph for this function:

◆ addFixings()

void addFixings ( const std::string &  name,
DateIterator  dBegin,
DateIterator  dEnd,
ValueIterator  vBegin,
bool  forceOverwrite = false,
const std::function< bool(const Date &d)> &  isValidFixingDate = {} 
)
private

add fixings

Definition at line 108 of file indexmanager.hpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Singleton< IndexManager >

friend class Singleton< IndexManager >
friend

Definition at line 1 of file indexmanager.hpp.

◆ Index

friend class Index
friend

Definition at line 40 of file indexmanager.hpp.

Member Data Documentation

◆ data_

std::map<std::string, TimeSeries<Real>, CaseInsensitiveCompare> data_
mutableprivate

Definition at line 98 of file indexmanager.hpp.

◆ notifiers_

std::map<std::string, ext::shared_ptr<Observable> > notifiers_
mutableprivate

Definition at line 99 of file indexmanager.hpp.