21#include <ql/errors.hpp>
29 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
30 auto it =
map_.find(refDatumType);
33 return it->second()->build();
37 std::function<QuantLib::ext::shared_ptr<AbstractReferenceDatumBuilder>()> builder,
38 const bool allowOverwrite) {
39 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
40 QL_REQUIRE(
map_.insert(std::make_pair(refDatumType, builder)).second,
41 "ReferenceDatumFactory::addBuilder(" << refDatumType <<
"): builder for key already exists.");
QuantLib::ext::shared_ptr< ReferenceDatum > build(const std::string &refDatumType)
void addBuilder(const std::string &refDatumType, std::function< QuantLib::ext::shared_ptr< AbstractReferenceDatumBuilder >()> builder, const bool allowOverwrite=false)
boost::shared_mutex mutex_
Serializable Credit Default Swap.
Reference data model and serialization.