Logo
Reference manual - version orea_version
ScenarioCSVReader Class Reference

Class for reading scenarios from a csv file. More...

#include <orea/scenario/scenariofilereader.hpp>

Inheritance diagram for ScenarioCSVReader:

Public Member Functions

 ScenarioCSVReader (const QuantLib::ext::shared_ptr< ore::data::CSVReader > &reader, const QuantLib::ext::shared_ptr< ScenarioFactory > &scenarioFactory)
 ~ScenarioCSVReader () override
 Destructor.
bool next () override
 Return true if there is another Scenario to read and move to it.
QuantLib::Date date () const override
 Return the current scenario's date if reader is still valid and Null<Date>() otherwise.
QuantLib::ext::shared_ptr< Scenarioscenario () const override
 Return the current scenario if reader is still valid and nullptr otherwise.
Public Member Functions inherited from ScenarioReader
virtual ~ScenarioReader ()
 Destructor.
virtual void load (const QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > &simParams, const QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > &marketParams)

Protected Attributes

QuantLib::ext::shared_ptr< ScenarioFactoryscenarioFactory_
 Scenario factory.
QuantLib::ext::shared_ptr< ore::data::CSVReader > reader_
 Handle on the csv file.
std::vector< RiskFactorKey > keys_
 The risk factor keys of the scenarios in the file.
bool finished_
 Flag indicating if the reader has no more scenarios to read.

Detailed Description

Class for reading scenarios from a csv file.

Constructor & Destructor Documentation

◆ ScenarioCSVReader()

ScenarioCSVReader ( const QuantLib::ext::shared_ptr< ore::data::CSVReader > & reader,
const QuantLib::ext::shared_ptr< ScenarioFactory > & scenarioFactory )

Constructor where filename gives the path to the file from which to read the scenarios and scenarioFactory is a factory for building Scenarios

Member Function Documentation

◆ next()

bool next ( )
overridevirtual

Return true if there is another Scenario to read and move to it.

Implements ScenarioReader.

◆ date()

QuantLib::Date date ( ) const
overridevirtual

Return the current scenario's date if reader is still valid and Null<Date>() otherwise.

Implements ScenarioReader.

◆ scenario()

QuantLib::ext::shared_ptr< Scenario > scenario ( ) const
overridevirtual

Return the current scenario if reader is still valid and nullptr otherwise.

Implements ScenarioReader.