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

Factory class for cloning scenario objects. More...

#include <orea/scenario/deltascenariofactory.hpp>

+ Inheritance diagram for DeltaScenarioFactory:
+ Collaboration diagram for DeltaScenarioFactory:

Public Member Functions

 DeltaScenarioFactory (const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &baseScenario, const QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactory > &scenarioFactory=QuantLib::ext::make_shared< ore::analytics::SimpleScenarioFactory >(false))
 Constructor. More...
 
const QuantLib::ext::shared_ptr< ore::analytics::ScenariobuildScenario (QuantLib::Date asof, bool isAbsolute, const std::string &label="", QuantLib::Real numeraire=0.0) const override
 returns a new scenario, using the base scenario as a starting point More...
 
- Public Member Functions inherited from ScenarioFactory
virtual ~ScenarioFactory ()
 Default destructor. More...
 
virtual const QuantLib::ext::shared_ptr< ScenariobuildScenario (Date asof, bool isAbsolute, const std::string &label="", Real numeraire=0.0) const =0
 Build a scenario instance without filling it. More...
 

Private Attributes

QuantLib::ext::shared_ptr< ore::analytics::ScenariobaseScenario_
 
QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactoryscenarioFactory_
 

Detailed Description

Factory class for cloning scenario objects.

Definition at line 37 of file deltascenariofactory.hpp.

Constructor & Destructor Documentation

◆ DeltaScenarioFactory()

DeltaScenarioFactory ( const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &  baseScenario,
const QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactory > &  scenarioFactory = QuantLib::ext::make_shared<ore::analytics::SimpleScenarioFactory>(false) 
)

Constructor.

Definition at line 30 of file deltascenariofactory.cpp.

32 : baseScenario_(baseScenario), scenarioFactory_(scenarioFactory) {
33 QL_REQUIRE(baseScenario_ != nullptr, "DeltaScenarioFactory: base scenario pointer must not be NULL");
34 QL_REQUIRE(scenarioFactory_ != nullptr, "DeltaScenarioFactory: scenario factory must not be NULL");
35}
QuantLib::ext::shared_ptr< ore::analytics::ScenarioFactory > scenarioFactory_
QuantLib::ext::shared_ptr< ore::analytics::Scenario > baseScenario_

Member Function Documentation

◆ buildScenario()

const QuantLib::ext::shared_ptr< ore::analytics::Scenario > buildScenario ( QuantLib::Date  asof,
bool  isAbsolute,
const std::string &  label = "",
QuantLib::Real  numeraire = 0.0 
) const
override

returns a new scenario, using the base scenario as a starting point

Definition at line 38 of file deltascenariofactory.cpp.

39 {
40 QL_REQUIRE(asof == baseScenario_->asof(),
41 "unexpected asof date (" << asof << "), does not match base - " << baseScenario_->asof());
42 QuantLib::ext::shared_ptr<ore::analytics::Scenario> incremental =
43 scenarioFactory_->buildScenario(asof, isAbsolute, label, numeraire);
44 QL_REQUIRE((label == incremental->label()) || (label == ""), "DeltaScenarioFactory has not updated scenario label");
45 return QuantLib::ext::make_shared<DeltaScenario>(baseScenario_, incremental);
46}
Date asof(14, Jun, 2018)
+ Here is the call graph for this function:

Member Data Documentation

◆ baseScenario_

QuantLib::ext::shared_ptr<ore::analytics::Scenario> baseScenario_
private

Definition at line 49 of file deltascenariofactory.hpp.

◆ scenarioFactory_

QuantLib::ext::shared_ptr<ore::analytics::ScenarioFactory> scenarioFactory_
private

Definition at line 50 of file deltascenariofactory.hpp.