Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
VanillaBondBuilder Struct Reference

#include <ored/portfolio/bond.hpp>

+ Inheritance diagram for VanillaBondBuilder:
+ Collaboration diagram for VanillaBondBuilder:

Public Member Functions

virtual Result build (const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const override
 
- Public Member Functions inherited from BondBuilder
virtual ~BondBuilder ()
 
virtual Result build (const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const =0
 

Detailed Description

Definition at line 216 of file bond.hpp.

Member Function Documentation

◆ build()

BondBuilder::Result build ( const QuantLib::ext::shared_ptr< EngineFactory > &  engineFactory,
const QuantLib::ext::shared_ptr< ReferenceDataManager > &  referenceData,
const std::string &  securityId 
) const
overridevirtual

Implements BondBuilder.

Definition at line 356 of file bond.cpp.

358 {
359 BondData data(securityId, 1.0);
360 data.populateFromBondReferenceData(referenceData);
361 ore::data::Bond bond(Envelope(), data);
362 bond.id() = "VanillaBondBuilder_" + securityId;
363 bond.build(engineFactory);
364
365 QL_REQUIRE(bond.instrument(), "VanillaBondBuilder: constructed bond is null, this is unexpected");
366 auto qlBond = QuantLib::ext::dynamic_pointer_cast<QuantLib::Bond>(bond.instrument()->qlInstrument());
367
368 QL_REQUIRE(bond.instrument() && bond.instrument()->qlInstrument(),
369 "VanillaBondBuilder: constructed bond trade does not provide a valid ql instrument, this is unexpected "
370 "(either the instrument wrapper or the ql instrument is null)");
371
372 Result res;
373 res.bond = qlBond;
374
375 if (data.isInflationLinked()) {
376 res.isInflationLinked = true;
377 }
378 res.hasCreditRisk = data.hasCreditRisk() && !data.creditCurveId().empty();
379 res.currency = data.currency();
380 res.creditCurveId = data.creditCurveId();
381 res.securityId = data.securityId();
382 res.creditGroup = data.creditGroup();
383 res.priceQuoteMethod = data.priceQuoteMethod();
384 res.priceQuoteBaseValue = data.priceQuoteBaseValue();
385 return res;
386}
Serializable Bond.
Definition: bond.hpp:153
@ data
Definition: log.hpp:77
+ Here is the call graph for this function: