31#include <ql/patterns/singleton.hpp>
32#include <ql/time/date.hpp>
33#include <ql/time/period.hpp>
65 const std::string&
id()
const {
return id_; }
95 static constexpr const char*
TYPE =
"Bond";
150 QuantLib::Real
priorWeight = QuantLib::Null<QuantLib::Real>(),
151 QuantLib::Real
recovery = QuantLib::Null<QuantLib::Real>(),
152 const QuantLib::Date&
auctionDate = QuantLib::Date(),
154 const QuantLib::Date&
defaultDate = QuantLib::Date(),
160 const std::string&
name()
const;
161 QuantLib::Real
weight()
const;
186 static constexpr const char*
TYPE =
"CreditIndex";
201 const std::set<CreditIndexConstituent>&
constituents()
const;
245 std::map<std::string, double>
data_;
251 static constexpr const char*
TYPE =
"EquityIndex";
263 static constexpr const char*
TYPE =
"Commodity";
294 static constexpr const char*
TYPE =
"CurrencyHedgedEquityIndex";
403 static constexpr const char*
TYPE =
"PortfolioBasket";
428 static constexpr const char*
TYPE =
"Credit";
465 static constexpr const char*
TYPE =
"Equity";
507 static constexpr const char*
TYPE =
"BondBasket";
552 virtual bool hasData(
const string& type,
const string&
id,
553 const QuantLib::Date& asof = QuantLib::Null<QuantLib::Date>()) = 0;
554 virtual QuantLib::ext::shared_ptr<ReferenceDatum>
555 getData(
const string& type,
const string&
id,
const QuantLib::Date& asof = QuantLib::Null<QuantLib::Date>()) = 0;
556 virtual void add(
const QuantLib::ext::shared_ptr<ReferenceDatum>& referenceDatum) = 0;
576 bool hasData(
const string& type,
const string&
id,
577 const QuantLib::Date& asof = QuantLib::Null<QuantLib::Date>())
override;
578 QuantLib::ext::shared_ptr<ReferenceDatum>
getData(
const string& type,
const string&
id,
579 const QuantLib::Date& asof = QuantLib::Null<QuantLib::Date>())
override;
580 void add(
const QuantLib::ext::shared_ptr<ReferenceDatum>& referenceDatum)
override;
582 QuantLib::ext::shared_ptr<ReferenceDatum>
addFromXMLNode(
XMLNode* node,
const std::string&
id = std::string(),
583 const QuantLib::Date& validFrom = QuantLib::Null<QuantLib::Date>());
586 std::tuple<QuantLib::Date, QuantLib::ext::shared_ptr<ReferenceDatum>>
latestValidFrom(
const string& type,
const string&
id,
587 const QuantLib::Date& asof)
const;
588 void check(
const string& type,
const string&
id,
const QuantLib::Date& asof)
const;
589 map<std::pair<string, string>, std::map<QuantLib::Date, QuantLib::ext::shared_ptr<ReferenceDatum>>>
data_;
591 map<std::pair<string, string>, std::map<QuantLib::Date, string>>
buildErrors_;
Basic Concrete impl that loads an big XML and keeps data in memory.
bool hasData(const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >()) override
map< std::pair< string, string >, std::map< QuantLib::Date, QuantLib::ext::shared_ptr< ReferenceDatum > > > data_
map< std::pair< string, string >, std::map< QuantLib::Date, string > > buildErrors_
void fromXML(XMLNode *node) override
void appendData(const string &filename)
BasicReferenceDataManager()
XMLNode * toXML(ore::data::XMLDocument &doc) const override
std::tuple< QuantLib::Date, QuantLib::ext::shared_ptr< ReferenceDatum > > latestValidFrom(const string &type, const string &id, const QuantLib::Date &asof) const
QuantLib::ext::shared_ptr< ReferenceDatum > buildReferenceDatum(const string &refDataType)
void add(const QuantLib::ext::shared_ptr< ReferenceDatum > &referenceDatum) override
std::set< std::tuple< string, string, QuantLib::Date > > duplicates_
QuantLib::ext::shared_ptr< ReferenceDatum > getData(const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >()) override
BasicReferenceDataManager(const string &filename)
QuantLib::ext::shared_ptr< ReferenceDatum > addFromXMLNode(XMLNode *node, const std::string &id=std::string(), const QuantLib::Date &validFrom=QuantLib::Null< QuantLib::Date >())
Bond Basket Reference Data.
BondBasketReferenceDatum()
BondBasketReferenceDatum(const std::string &id, const QuantLib::Date &validFrom)
void fromXML(XMLNode *node) override
const std::vector< BondUnderlying > & underlyingData() const
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
std::vector< BondUnderlying > underlyingData_
BondBasketReferenceDatum(const std::string &id, const std::vector< BondUnderlying > &underlyingData)
BondBasketReferenceDatum(const std::string &id, const QuantLib::Date &validFrom, const std::vector< BondUnderlying > &underlyingData)
BondBasketReferenceDatum(const std::string &id)
BondReferenceDatum(const string &id, const QuantLib::Date &validFrom, const BondData &bondData)
void setBondData(const BondData &bondData)
void fromXML(XMLNode *node) override
BondReferenceDatum(const string &id, const QuantLib::Date &validFrom)
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
const BondData & bondData() const
BondReferenceDatum(const string &id)
BondReferenceDatum(const string &id, const BondData &bondData)
EquityIndex Reference data, contains the names and weights of an equity index.
CommodityIndexReferenceDatum(const string &name, const QuantLib::Date &validFrom)
CommodityIndexReferenceDatum()
CommodityIndexReferenceDatum(const string &name)
static constexpr const char * TYPE
QuantLib::Date eventDeterminationDate_
QuantLib::Date auctionDate_
const QuantLib::Date & defaultDate() const
QuantLib::Real weight() const
const QuantLib::Date & eventDeterminationDate() const
QuantLib::Date defaultDate_
QuantLib::Real recovery() const
void fromXML(XMLNode *node) override
const QuantLib::Date & auctionDate() const
XMLNode * toXML(ore::data::XMLDocument &doc) const override
QuantLib::Real priorWeight_
QuantLib::Real priorWeight() const
CreditIndexConstituent(const std::string &name, QuantLib::Real weight, QuantLib::Real priorWeight=QuantLib::Null< QuantLib::Real >(), QuantLib::Real recovery=QuantLib::Null< QuantLib::Real >(), const QuantLib::Date &auctionDate=QuantLib::Date(), const QuantLib::Date &auctionSettlementDate=QuantLib::Date(), const QuantLib::Date &defaultDate=QuantLib::Date(), const QuantLib::Date &eventDeterminationDate=QuantLib::Date())
const QuantLib::Date & auctionSettlementDate() const
QuantLib::Date auctionSettlementDate_
const std::string & name() const
Credit index reference data, contains a set of index constituents.
const std::set< CreditIndexConstituent > & constituents() const
Get all of the underlying constituents.
void setIndexFamily(const std::string &indexFamily)
CreditIndexReferenceDatum()
const std::string & indexFamily() const
void fromXML(XMLNode *node) override
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
std::set< CreditIndexConstituent > constituents_
void add(const CreditIndexConstituent &c)
Add a constituent. The constituent is not added if already present.
CreditIndex Reference data, contains the names and weights of a credit index.
const CreditData & creditData() const
CreditReferenceDatum(const string &id)
void fromXML(XMLNode *node) override
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
CreditReferenceDatum(const string &id, const CreditData &creditData)
CreditReferenceDatum(const string &id, const QuantLib::Date &validFrom, const CreditData &creditData)
void setCreditData(const CreditData &creditData)
CreditReferenceDatum(const string &id, const QuantLib::Date &validFrom)
const std::string & underlyingIndexName() const
QuantLib::Calendar hedgeCalendar() const
CurrencyHedgedEquityIndexReferenceDatum(const string &name, const QuantLib::Date &validFrom)
RebalancingDate::Strategy rebalancingStrategy() const
HedgeAdjustment::Rule hedgeAdjustmentRule_
const std::map< string, double > & currencyWeights() const
Returns the currency weights at the last rebalancing date.
QuantLib::Calendar hedgeCalendar_
HedgeAdjustment::Rule hedgeAdjustmentRule() const
std::string underlyingIndexName_
Date referenceDate(const Date &asof)
RebalancingDate::Strategy rebalancingStrategy_
void fromXML(XMLNode *node) override
const std::map< std::string, std::string > & fxIndexes() const
Date rebalancingDate(const Date &asof)
int referenceDateOffset() const
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
CurrencyHedgedEquityIndexReferenceDatum()
std::map< std::string, std::string > fxIndexes_
map< string, double > data_
CurrencyHedgedEquityIndexReferenceDatum(const string &name)
EquityIndex Reference data, contains the names and weights of an equity index.
EquityIndexReferenceDatum()
EquityIndexReferenceDatum(const string &name)
static constexpr const char * TYPE
EquityIndexReferenceDatum(const string &name, const QuantLib::Date &validFrom)
EquityReferenceDatum(const std::string &id, const QuantLib::Date &validFrom)
EquityReferenceDatum(const std::string &id)
void fromXML(XMLNode *node) override
void setEquityData(const EquityData &equityData)
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
const EquityData & equityData() const
EquityReferenceDatum(const std::string &id, const QuantLib::Date &validFrom, const EquityData &equityData)
EquityReferenceDatum(const std::string &id, const EquityData &equityData)
Base class for indices - lets see if we can keep this, they might diverge too much....
const map< string, double > underlyings() const
std::map< std::string, double > data_
void fromXML(XMLNode *node) override
void addUnderlying(const string &name, double weight)
XMLNode * toXML(ore::data::XMLDocument &doc) const override
IndexReferenceDatum(const string &type, const string &id, const QuantLib::Date &validFrom)
void setUnderlyings(const std::map< string, double > &data)
IndexReferenceDatum(const string &type, const string &id)
Serializable object holding leg data.
void fromXML(XMLNode *node) override
XMLNode * toXML(ore::data::XMLDocument &doc) const override
static constexpr const char * TYPE
PortfolioBasketReferenceDatum(const string &id)
vector< QuantLib::ext::shared_ptr< Trade > > tradecomponents_
PortfolioBasketReferenceDatum()
PortfolioBasketReferenceDatum(const string &id, const QuantLib::Date &validFrom)
const vector< QuantLib::ext::shared_ptr< Trade > > & getTrades() const
Interface for Reference Data lookups.
virtual ~ReferenceDataManager()
virtual QuantLib::ext::shared_ptr< ReferenceDatum > getData(const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >())=0
virtual bool hasData(const string &type, const string &id, const QuantLib::Date &asof=QuantLib::Null< QuantLib::Date >())=0
virtual void add(const QuantLib::ext::shared_ptr< ReferenceDatum > &referenceDatum)=0
Base class for reference data.
ReferenceDatum(const std::string &type, const std::string &id)
Base class constructor.
const std::string & id() const
const std::string & type() const
getters
void setId(const string &id)
void fromXML(XMLNode *node) override
void setValidFrom(const QuantLib::Date &validFrom)
ReferenceDatum()
Default Constructor.
XMLNode * toXML(ore::data::XMLDocument &doc) const override
const QuantLib::Date & validFrom() const
void setType(const string &type)
setters
QuantLib::Date validFrom_
ReferenceDatum(const std::string &type, const std::string &id, const QuantLib::Date &validFrom)
Base class constructor.
Small XML Document wrapper class.
Base class for all serializable classes.
void fromFile(const std::string &filename)
leg data model and serialization
bool operator<(const Dividend &d1, const Dividend &d2)
Serializable Credit Default Swap.
Reference data model and serialization.
std::vector< LegData > legData
void fromXML(XMLNode *node) override
XMLNode * toXML(ore::data::XMLDocument &doc) const override
string priceQuoteBaseValue
QuantLib::Date successorImplementationDate
QuantLib::Date predecessorImplementationDate
std::string proxyIdentifier
QuantLib::Date equityStartDate
std::string proxyVolatilityId
QuantLib::Size scalingFactor
std::string crifQualifier
base trade data model and serialization