|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
exchange-rate repository More...
#include <exchangeratemanager.hpp>
Inheritance diagram for ExchangeRateManager:
Collaboration diagram for ExchangeRateManager:Classes | |
| struct | Entry |
Public Member Functions | |
| void | add (const ExchangeRate &, const Date &startDate=Date::minDate(), const Date &endDate=Date::maxDate()) |
| Add an exchange rate. More... | |
| ExchangeRate | lookup (const Currency &source, const Currency &target, Date date=Date(), ExchangeRate::Type type=ExchangeRate::Derived) const |
| void | clear () |
| remove the added exchange rates More... | |
Public Member Functions inherited from Singleton< ExchangeRateManager > | |
| Singleton (const Singleton &)=delete | |
| Singleton (Singleton &&)=delete | |
| Singleton & | operator= (const Singleton &)=delete |
| Singleton & | operator= (Singleton &&)=delete |
| ~Singleton ()=default | |
Private Types | |
| typedef BigInteger | Key |
Private Member Functions | |
| ExchangeRateManager () | |
| Key | hash (const Currency &, const Currency &) const |
| bool | hashes (Key, const Currency &) const |
| void | addKnownRates () |
| ExchangeRate | directLookup (const Currency &source, const Currency &target, const Date &date) const |
| ExchangeRate | smartLookup (const Currency &source, const Currency &target, const Date &date, std::list< Integer > forbiddenCodes=std::list< Integer >()) const |
| const ExchangeRate * | fetch (const Currency &source, const Currency &target, const Date &date) const |
Private Attributes | |
| std::map< Key, std::list< Entry > > | data_ |
Friends | |
| class | Singleton< ExchangeRateManager > |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< ExchangeRateManager > | |
| static ExchangeRateManager & | instance () |
| access to the unique instance More... | |
Protected Member Functions inherited from Singleton< ExchangeRateManager > | |
| Singleton ()=default | |
exchange-rate repository
Definition at line 41 of file exchangeratemanager.hpp.
|
private |
Definition at line 81 of file exchangeratemanager.hpp.
|
private |
| void add | ( | const ExchangeRate & | rate, |
| const Date & | startDate = Date::minDate(), |
||
| const Date & | endDate = Date::maxDate() |
||
| ) |
Add an exchange rate.
The given rate is valid between the given dates.
Definition at line 45 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| ExchangeRate lookup | ( | const Currency & | source, |
| const Currency & | target, | ||
| Date | date = Date(), |
||
| ExchangeRate::Type | type = ExchangeRate::Derived |
||
| ) | const |
Lookup the exchange rate between two currencies at a given date. If the given type is Direct, only direct exchange rates will be returned if available; if Derived, direct rates are still preferred but derived rates are allowed.
Definition at line 52 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void clear | ( | ) |
remove the added exchange rates
Definition at line 84 of file exchangeratemanager.cpp.
Here is the call graph for this function:
|
private |
Definition at line 89 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 95 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 100 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 137 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 148 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 194 of file exchangeratemanager.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
friend |
Definition at line 1 of file exchangeratemanager.hpp.
Definition at line 82 of file exchangeratemanager.hpp.