#include <ored/portfolio/bond.hpp>
Definition at line 204 of file bond.hpp.
◆ build()
Definition at line 331 of file bond.cpp.
333 {
334 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
336 if (referenceData->hasData(b.first, securityId)) {
337 auto tmp = b.second->build(engineFactory, referenceData, securityId);
338 tmp.builderLabel = b.first;
339 return tmp;
340 }
341 }
342
343 QL_FAIL("BondFactory: could not build bond '"
344 << securityId
345 << "': no reference data given or no suitable builder registered. Check if bond is set up in the reference "
346 "data and that there is a builder for the reference data type.");
347}
map< std::string, QuantLib::ext::shared_ptr< BondBuilder > > builders_
boost::shared_mutex mutex_
◆ addBuilder()
void addBuilder |
( |
const std::string & |
referenceDataType, |
|
|
const QuantLib::ext::shared_ptr< BondBuilder > & |
builder, |
|
|
const bool |
allowOverwrite = false |
|
) |
| |
Definition at line 349 of file bond.cpp.
350 {
351 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
352 QL_REQUIRE(
builders_.insert(std::make_pair(referenceDataType, builder)).second || allowOverwrite,
353 "BondFactory::addBuilder(" << referenceDataType << "): builder for key already exists.");
354}
◆ builders_
map<std::string, QuantLib::ext::shared_ptr<BondBuilder> > builders_ |
|
private |
◆ mutex_
boost::shared_mutex mutex_ |
|
mutableprivate |