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

Factory class for building simple scenario objects. More...

#include <orea/scenario/simplescenariofactory.hpp>

+ Inheritance diagram for SimpleScenarioFactory:
+ Collaboration diagram for SimpleScenarioFactory:

Public Member Functions

 SimpleScenarioFactory (const bool useCommonSharedDataBlock=false)
 
 SimpleScenarioFactory (const QuantLib::ext::shared_ptr< SimpleScenario::SharedData > &sharedData)
 
const QuantLib::ext::shared_ptr< ScenariobuildScenario (Date asof, bool isAbsolute, const std::string &label="", Real numeraire=0.0) const override
 Build a scenario instance without filling it. 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

bool useCommonSharedDataBlock_ = false
 
QuantLib::ext::shared_ptr< SimpleScenario::SharedDatasharedData_
 

Detailed Description

Factory class for building simple scenario objects.

Definition at line 36 of file simplescenariofactory.hpp.

Constructor & Destructor Documentation

◆ SimpleScenarioFactory() [1/2]

SimpleScenarioFactory ( const bool  useCommonSharedDataBlock = false)
explicit

use shared data block only if it is guarateed that all scenarios created by this factory:

  • are all absolute or all relative
  • provide values for exactly the same set of risk factor keys
  • have the same coordinates for all risk factor keys (if any)

Definition at line 42 of file simplescenariofactory.hpp.

43 : useCommonSharedDataBlock_(useCommonSharedDataBlock) {}

◆ SimpleScenarioFactory() [2/2]

SimpleScenarioFactory ( const QuantLib::ext::shared_ptr< SimpleScenario::SharedData > &  sharedData)
explicit

Definition at line 44 of file simplescenariofactory.hpp.

45 : useCommonSharedDataBlock_(true), sharedData_(sharedData) {}
QuantLib::ext::shared_ptr< SimpleScenario::SharedData > sharedData_

Member Function Documentation

◆ buildScenario()

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

Build a scenario instance without filling it.

Implements ScenarioFactory.

Definition at line 46 of file simplescenariofactory.hpp.

47 {
48 auto tmp = QuantLib::ext::make_shared<SimpleScenario>(asof, label, numeraire,
50 tmp->setAbsolute(isAbsolute);
51 if (useCommonSharedDataBlock_ && sharedData_ == nullptr)
52 sharedData_ = tmp->sharedData();
53 return tmp;
54 }
Date asof(14, Jun, 2018)
+ Here is the call graph for this function:

Member Data Documentation

◆ useCommonSharedDataBlock_

bool useCommonSharedDataBlock_ = false
private

Definition at line 57 of file simplescenariofactory.hpp.

◆ sharedData_

QuantLib::ext::shared_ptr<SimpleScenario::SharedData> sharedData_
mutableprivate

Definition at line 58 of file simplescenariofactory.hpp.