Logo
Reference manual - version orea_version
ScenarioWriter Class Reference

Class for writing scenarios to file. More...

#include <orea/scenario/scenariowriter.hpp>

Inheritance diagram for ScenarioWriter:

Public Member Functions

 ScenarioWriter (const QuantLib::ext::shared_ptr< ScenarioGenerator > &src, const std::string &filename, const char sep=',', const string &filemode="w+", const std::vector< RiskFactorKey > &headerKeys={}, const bool writeDuplicateDates=true, QuantLib::Size precision=8)
 Constructor.
 ScenarioWriter (const std::string &filename, const char sep=',', const string &filemode="w+", const std::vector< RiskFactorKey > &headerKeys={}, const bool writeDuplicateDates=true, QuantLib::Size precision=8)
 Constructor to write single scenarios.
 ScenarioWriter (const QuantLib::ext::shared_ptr< ScenarioGenerator > &src, QuantLib::ext::shared_ptr< ore::data::Report > report, const std::vector< RiskFactorKey > &headerKeys={}, const bool writeDuplicateDates=true, QuantLib::Size precision=8)
 Constructor to write into an in-memory report for later io.
virtual ~ScenarioWriter ()
 Destructor.
virtual QuantLib::ext::shared_ptr< Scenarionext (const Date &d) override
 Return the next scenario for the given date.
void writeScenario (const QuantLib::ext::shared_ptr< Scenario > &s, const bool writeHeader)
 Write a single scenario.
virtual void reset () override
 Reset the generator so calls to next() return the first scenario.
void close ()
 Close the file if it is open, not normally needed by client code.
Public Member Functions inherited from ScenarioGenerator
virtual ~ScenarioGenerator ()
 Default destructor.

Detailed Description

Class for writing scenarios to file.

Member Function Documentation

◆ next()

virtual QuantLib::ext::shared_ptr< Scenario > next ( const Date & d)
overridevirtual

Return the next scenario for the given date.

Implements ScenarioGenerator.

◆ reset()

virtual void reset ( )
overridevirtual

Reset the generator so calls to next() return the first scenario.

Implements ScenarioGenerator.