Market data loader base class. More...
#include <ored/marketdata/loader.hpp>
Public Member Functions | |
virtual | ~Loader () |
Interface | |
class | boost::serialization::access |
Serialization. More... | |
Date | actualDate_ = Date() |
virtual std::vector< QuantLib::ext::shared_ptr< MarketDatum > > | loadQuotes (const QuantLib::Date &) const =0 |
get all quotes, TODO change the return value to std::set More... | |
virtual QuantLib::ext::shared_ptr< MarketDatum > | get (const std::string &name, const QuantLib::Date &d) const |
get quote by its unique name, throws if not existent, override in derived classes for performance More... | |
virtual std::set< QuantLib::ext::shared_ptr< MarketDatum > > | get (const std::set< std::string > &names, const QuantLib::Date &asof) const |
get quotes matching a set of names, this should be overridden in derived classes for performance More... | |
virtual std::set< QuantLib::ext::shared_ptr< MarketDatum > > | get (const Wildcard &wildcard, const QuantLib::Date &asof) const |
get quotes matching a wildcard, this should be overriden in derived classes for performance More... | |
virtual bool | has (const std::string &name, const QuantLib::Date &d) const |
Default implementation, returns false if get throws or returns a null pointer. More... | |
virtual bool | hasQuotes (const QuantLib::Date &d) const |
check if there are quotes for a date More... | |
virtual QuantLib::ext::shared_ptr< MarketDatum > | get (const std::pair< std::string, bool > &name, const QuantLib::Date &d) const |
virtual std::set< Fixing > | loadFixings () const =0 |
virtual bool | hasFixing (const string &name, const QuantLib::Date &d) const |
virtual Fixing | getFixing (const string &name, const QuantLib::Date &d) const |
Default implementation for getFixing. More... | |
virtual std::set< QuantExt::Dividend > | loadDividends () const |
Optional load dividends method. More... | |
void | setActualDate (const QuantLib::Date &d) |
const Date & | actualDate () const |
std::pair< bool, string > | checkFxDuplicate (const ext::shared_ptr< MarketDatum >, const QuantLib::Date &) |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Market data loader base class.
Definition at line 47 of file loader.hpp.
|
virtual |
Definition at line 49 of file loader.hpp.
|
pure virtual |
get all quotes, TODO change the return value to std::set
Implemented in CSVLoader, CompositeLoader, and InMemoryLoader.
|
virtual |
get quote by its unique name, throws if not existent, override in derived classes for performance
Reimplemented in CompositeLoader, CSVLoader, and InMemoryLoader.
Definition at line 24 of file loader.cpp.
|
virtual |
get quotes matching a set of names, this should be overridden in derived classes for performance
Reimplemented in CompositeLoader, CSVLoader, and InMemoryLoader.
Definition at line 32 of file loader.cpp.
|
virtual |
get quotes matching a wildcard, this should be overriden in derived classes for performance
Reimplemented in CompositeLoader, CSVLoader, and InMemoryLoader.
Definition at line 43 of file loader.cpp.
|
virtual |
Default implementation, returns false if get throws or returns a null pointer.
Reimplemented in CompositeLoader.
Definition at line 53 of file loader.cpp.
|
virtual |
check if there are quotes for a date
Reimplemented in InMemoryLoader.
Definition at line 61 of file loader.cpp.
|
virtual |
Default implementation for get that allows for the market data item to be optional. The first element of the name
pair is the name of the market point being sought and the second element of the name
pair is a flag to indicate if the market data point is optional, true
, or not, false
.
d
, it is returnedd
and it is optional, a warning is logged and a QuantLib::ext::shared_ptr<MarketDatum>()
is returnedd
and it is not optional, an exception is thrown Definition at line 69 of file loader.cpp.
|
pure virtual |
Implemented in CompositeLoader, CSVLoader, and InMemoryLoader.
|
virtual |
Definition at line 100 of file loader.cpp.
|
virtual |
Default implementation for getFixing.
Definition at line 108 of file loader.cpp.
|
virtual |
Optional load dividends method.
Reimplemented in CompositeLoader, CSVLoader, and InMemoryLoader.
Definition at line 118 of file loader.cpp.
void setActualDate | ( | const QuantLib::Date & | d | ) |
Definition at line 94 of file loader.hpp.
const Date & actualDate | ( | ) | const |
std::pair< bool, string > checkFxDuplicate | ( | const ext::shared_ptr< MarketDatum > | md, |
const QuantLib::Date & | d | ||
) |
Definition at line 85 of file loader.cpp.
|
private |
Definition at line 102 of file loader.hpp.
|
friend |
Serialization.
Definition at line 101 of file loader.hpp.
|
protected |
For lagged market data, where we need to take data from a different date but want to treat it as belonging to the valuation date.
Definition at line 108 of file loader.hpp.