37 ScenarioWriter(
const QuantLib::ext::shared_ptr<ScenarioGenerator>& src,
const std::string& filename,
const char sep =
',',
38 const string& filemode =
"w+",
const std::vector<RiskFactorKey>& headerKeys = {});
41 ScenarioWriter(
const std::string& filename,
const char sep =
',',
const string& filemode =
"w+",
42 const std::vector<RiskFactorKey>& headerKeys = {});
45 ScenarioWriter(
const QuantLib::ext::shared_ptr<ScenarioGenerator>& src, QuantLib::ext::shared_ptr<ore::data::Report> report,
46 const std::vector<RiskFactorKey>& headerKeys = {});
52 virtual QuantLib::ext::shared_ptr<Scenario>
next(
const Date& d)
override;
55 void writeScenario(
const QuantLib::ext::shared_ptr<Scenario>& s,
const bool writeHeader);
58 virtual void reset()
override;
64 void open(
const std::string& filename,
const std::string& filemode =
"w+");
66 QuantLib::ext::shared_ptr<ScenarioGenerator>
src_;
67 std::vector<RiskFactorKey>
keys_;
68 QuantLib::ext::shared_ptr<ore::data::Report>
report_;
Scenario generator base class.
Class for writing scenarios to file.
std::vector< RiskFactorKey > headerKeys_
void writeScenario(const QuantLib::ext::shared_ptr< Scenario > &s, const bool writeHeader)
Write a single scenario.
void close()
Close the file if it is open, not normally needed by client code.
virtual QuantLib::ext::shared_ptr< Scenario > next(const Date &d) override
Return the next scenario for the given date.
virtual ~ScenarioWriter()
Destructor.
std::vector< RiskFactorKey > keys_
QuantLib::ext::shared_ptr< ScenarioGenerator > src_
QuantLib::ext::shared_ptr< ore::data::Report > report_
virtual void reset() override
Reset the generator so calls to next() return the first scenario.
void open(const std::string &filename, const std::string &filemode="w+")
Scenario generator base classes.