Logo
Reference manual - version ored_version
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, 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 &dividendFilename, bool implyTodaysFixings=false, Date fixingCutOffDate=Date())
 CSVLoader (const vector< string > &marketFiles, const vector< string > &fixingFiles, const vector< string > &dividendFiles, 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
std::set< QuantLib::Date > asofDates () const override
 get set of dates for which quotes are loaded
QuantLib::ext::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< 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
std::set< QuantLib::ext::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::Dividend > loadDividends () const override
 Load dividends.
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 QuantLib::ext::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
std::pair< bool, stringcheckFxDuplicate (const ext::shared_ptr< MarketDatum >, const QuantLib::Date &)

Additional Inherited Members

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,
Date fixingCutOffDate = Date() )
Parameters
marketFilenameQuote file name
fixingFilenameFixing file name
implyTodaysFixingsEnable/disable implying today's fixings
fixingCutOffDateLoad fixings up to this date

◆ CSVLoader() [2/4]

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

◆ CSVLoader() [3/4]

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

◆ CSVLoader() [4/4]

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

Member Function Documentation

◆ loadQuotes()

std::vector< QuantLib::ext::shared_ptr< MarketDatum > > loadQuotes ( const QuantLib::Date & ) const
overridevirtual

get all quotes, TODO change the return value to std::set

Implements Loader.

◆ asofDates()

std::set< QuantLib::Date > asofDates ( ) const
overridevirtual

get set of dates for which quotes are loaded

Implements Loader.

◆ get() [1/3]

QuantLib::ext::shared_ptr< MarketDatum > get ( const string & name,
const QuantLib::Date & d ) const
overridevirtual

get quote by its unique name, throws if not existent, override in derived classes for performance

Reimplemented from Loader.

◆ get() [2/3]

std::set< QuantLib::ext::shared_ptr< MarketDatum > > get ( const std::set< std::string > & names,
const QuantLib::Date & asof ) const
overridevirtual

get quotes matching a set of names, this should be overridden in derived classes for performance

Reimplemented from Loader.

◆ get() [3/3]

std::set< QuantLib::ext::shared_ptr< MarketDatum > > get ( const Wildcard & wildcard,
const QuantLib::Date & asof ) const
overridevirtual

get quotes matching a wildcard

Reimplemented from Loader.

◆ loadFixings()

std::set< Fixing > loadFixings ( ) const
overridevirtual

Load fixings.

Implements Loader.

◆ loadDividends()

std::set< QuantExt::Dividend > loadDividends ( ) const
overridevirtual

Load dividends.

Reimplemented from Loader.