Logo
Reference manual - version ored_version
Public Member Functions | List of all members
CSVLoader Class Reference

Utility class for loading market quotes and fixings from a file. More...

#include <ored/marketdata/csvloader.hpp>

+ Inheritance diagram for CSVLoader:

Public Member Functions

 CSVLoader ()
 Constructor.
 
 CSVLoader (const string &marketFilename, const string &fixingFilename, bool implyTodaysFixings=false)
 
 CSVLoader (const vector< string > &marketFiles, const vector< string > &fixingFiles, bool implyTodaysFixings=false)
 
 CSVLoader (const string &marketFilename, const string &fixingFilename, const string &dividendFilename, bool implyTodaysFixings=false)
 
 CSVLoader (const vector< string > &marketFiles, const vector< string > &fixingFiles, const vector< string > &dividendFiles, bool implyTodaysFixings=false)
 
std::vector< boost::shared_ptr< MarketDatum > > loadQuotes (const QuantLib::Date &) const override
 get all quotes, TODO change the return value to std::set
 
boost::shared_ptr< MarketDatumget (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
 
std::set< boost::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
 
std::set< boost::shared_ptr< MarketDatum > > get (const Wildcard &wildcard, const QuantLib::Date &asof) const override
 get quotes matching a wildcard
 
std::set< FixingloadFixings () const override
 Load fixings.
 
std::set< QuantExt::DividendloadDividends () const override
 Load dividends.
 
- Public Member Functions inherited from 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.
 
virtual bool hasQuotes (const QuantLib::Date &d) const
 check if there are quotes for a date
 
virtual boost::shared_ptr< MarketDatumget (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.
 
void setActualDate (const QuantLib::Date &d)
 
const Date & actualDate () const
 

Additional Inherited Members

- Protected Attributes inherited from Loader
Date actualDate_ = Date()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CSVLoader() [1/4]

CSVLoader ( const string &  marketFilename,
const string &  fixingFilename,
bool  implyTodaysFixings = false 
)
Parameters
marketFilenameQuote file name
fixingFilenameFixing file name
implyTodaysFixingsEnable/disable implying today's fixings

◆ CSVLoader() [2/4]

CSVLoader ( const vector< string > &  marketFiles,
const vector< string > &  fixingFiles,
bool  implyTodaysFixings = false 
)
Parameters
marketFilesQuote file name
fixingFilesFixing file name
implyTodaysFixingsEnable/disable implying today's fixings

◆ CSVLoader() [3/4]

CSVLoader ( const string &  marketFilename,
const string &  fixingFilename,
const string &  dividendFilename,
bool  implyTodaysFixings = false 
)
Parameters
marketFilenameQuote file name
fixingFilenameFixing file name
dividendFilenameDividend file name
implyTodaysFixingsEnable/disable implying today's fixings

◆ CSVLoader() [4/4]

CSVLoader ( const vector< string > &  marketFiles,
const vector< string > &  fixingFiles,
const vector< string > &  dividendFiles,
bool  implyTodaysFixings = false 
)
Parameters
marketFilesQuote file name
fixingFilesFixing file name
dividendFilesDividend file name
implyTodaysFixingsEnable/disable implying today's fixings