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

global repository for past dividends More...

#include <qle/indexes/dividendmanager.hpp>

+ Inheritance diagram for DividendManager:
+ Collaboration diagram for DividendManager:

Public Member Functions

bool hasHistory (const std::string &name) const
 returns whether historical fixings were stored for the index More...
 
const std::set< Dividend > & getHistory (const std::string &name)
 returns the (possibly empty) history of the index fixings More...
 
void setHistory (const std::string &name, const std::set< Dividend > &)
 stores the historical fixings of the index More...
 
QuantLib::ext::shared_ptr< QuantLib::Observable > notifier (const std::string &name)
 observer notifying of changes in the index fixings More...
 
void clearHistory (const std::string &name)
 
void clearHistories ()
 

Private Types

typedef std::map< std::string, QuantLib::ObservableValue< std::set< Dividend > > > history_map
 

Private Member Functions

 DividendManager ()=default
 

Private Attributes

history_map data_
 

Friends

class QuantLib::Singleton< DividendManager >
 

Detailed Description

global repository for past dividends

Note
index names are case insensitive

Definition at line 62 of file dividendmanager.hpp.

Member Typedef Documentation

◆ history_map

typedef std::map<std::string, QuantLib::ObservableValue<std::set<Dividend> > > history_map
private

Definition at line 81 of file dividendmanager.hpp.

Constructor & Destructor Documentation

◆ DividendManager()

DividendManager ( )
privatedefault

Member Function Documentation

◆ hasHistory()

bool hasHistory ( const std::string &  name) const

returns whether historical fixings were stored for the index

Definition at line 59 of file dividendmanager.cpp.

59{ return data_.find(to_upper_copy(name)) != data_.end(); }

◆ getHistory()

const set< Dividend > & getHistory ( const std::string &  name)

returns the (possibly empty) history of the index fixings

Definition at line 61 of file dividendmanager.cpp.

61 {
62 return data_[to_upper_copy(name)].value();
63}

◆ setHistory()

void setHistory ( const std::string &  name,
const std::set< Dividend > &  history 
)

stores the historical fixings of the index

Definition at line 65 of file dividendmanager.cpp.

65 {
66 data_[to_upper_copy(name)] = history;
67}

◆ notifier()

QuantLib::ext::shared_ptr< Observable > notifier ( const std::string &  name)

observer notifying of changes in the index fixings

Definition at line 69 of file dividendmanager.cpp.

69{ return data_[to_upper_copy(name)]; }

◆ clearHistory()

void clearHistory ( const std::string &  name)

Definition at line 71 of file dividendmanager.cpp.

71{ data_.erase(name); }

◆ clearHistories()

void clearHistories ( )

Definition at line 73 of file dividendmanager.cpp.

73{ data_.clear(); }

Friends And Related Function Documentation

◆ QuantLib::Singleton< DividendManager >

friend class QuantLib::Singleton< DividendManager >
friend

Definition at line 46 of file dividendmanager.hpp.

Member Data Documentation

◆ data_

history_map data_
private

Definition at line 82 of file dividendmanager.hpp.