24QuantLib::ext::shared_ptr<MarketDatum>
Loader::get(
const std::string&
name,
const QuantLib::Date& d)
const {
26 if (md->name() ==
name)
29 QL_FAIL(
"No MarketDatum for name " <<
name <<
" and date " << d);
32std::set<QuantLib::ext::shared_ptr<MarketDatum>>
Loader::get(
const std::set<std::string>& names,
33 const QuantLib::Date& asof)
const {
34 std::set<QuantLib::ext::shared_ptr<MarketDatum>> result;
36 if (names.find(md->name()) != names.end()) {
43std::set<QuantLib::ext::shared_ptr<MarketDatum>>
Loader::get(
const Wildcard& wildcard,
const QuantLib::Date& asof)
const {
44 std::set<QuantLib::ext::shared_ptr<MarketDatum>> result;
46 if (wildcard.
matches(md->name())) {
69QuantLib::ext::shared_ptr<MarketDatum>
Loader::get(
const std::pair<std::string, bool>&
name,
const QuantLib::Date& d)
const {
75 DLOG(
"Could not find quote for ID " <<
name.first <<
" with as of date " << QuantLib::io::iso_date(originalDate)
77 return QuantLib::ext::shared_ptr<MarketDatum>();
79 QL_FAIL(
"Could not find quote for Mandatory ID " <<
name.first <<
" with as of date "
80 << QuantLib::io::iso_date(originalDate));
86 string cc1 = ext::dynamic_pointer_cast<FXSpotQuote>(md)->unitCcy();
87 string cc2 = ext::dynamic_pointer_cast<FXSpotQuote>(md)->ccy();
88 string tmp =
"FX/RATE/" + cc2 +
"/" + cc1;
91 if (dom == (cc1 + cc2)) {
111 if (f.name ==
name && f.date == d) {
virtual std::vector< QuantLib::ext::shared_ptr< MarketDatum > > loadQuotes(const QuantLib::Date &) const =0
get all quotes, TODO change the return value to std::set
virtual Fixing getFixing(const string &name, const QuantLib::Date &d) const
Default implementation for getFixing.
virtual QuantLib::ext::shared_ptr< MarketDatum > get(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 bool hasQuotes(const QuantLib::Date &d) const
check if there are quotes for a date
std::pair< bool, string > checkFxDuplicate(const ext::shared_ptr< MarketDatum >, const QuantLib::Date &)
virtual std::set< Fixing > loadFixings() const =0
const Date & actualDate() const
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 hasFixing(const string &name, const QuantLib::Date &d) const
virtual std::set< QuantExt::Dividend > loadDividends() const
Optional load dividends method.
bool matches(const std::string &s) const
string fxDominance(const string &s1, const string &s2)
Convert FX pair to market standard dominance.
Market Datum Loader Interface.
#define DLOG(text)
Logging Macro (Level = Debug)
Serializable Credit Default Swap.