Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ClonedLoader Class Reference

#include <ored/marketdata/clonedloader.hpp>

+ Inheritance diagram for ClonedLoader:
+ Collaboration diagram for ClonedLoader:

Public Member Functions

 ClonedLoader (const QuantLib::Date &loaderDate, const QuantLib::ext::shared_ptr< Loader > &inLoader)
 
const QuantLib::Date & getLoaderDate () const
 
- Public Member Functions inherited from InMemoryLoader
 InMemoryLoader ()
 
std::vector< QuantLib::ext::shared_ptr< MarketDatum > > loadQuotes (const QuantLib::Date &d) const override
 get all quotes, TODO change the return value to std::set More...
 
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 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, this should be overriden in derived classes for performance More...
 
std::set< FixingloadFixings () const override
 
std::set< QuantExt::DividendloadDividends () const override
 Optional load dividends method. More...
 
bool hasQuotes (const QuantLib::Date &d) const override
 check if there are quotes for a date More...
 
virtual void add (QuantLib::Date date, const string &name, QuantLib::Real value)
 
virtual void addFixing (QuantLib::Date date, const string &name, QuantLib::Real value)
 
virtual void addDividend (const QuantExt::Dividend &dividend)
 
void reset ()
 
- 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 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. More...
 
void setActualDate (const QuantLib::Date &d)
 
const Date & actualDate () const
 
std::pair< bool, string > checkFxDuplicate (const ext::shared_ptr< MarketDatum >, const QuantLib::Date &)
 

Protected Attributes

QuantLib::Date loaderDate_
 
- Protected Attributes inherited from InMemoryLoader
std::map< QuantLib::Date, std::set< QuantLib::ext::shared_ptr< MarketDatum >, SharedPtrMarketDatumComparator > > data_
 
std::set< Fixingfixings_
 
std::set< QuantExt::Dividenddividends_
 
- Protected Attributes inherited from Loader
Date actualDate_ = Date()
 

Detailed Description

Definition at line 31 of file clonedloader.hpp.

Constructor & Destructor Documentation

◆ ClonedLoader()

ClonedLoader ( const QuantLib::Date &  loaderDate,
const QuantLib::ext::shared_ptr< Loader > &  inLoader 
)

Definition at line 28 of file clonedloader.cpp.

29 : loaderDate_(loaderDate) {
30 for (const auto& md : inLoader->loadQuotes(loaderDate)) {
31 data_[loaderDate].insert(md->clone());
32 }
33 fixings_ = inLoader->loadFixings();
34 dividends_ = inLoader->loadDividends();
35}
QuantLib::Date loaderDate_
std::set< QuantExt::Dividend > dividends_
std::set< Fixing > fixings_
std::map< QuantLib::Date, std::set< QuantLib::ext::shared_ptr< MarketDatum >, SharedPtrMarketDatumComparator > > data_

Member Function Documentation

◆ getLoaderDate()

const QuantLib::Date & getLoaderDate ( ) const

Definition at line 36 of file clonedloader.hpp.

36{ return loaderDate_; };

Member Data Documentation

◆ loaderDate_

QuantLib::Date loaderDate_
protected

Definition at line 39 of file clonedloader.hpp.