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

Interface for Reference Data lookups. More...

#include <ored/portfolio/referencedata.hpp>

+ Inheritance diagram for ReferenceDataManager:

Public Member Functions

virtual bool hasData (const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >()) const =0
 
virtual boost::shared_ptr< ReferenceDatumgetData (const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >())=0
 
virtual void add (const boost::shared_ptr< ReferenceDatum > &referenceDatum)=0
 

Detailed Description

Interface for Reference Data lookups.

The ReferenceDataManager is a repository of ReferenceDatum objects.

This is an interface, there is a concrete impl below that is BasicReferenceDataManager which is filebased. It is also possible to have a transactional implementation that will fetch reference data from a DB or via a restful call, possibly with a cache.

An instance of this class is made available to Trades as they are built, this code be done with a singleton but it is clearer to pass a pointer to an instance when the Trade is built itself, as there is no access method for Trade::build() we instead pass a pointer to the Trade constructors, this is then populated when TradeBuilders are created for ORE+ trades, this also allows us to have custom ORE+ versions of Trades that overload the build() method to use this data in place of extracting it from XML.

The actual Trade objects will take a copy of any reference data they need, this way they own all the required data and a call to "Trade::toXML()" will write out the "full" trade. For example we might load a CDS Index trade using reference data from which the basket is created, but if we call "toXML()" on that CDS Index the trade the whole basket will be written out.