Logo
Reference manual - version ored_version
List of all members
Loader Class Referenceabstract

Market data loader base class. More...

#include <ored/marketdata/loader.hpp>

+ Inheritance diagram for Loader:

Interface

class boost::serialization::access
 Serialization.
 
Date actualDate_ = Date()
 
virtual std::vector< boost::shared_ptr< MarketDatum > > loadQuotes (const QuantLib::Date &) const =0
 get all quotes, TODO change the return value to std::set
 
virtual boost::shared_ptr< MarketDatumget (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
 
virtual std::set< boost::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
 
virtual std::set< boost::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
 
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 std::set< FixingloadFixings () 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.
 
virtual std::set< QuantExt::DividendloadDividends () const
 Optional load dividends method.
 
void setActualDate (const QuantLib::Date &d)
 
const Date & actualDate () const
 

Detailed Description

Market data loader base class.

Member Function Documentation

◆ get()

virtual boost::shared_ptr<MarketDatum> get ( const std::pair< std::string, bool > &  name,
const QuantLib::Date &  d 
) const
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.

  • if the quote is in the loader for date d, it is returned
  • if the quote is not in the loader for date d and it is optional, a warning is logged and a boost::shared_ptr<MarketDatum>() is returned
  • if the quote is not in the loader for date d and it is not optional, an exception is thrown

Member Data Documentation

◆ actualDate_

Date actualDate_ = Date()
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.