Utility class for loading market quotes and fixings from a file. More...
#include <ored/marketdata/csvloader.hpp>
Public Member Functions | |
CSVLoader () | |
Constructor. More... | |
CSVLoader (const string &marketFilename, const string &fixingFilename, bool implyTodaysFixings=false, Date fixingCutOffDate=Date()) | |
CSVLoader (const vector< string > &marketFiles, const vector< string > &fixingFiles, bool implyTodaysFixings=false, Date fixingCutOffDate=Date()) | |
CSVLoader (const string &marketFilename, const string &fixingFilename, const string ÷ndFilename, bool implyTodaysFixings=false, Date fixingCutOffDate=Date()) | |
CSVLoader (const vector< string > &marketFiles, const vector< string > &fixingFiles, const vector< string > ÷ndFiles, bool implyTodaysFixings=false, Date fixingCutOffDate=Date()) | |
std::vector< QuantLib::ext::shared_ptr< MarketDatum > > | loadQuotes (const QuantLib::Date &) const override |
get all quotes, TODO change the return value to std::set More... | |
QuantLib::ext::shared_ptr< MarketDatum > | get (const string &name, const QuantLib::Date &d) const override |
get quote by its unique name, throws if not existent, override in derived classes for performance More... | |
std::set< QuantLib::ext::shared_ptr< MarketDatum > > | get (const std::set< std::string > &names, const QuantLib::Date &asof) const override |
get quotes matching a set of names, this should be overridden in derived classes for performance More... | |
std::set< QuantLib::ext::shared_ptr< MarketDatum > > | get (const Wildcard &wildcard, const QuantLib::Date &asof) const override |
get quotes matching a wildcard More... | |
std::set< Fixing > | loadFixings () const override |
Load fixings. More... | |
std::set< QuantExt::Dividend > | loadDividends () const override |
Load dividends. More... | |
Public Member Functions inherited from Loader | |
virtual | ~Loader () |
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 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... | |
void | setActualDate (const QuantLib::Date &d) |
const Date & | actualDate () const |
std::pair< bool, string > | checkFxDuplicate (const ext::shared_ptr< MarketDatum >, const QuantLib::Date &) |
Private Types | |
enum class | DataType { Market , Fixing , Dividend } |
Private Member Functions | |
void | loadFile (const string &, DataType) |
Private Attributes | |
bool | implyTodaysFixings_ |
std::map< QuantLib::Date, std::set< QuantLib::ext::shared_ptr< MarketDatum >, SharedPtrMarketDatumComparator > > | data_ |
std::set< Fixing > | fixings_ |
std::set< QuantExt::Dividend > | dividends_ |
Date | fixingCutOffDate_ |
Additional Inherited Members | |
Protected Attributes inherited from Loader | |
Date | actualDate_ = Date() |
Utility class for loading market quotes and fixings from a file.
Data is loaded with the call to the constructor. Inspectors can be called to then retrieve quotes and fixings.
TODO implementation has large overlap with inmemoryloader.?pp, factor this out
Definition at line 41 of file csvloader.hpp.
|
strongprivate |
CSVLoader | ( | ) |
CSVLoader | ( | const string & | marketFilename, |
const string & | fixingFilename, | ||
bool | implyTodaysFixings = false , |
||
Date | fixingCutOffDate = Date() |
||
) |
marketFilename | Quote file name |
fixingFilename | Fixing file name |
implyTodaysFixings | Enable/disable implying today's fixings |
fixingCutOffDate | Load fixings up to this date |
Definition at line 38 of file csvloader.cpp.
CSVLoader | ( | const vector< string > & | marketFiles, |
const vector< string > & | fixingFiles, | ||
bool | implyTodaysFixings = false , |
||
Date | fixingCutOffDate = Date() |
||
) |
marketFiles | Quote file name |
fixingFiles | Fixing file name |
implyTodaysFixings | Enable/disable implying today's fixings |
fixingCutOffDate | Load fixings up to this date |
Definition at line 42 of file csvloader.cpp.
CSVLoader | ( | const string & | marketFilename, |
const string & | fixingFilename, | ||
const string & | dividendFilename, | ||
bool | implyTodaysFixings = false , |
||
Date | fixingCutOffDate = Date() |
||
) |
marketFilename | Quote file name |
fixingFilename | Fixing file name |
dividendFilename | Dividend file name |
implyTodaysFixings | Enable/disable implying today's fixings |
fixingCutOffDate | Load fixings up to this date |
Definition at line 45 of file csvloader.cpp.
CSVLoader | ( | const vector< string > & | marketFiles, |
const vector< string > & | fixingFiles, | ||
const vector< string > & | dividendFiles, | ||
bool | implyTodaysFixings = false , |
||
Date | fixingCutOffDate = Date() |
||
) |
marketFiles | Quote file name |
fixingFiles | Fixing file name |
dividendFiles | Dividend file name |
implyTodaysFixings | Enable/disable implying today's fixings |
fixingCutOffDate | Load fixings up to this date |
Definition at line 69 of file csvloader.cpp.
|
overridevirtual |
get all quotes, TODO change the return value to std::set
Implements Loader.
Definition at line 192 of file csvloader.cpp.
|
overridevirtual |
get quote by its unique name, throws if not existent, override in derived classes for performance
Reimplemented from Loader.
Definition at line 199 of file csvloader.cpp.
|
overridevirtual |
get quotes matching a set of names, this should be overridden in derived classes for performance
Reimplemented from Loader.
Definition at line 207 of file csvloader.cpp.
|
overridevirtual |
get quotes matching a wildcard
Reimplemented from Loader.
Definition at line 221 of file csvloader.cpp.
|
overridevirtual |
|
overridevirtual |
|
private |
Definition at line 100 of file csvloader.cpp.
|
private |
Definition at line 104 of file csvloader.hpp.
|
private |
Definition at line 105 of file csvloader.hpp.
|
private |
Definition at line 106 of file csvloader.hpp.
|
private |
Definition at line 107 of file csvloader.hpp.
|
private |
Definition at line 108 of file csvloader.hpp.