Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
CreditLinkedSwapEngineBuilder Class Reference

#include <ored/portfolio/builders/creditlinkedswap.hpp>

+ Inheritance diagram for CreditLinkedSwapEngineBuilder:
+ Collaboration diagram for CreditLinkedSwapEngineBuilder:

Public Member Functions

 CreditLinkedSwapEngineBuilder ()
 
- Public Member Functions inherited from CachingEngineBuilder< T, U, Args >
 CachingEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
QuantLib::ext::shared_ptr< U > engine (Args... params)
 Return a PricingEngine or a FloatingRateCouponPricer. More...
 
void reset () override
 reset the builder (e.g. clear cache) More...
 
- Public Member Functions inherited from EngineBuilder
 EngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
virtual ~EngineBuilder ()
 Virtual destructor. More...
 
const string & model () const
 Return the model name. More...
 
const string & engine () const
 Return the engine name. More...
 
const set< string > & tradeTypes () const
 Return the possible trade types. More...
 
const string & configuration (const MarketContext &key)
 Return a configuration (or the default one if key not found) More...
 
virtual void reset ()
 reset the builder (e.g. clear cache) More...
 
void init (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. More...
 
const set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > & modelBuilders () const
 return model builders More...
 
std::string engineParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 
std::string modelParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 

Private Member Functions

std::string keyImpl (const std::string &currency, const std::string &creditCurveId) override
 
QuantLib::ext::shared_ptr< PricingEngine > engineImpl (const std::string &currency, const std::string &creditCurveId) override
 

Additional Inherited Members

- Protected Member Functions inherited from CachingEngineBuilder< T, U, Args >
virtual T keyImpl (Args...)=0
 
virtual QuantLib::ext::shared_ptr< U > engineImpl (Args...)=0
 
- Protected Attributes inherited from CachingEngineBuilder< T, U, Args >
map< T, QuantLib::ext::shared_ptr< U > > engines_
 
- Protected Attributes inherited from EngineBuilder
string model_
 
string engine_
 
set< string > tradeTypes_
 
QuantLib::ext::shared_ptr< Marketmarket_
 
map< MarketContext, string > configurations_
 
map< string, string > modelParameters_
 
map< string, string > engineParameters_
 
std::map< std::string, std::string > globalParameters_
 
set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > modelBuilders_
 

Detailed Description

Definition at line 28 of file creditlinkedswap.hpp.

Constructor & Destructor Documentation

◆ CreditLinkedSwapEngineBuilder()

Definition at line 31 of file creditlinkedswap.hpp.

32 : CachingEngineBuilder("DiscountedCashflows", "DiscountingCreditLinkedSwapEngine", {"CreditLinkedSwap"}) {}
CachingEngineBuilder(const string &model, const string &engine, const set< string > &tradeTypes)

Member Function Documentation

◆ keyImpl()

std::string keyImpl ( const std::string &  currency,
const std::string &  creditCurveId 
)
overrideprivate

Definition at line 26 of file creditlinkedswap.cpp.

26 {
27 return currency + "_" + creditCurveId;
28}

◆ engineImpl()

QuantLib::ext::shared_ptr< PricingEngine > engineImpl ( const std::string &  currency,
const std::string &  creditCurveId 
)
overrideprivate

Definition at line 30 of file creditlinkedswap.cpp.

31 {
32
33 auto irCurve = market_->discountCurve(currency, configuration(MarketContext::pricing));
34 auto creditCurve = market_->defaultCurve(creditCurveId, configuration(MarketContext::pricing))->curve();
35 Handle<Quote> marketRecovery = market_->recoveryRate(creditCurveId, configuration(MarketContext::pricing));
36
37 bool generateAdditionalResults = false;
38 auto p = globalParameters_.find("GenerateAdditionalResults");
39 if (p != globalParameters_.end()) {
40 generateAdditionalResults = parseBool(p->second);
41 }
42
43 return QuantLib::ext::make_shared<QuantExt::DiscountingCreditLinkedSwapEngine>(
44 irCurve, creditCurve, marketRecovery, parseInteger(engineParameter("TimeStepsPerYear")),
45 generateAdditionalResults);
46}
QuantLib::ext::shared_ptr< Market > market_
std::string engineParameter(const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
std::map< std::string, std::string > globalParameters_
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
+ Here is the call graph for this function: