36 string spreadQuote = config->spreadQuote();
37 if (spreadQuote !=
"" && loader.
has(spreadQuote, asof)) {
38 QuantLib::ext::shared_ptr<SecuritySpreadQuote> q =
39 QuantLib::ext::dynamic_pointer_cast<SecuritySpreadQuote>(loader.
get(spreadQuote, asof));
40 QL_REQUIRE(q,
"Failed to cast " << spreadQuote <<
" to SecuritySpreadQuote");
45 string recoveryQuote = config->recoveryRatesQuote();
46 if (recoveryQuote !=
"" && loader.
has(recoveryQuote, asof)) {
47 QuantLib::ext::shared_ptr<RecoveryRateQuote> q =
48 QuantLib::ext::dynamic_pointer_cast<RecoveryRateQuote>(loader.
get(recoveryQuote, asof));
49 QL_REQUIRE(q,
"Failed to cast " << recoveryQuote <<
" to RecoveryRateQuote");
54 string cprQuote = config->cprQuote();
55 if (cprQuote !=
"" && loader.
has(cprQuote,asof)) {
56 QuantLib::ext::shared_ptr<CPRQuote> q = QuantLib::ext::dynamic_pointer_cast<CPRQuote>(loader.
get(cprQuote, asof));
57 QL_REQUIRE(q,
"Failed to cast " << cprQuote <<
" to CPRQuote");
62 string priceQuote = config->priceQuote();
63 if (priceQuote !=
"" && loader.
has(priceQuote,asof)) {
64 QuantLib::ext::shared_ptr<BondPriceQuote> q =
65 QuantLib::ext::dynamic_pointer_cast<BondPriceQuote>(loader.
get(priceQuote, asof));
66 QL_REQUIRE(q,
"Failed to cast " << priceQuote <<
" to BondPriceQuote");
70 }
catch (std::exception& e) {
71 QL_FAIL(
"Security building failed for curve " << spec.
curveConfigID() <<
" on date " << io::iso_date(asof)
74 QL_FAIL(
"Security building failed: unknown error");
Container class for all Curve Configurations.
const std::string & curveConfigID() const
Market data loader base class.
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 has(const std::string &name, const QuantLib::Date &d) const
Default implementation, returns false if get throws or returns a null pointer.
Security(const Date &asof, SecuritySpec spec, const Loader &loader, const CurveConfigurations &curveConfigs)
Constructor.
Handle< Quote > recoveryRate_
const string & securityID() const
Classes and functions for log message handling.
Market data representation.
Serializable Credit Default Swap.
A wrapper class for holding Bond Spread quotes.
vector< string > curveConfigs