@@ -64,7 +64,7 @@ class Analytic {
6464 };
6565
6666 // ! Constructors
67- Analytic (std::ostream& out = std::cout) : out_(out ) {}
67+ Analytic () {}
6868 Analytic (// ! Label for logging purposes
6969 const std::string& label,
7070 // ! The types of all (sub) analytics covered by this Analytic object
@@ -79,13 +79,10 @@ class Analytic {
7979 // ! Flag to indicate whether a scenario generator config file is required for this analytic
8080 bool scenarioGeneratorConfig = false ,
8181 // ! Flag to indicate whether a cross asset model config file is required for this analytic
82- bool crossAssetModelConfig = false ,
83- // ! Stream for optional output
84- std::ostream& out = std::cout)
82+ bool crossAssetModelConfig = false )
8583 : label_(label), types_(analyticTypes), inputs_(inputs),
8684 simulationConfig_ (simulationConfig), sensitivityConfig_(sensitivityConfig),
87- scenarioGeneratorConfig_(scenarioGeneratorConfig), crossAssetModelConfig_(crossAssetModelConfig), out_(out),
88- tab_(50 ), progressBarWidth_(72 - std::min<Size>(tab_, 67 )) {
85+ scenarioGeneratorConfig_(scenarioGeneratorConfig), crossAssetModelConfig_(crossAssetModelConfig) {
8986 // This call does not work with pure virtual functions, compiler error.
9087 // setUpConfigurations();
9188 // With a non-pure virtual function it calls the base class version here, not the overridden ones ?
@@ -96,11 +93,11 @@ class Analytic {
9693
9794 // ! Run only those analytic types that are inclcuded in the runTypes vector, run all if the runType vector is empty
9895 virtual void runAnalytic (const boost::shared_ptr<ore::data::InMemoryLoader>& loader,
99- const std::set<std::string>& runTypes = {}) = 0;
96+ const std::set<std::string>& runTypes = {}) {}
10097
10198 // we can build configurations here (today's market params, scenario sim market params, sensitivity scenasrio data)
102- virtual void buildConfigurations () {};
103- virtual void setUpConfigurations () = 0;
99+ virtual void buildConfigurations () {}
100+ virtual void setUpConfigurations () {}
104101 virtual void buildMarket (const boost::shared_ptr<ore::data::InMemoryLoader>& loader,
105102 const boost::shared_ptr<CurveConfigurations>& curveConfig,
106103 const bool marketRequired = true );
@@ -111,6 +108,10 @@ class Analytic {
111108 const std::string& label () const { return label_; }
112109 const std::set<std::string>& analyticTypes () const { return types_; }
113110 const boost::shared_ptr<ore::data::Market>& market () const { return market_; };
111+ // To allow SWIG wrapping
112+ boost::shared_ptr<MarketImpl> getMarket () const {
113+ return boost::dynamic_pointer_cast<MarketImpl>(market_);
114+ }
114115 const boost::shared_ptr<ore::data::Portfolio>& portfolio () const { return portfolio_; };
115116 virtual std::vector<boost::shared_ptr<ore::data::TodaysMarketParameters>> todaysMarketParams ();
116117 const boost::shared_ptr<ore::data::Loader>& loader () const { return loader_; };
@@ -138,8 +139,6 @@ class Analytic {
138139 bool sensitivityConfig_ = false ;
139140 bool scenarioGeneratorConfig_ = false ;
140141 bool crossAssetModelConfig_ = false ;
141- // ! Stream for progress output
142- std::ostream& out_;
143142
144143 Configurations configurations_;
145144 boost::shared_ptr<ore::data::Market> market_;
@@ -160,10 +159,6 @@ class Analytic {
160159
161160 // ! build an engine factory
162161 virtual boost::shared_ptr<ore::data::EngineFactory> engineFactory ();
163-
164- // ! optional output formatting
165- Size tab_ = 50 ;
166- Size progressBarWidth_ = 32 ;
167162};
168163
169164/* ! Pricing-type analytics
@@ -173,10 +168,9 @@ class Analytic {
173168*/
174169class PricingAnalytic : public virtual Analytic {
175170public:
176- PricingAnalytic (const boost::shared_ptr<InputParameters>& inputs,
177- std::ostream& out = std::cout)
171+ PricingAnalytic (const boost::shared_ptr<InputParameters>& inputs)
178172 : Analytic(" PRICING" , {" NPV" , " NPV_LAGGED" , " CASHFLOW" , " CASHFLOWNPV" , " SENSITIVITY" , " STRESS" },
179- inputs, false , false , false , false , out ) {
173+ inputs, false , false , false , false ) {
180174 if (find (begin (types_), end (types_), " SENSITIVITY" ) != end (types_)) {
181175 simulationConfig_ = true ;
182176 sensitivityConfig_ = true ;
@@ -196,8 +190,8 @@ class PricingAnalytic : public virtual Analytic {
196190class VarAnalytic : public virtual Analytic {
197191public:
198192 // FIXME: Add DELTA-GAMMA-VAR (Saddlepoint method)
199- VarAnalytic (const boost::shared_ptr<InputParameters>& inputs, std::ostream& out = std::cout )
200- : Analytic(" VAR" , {" VAR" }, inputs, false , false , false , false , out ) {
193+ VarAnalytic (const boost::shared_ptr<InputParameters>& inputs)
194+ : Analytic(" VAR" , {" VAR" }, inputs, false , false , false , false ) {
201195 setUpConfigurations ();
202196 }
203197 virtual void runAnalytic (const boost::shared_ptr<ore::data::InMemoryLoader>& loader,
@@ -210,8 +204,8 @@ class VarAnalytic : public virtual Analytic {
210204
211205class XvaAnalytic : public virtual Analytic {
212206public:
213- XvaAnalytic (const boost::shared_ptr<InputParameters>& inputs, std::ostream& out = std::cout )
214- : Analytic(" XVA" , {" XVA" , " EXPOSURE" }, inputs, true , false , false , false , out ) {
207+ XvaAnalytic (const boost::shared_ptr<InputParameters>& inputs)
208+ : Analytic(" XVA" , {" XVA" , " EXPOSURE" }, inputs, true , false , false , false ) {
215209 setUpConfigurations ();
216210 }
217211 virtual void runAnalytic (const boost::shared_ptr<ore::data::InMemoryLoader>& loader,
0 commit comments