TradeFactory.
More...
#include <ored/portfolio/tradefactory.hpp>
TradeFactory.
Definition at line 63 of file tradefactory.hpp.
◆ getBuilders()
Definition at line 29 of file tradefactory.cpp.
29 {
30 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
32}
std::map< std::string, QuantLib::ext::shared_ptr< AbstractTradeBuilder > > builders_
boost::shared_mutex mutex_
◆ getBuilder()
Definition at line 34 of file tradefactory.cpp.
34 {
35 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
37 QL_REQUIRE(b !=
builders_.end(),
"TradeFactory::getBuilder(" << className <<
"): no builder found");
38 return b->second;
39}
◆ addBuilder()
void addBuilder |
( |
const std::string & |
tradeType, |
|
|
const QuantLib::ext::shared_ptr< AbstractTradeBuilder > & |
builder, |
|
|
const bool |
allowOverwrite = false |
|
) |
| |
Definition at line 41 of file tradefactory.cpp.
42 {
43 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
44 QL_REQUIRE(
builders_.insert(std::make_pair(className, builder)).second || allowOverwrite,
45 "TradeFactory: duplicate builder for className '" << className << "'.");
46}
◆ build()
QuantLib::ext::shared_ptr< Trade > build |
( |
const std::string & |
className | ) |
const |
Build, throws for unknown className.
Definition at line 48 of file tradefactory.cpp.
QuantLib::ext::shared_ptr< AbstractTradeBuilder > getBuilder(const std::string &tradeType) const
◆ builders_
◆ mutex_
boost::shared_mutex mutex_ |
|
mutableprivate |