29#include <boost/make_shared.hpp>
33#include <ql/patterns/singleton.hpp>
39class LegAdditionalData;
49template <
class T> QuantLib::ext::shared_ptr<LegAdditionalData>
createLegData() {
return QuantLib::ext::make_shared<T>(); }
65class LegDataFactory :
public QuantLib::Singleton<LegDataFactory, std::integral_constant<bool, true>> {
67 friend class QuantLib::Singleton<
LegDataFactory, std::integral_constant<bool, true>>;
73 typedef std::map<std::string, std::function<QuantLib::ext::shared_ptr<LegAdditionalData>()>>
map_type;
81 QuantLib::ext::shared_ptr<LegAdditionalData>
build(const std::string& legType);
85 void
addBuilder(const std::string& legType, std::function<QuantLib::ext::shared_ptr<LegAdditionalData>()> builder,
86 const bool allowOverwrite = false);
std::map< std::string, std::function< QuantLib::ext::shared_ptr< LegAdditionalData >()> > map_type
QuantLib::ext::shared_ptr< LegAdditionalData > build(const std::string &legType)
void addBuilder(const std::string &legType, std::function< QuantLib::ext::shared_ptr< LegAdditionalData >()> builder, const bool allowOverwrite=false)
boost::shared_mutex mutex_
QuantLib::ext::shared_ptr< LegAdditionalData > createLegData()
Classes and functions for log message handling.
Serializable Credit Default Swap.