Logo
Reference manual - version ored_version
EngineFactory Class Reference

Pricing Engine Factory class. More...

#include <ored/portfolio/enginefactory.hpp>

Classes

struct  ParameterOverride

Public Member Functions

 EngineFactory (const QuantLib::ext::shared_ptr< EngineData > &data, const QuantLib::ext::shared_ptr< Market > &market, const map< MarketContext, string > &configurations=std::map< MarketContext, string >(), const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData=nullptr, const QuantLib::ext::shared_ptr< IborFallbackConfig > &iborFallbackConfig=QuantLib::ext::make_shared< IborFallbackConfig >(IborFallbackConfig::defaultConfig()), const std::vector< QuantLib::ext::shared_ptr< EngineBuilder > > extraEngineBuilders={})
 Create an engine factory.
const QuantLib::ext::shared_ptr< Market > & market () const
 Return the market used by this EngineFactory.
const map< MarketContext, string > & configurations () const
 Return the market configurations used by this EngineFactory.
const stringconfiguration (const MarketContext &key) const
 Return a configuration (or the default one if key not found).
const QuantLib::ext::shared_ptr< EngineDataengineData () const
 Return the EngineData parameters.
const QuantLib::ext::shared_ptr< ReferenceDataManager > & referenceData () const
 Return the reference data used by this EngineFactory.
const QuantLib::ext::shared_ptr< IborFallbackConfig > & iborFallbackConfig () const
 Return the ibor fallback config.
QuantLib::ext::shared_ptr< EngineBuilderbuilder (const string &tradeType)
 Get a builder by trade type.
QuantLib::ext::shared_ptr< LegBuilderlegBuilder (const LegType &legType)
 Get a leg builder by leg type.
set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > & modelBuilders ()
 return model builders
void setModelParameterOverrides (const std::vector< ParameterOverride > &overrides)
void setEngineParameterOverrides (const std::vector< ParameterOverride > &overrides)

Detailed Description

Pricing Engine Factory class.

A Pricing Engine Factory is used when building a portfolio, it provides QuantLib::PricingEngines to each of the Trade objects.

An Engine Factory is configured on two levels, both from EngineData. The first level is the type of builder (Model and Engine) to use for each trade type, so given a trade type one asks the factory for a builder and then the builder for a PricingEngine. Each builder must be registered with the factory and then the configuration defines which builder to use.

Secondly, the factory maintains builder specific parameters for each Model and Engine.

Constructor & Destructor Documentation

◆ EngineFactory()

EngineFactory ( const QuantLib::ext::shared_ptr< EngineData > & data,
const QuantLib::ext::shared_ptr< Market > & market,
const map< MarketContext, string > & configurations = std::map< MarketContextstring >(),
const QuantLib::ext::shared_ptr< ReferenceDataManager > & referenceData = nullptr,
const QuantLib::ext::shared_ptr< IborFallbackConfig > & iborFallbackConfig = QuantLib::ext::make_shared< IborFallbackConfig >(IborFallbackConfig::defaultConfig()),
const std::vector< QuantLib::ext::shared_ptr< EngineBuilder > > extraEngineBuilders = {} )

Create an engine factory.

Parameters
dataConfiguration data
marketThe market that is passed to each builder
configurationsThe market configurations that are passed to each builder
referenceDatareference data
iborFallbackConfigibor fallback config
extraEngineBuildersadditional engine builders

Member Function Documentation

◆ builder()

QuantLib::ext::shared_ptr< EngineBuilder > builder ( const string & tradeType)

Get a builder by trade type.

This will look up configured model/engine for that trade type the returned builder can be cast to the type required for the tradeType.

The factory will call EngineBuilder::init() before returning it.