28 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
29 auto it =
map_.find(instrumentType);
36 function<QuantLib::ext::shared_ptr<CalibrationInstrument>()> builder,
37 const bool allowOverwrite) {
38 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
39 QL_REQUIRE(
map_.insert(std::make_pair(instrumentType, builder)).second,
40 "CalibrationInstrumentFactory::addBuilder(" << instrumentType <<
"): builder for key already exists.");
factory for making calibration instruments.
QuantLib::ext::shared_ptr< CalibrationInstrument > build(const std::string &instrumentType)
void addBuilder(const std::string &instrumentType, std::function< QuantLib::ext::shared_ptr< CalibrationInstrument >()> builder, const bool allowOverwrite=false)
boost::shared_mutex mutex_
Serializable Credit Default Swap.