305 {
307 underlying_ = QuantLib::ext::make_shared<BasicUnderlying>();
310 if (type == "Equity")
311 underlying_ = QuantLib::ext::make_shared<EquityUnderlying>();
312 else if (type == "Commodity")
313 underlying_ = QuantLib::ext::make_shared<CommodityUnderlying>();
314 else if (type == "FX")
315 underlying_ = QuantLib::ext::make_shared<FXUnderlying>();
316 else if (type == "InterestRate")
317 underlying_ = QuantLib::ext::make_shared<InterestRateUnderlying>();
318 else if (type == "Inflation")
319 underlying_ = QuantLib::ext::make_shared<InflationUnderlying>();
320 else if (type == "Credit")
321 underlying_ = QuantLib::ext::make_shared<CreditUnderlying>();
322 else if (type == "Bond")
323 underlying_ = QuantLib::ext::make_shared<BondUnderlying>();
324 else {
325 QL_FAIL("Unknown Underlying type " << type);
326 }
327 } else {
329 }
330 QL_REQUIRE(
underlying_ !=
nullptr,
"UnderlyingBuilder: underlying_ is null, this is unexpected");
334}
QuantLib::ext::shared_ptr< Underlying > underlying_
static string getNodeName(XMLNode *n)
Get and set a node's name.
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())