Base PricingEngine Builder class for a specific model and engine. More...
#include <ored/portfolio/enginefactory.hpp>
Public Member Functions | |
| EngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes) | |
| virtual | ~EngineBuilder () |
| Virtual destructor. | |
| const string & | model () const |
| Return the model name. | |
| const string & | engine () const |
| Return the engine name. | |
| const set< string > & | tradeTypes () const |
| Return the possible trade types. | |
| const string & | configuration (const MarketContext &key) const |
| Return a configuration (or the default one if key not found). | |
| virtual void | reset () |
| reset the builder (e.g. clear cache) | |
| void | init (EngineFactory *const engineFactory, const QuantLib::ext::shared_ptr< Market > market, const map< MarketContext, string > &configurations, const map< string, string > &modelParameters, const map< string, string > &engineParameters, const std::map< std::string, std::string > &globalParameters={}) |
| Initialise this Builder with the market and parameters to use. | |
| virtual std::string | engineParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const |
| virtual std::string | modelParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const |
| const std::map< std::string, std::string > | globalParameters () const |
| EngineFactory * | engineFactory () const |
| return model builders | |
Protected Attributes | |
| string | model_ |
| string | engine_ |
| set< string > | tradeTypes_ |
| EngineFactory * | engineFactory_ |
| QuantLib::ext::shared_ptr< Market > | market_ |
| map< MarketContext, string > | configurations_ |
| map< string, string > | modelParameters_ |
| map< string, string > | engineParameters_ |
| std::map< std::string, std::string > | globalParameters_ |
Base PricingEngine Builder class for a specific model and engine.
The EngineBuilder is responsible for building pricing engines for a specific Model and Engine.
Each builder should implement a method with a signature
The exact parameters of each method can vary depending on the type of engine.
An EngineBuilder can cache engines and return the same PricingEngine multiple times, alternatively the Builder can build a unique PricingEngine each time it is called.
For example a swap engine builder can have the interface
and so returns the same (cached) engine every time it is asked for a particular currency.
The interface of each type of engine builder can be different, then there can be further sub-classes for different models and engines.
EngineBuilders are registered in an EngineFactory, multiple engine builders for the same trade type can be registered with the EngineFactory and it will select the appropriate one based on configuration.
Each EngineBuilder must return it's Model and Engine.
Constructor that takes a model and engine name
| model | the model name |
| engine | the engine name |
| tradeTypes | a set of trade types |
|
virtual |
reset the builder (e.g. clear cache)
Reimplemented in CachingEngineBuilder< T, U, Args >, CachingEngineBuilder< T, FloatingRateCouponPricer, Args... >, CachingEngineBuilder< T, InflationCouponPricer, Args... >, CachingEngineBuilder< T, PricingEngine, Args... >, and CachingEngineBuilder< T, QuantExt::InflationCashFlowPricer, Args... >.
| void init | ( | EngineFactory *const | engineFactory, |
| const QuantLib::ext::shared_ptr< Market > | market, | ||
| const map< MarketContext, string > & | configurations, | ||
| const map< string, string > & | modelParameters, | ||
| const map< string, string > & | engineParameters, | ||
| const std::map< std::string, std::string > & | globalParameters = {} ) |
Initialise this Builder with the market and parameters to use.
This method should not be called directly, it is called by the EngineFactory before it is returned.
|
virtual |
retrieve engine parameter p, first look for p_qualifier, if this does not exist fall back to p
Reimplemented in ScriptedTradeEngineBuilder.
|
virtual |
retrieve model parameter p, first look for p_qualifier, if this does not exist fall back to p
Reimplemented in ScriptedTradeEngineBuilder.
| const std::map< std::string, std::string > globalParameters | ( | ) | const |
return global parameters