21#include <ql/errors.hpp>
27 : baseScenario_(baseScenario) {
28 QL_REQUIRE(
baseScenario_ != NULL,
"base scenario pointer must not be NULL");
31const QuantLib::ext::shared_ptr<Scenario>
33 QuantLib::ext::shared_ptr<Scenario> newScen =
baseScenario_->clone();
34 QL_REQUIRE(
asof == newScen->asof(),
35 "unexpected asof date (" <<
asof <<
"), does not match base - " <<
baseScenario_->asof());
36 newScen->label(label);
37 QL_REQUIRE((label == newScen->label()) || (label ==
""),
"CloneScenarioFactory has not updated scenario label");
39 newScen->setNumeraire(numeraire);
40 newScen->setAbsolute(isAbsolute);
CloneScenarioFactory(const QuantLib::ext::shared_ptr< Scenario > &baseScenario)
Constructor.
QuantLib::ext::shared_ptr< Scenario > baseScenario_
const QuantLib::ext::shared_ptr< Scenario > buildScenario(Date asof, bool isAbsolute, const std::string &label="", Real numeraire=0.0) const override
returns a new scenario, using the base scenario as a starting point
factory class for cloning a cached scenario