Skip to content

Commit d38f030

Browse files
pcaspersjenkins
authored andcommitted
enforce registration of a subset of trade / engine / leg builders
1 parent 9c096e0 commit d38f030

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ OREApp::OREApp(boost::shared_ptr<Parameters> params, bool console)
322322

323323
// Read setup
324324
readSetup();
325+
326+
dummyRegisterBuildersForWindows();
325327
}
326328

327329
OREApp::OREApp(const boost::shared_ptr<InputParameters>& inputs, const std::string& logFile, Size logLevel,
@@ -348,6 +350,55 @@ OREApp::OREApp(const boost::shared_ptr<InputParameters>& inputs, const std::stri
348350
Log::instance().registerLogger(boost::make_shared<FileLogger>(logFilePath));
349351
Log::instance().setMask(logLevel);
350352
Log::instance().switchOn();
353+
354+
dummyRegisterBuildersForWindows();
355+
}
356+
357+
void OREApp::dummyRegisterBuildersForWindows() {
358+
std::size_t dummy = 0;
359+
360+
dummy |= (std::size_t)boost::make_shared<Swap>().get();
361+
dummy |= (std::size_t)boost::make_shared<Swaption>().get();
362+
dummy |= (std::size_t)boost::make_shared<CapFloor>().get();
363+
dummy |= (std::size_t)boost::make_shared<ForwardRateAgreement>().get();
364+
dummy |= (std::size_t)boost::make_shared<FxForward>().get();
365+
dummy |= (std::size_t)boost::make_shared<FxOption>().get();
366+
dummy |= (std::size_t)boost::make_shared<FxSwap>().get();
367+
368+
dummy |= (std::size_t)boost::make_shared<SwapEngineBuilder>().get();
369+
dummy |= (std::size_t)boost::make_shared<CrossCurrencySwapEngineBuilder>().get();
370+
dummy |= (std::size_t)boost::make_shared<FxForwardEngineBuilder>().get();
371+
dummy |= (std::size_t)boost::make_shared<FxEuropeanOptionEngineBuilder>().get();
372+
dummy |= (std::size_t)boost::make_shared<FxEuropeanCSOptionEngineBuilder>().get();
373+
dummy |= (std::size_t)boost::make_shared<FxAmericanOptionFDEngineBuilder>().get();
374+
dummy |= (std::size_t)boost::make_shared<FxAmericanOptionBAWEngineBuilder>().get();
375+
dummy |= (std::size_t)boost::make_shared<CapFloorEngineBuilder>().get();
376+
dummy |= (std::size_t)boost::make_shared<CapFlooredOvernightIndexedCouponLegEngineBuilder>().get();
377+
dummy |= (std::size_t)boost::make_shared<CapFlooredAverageONIndexedCouponLegEngineBuilder>().get();
378+
dummy |= (std::size_t)boost::make_shared<CapFlooredIborLegEngineBuilder>().get();
379+
dummy |= (std::size_t)boost::make_shared<LinearTSRCmsCouponPricerBuilder>().get();
380+
381+
boost::shared_ptr<QuantExt::CrossAssetModel> cam;
382+
std::vector<Date> simulationDates;
383+
dummy |= (std::size_t)boost::make_shared<CamAmcFxOptionEngineBuilder>(cam, simulationDates).get();
384+
dummy |= (std::size_t)boost::make_shared<CamAmcCurrencySwapEngineBuilder>(cam, simulationDates).get();
385+
dummy |= (std::size_t)boost::make_shared<CamAmcSwapEngineBuilder>(cam, simulationDates).get();
386+
dummy |= (std::size_t)boost::make_shared<LgmAmcBermudanSwaptionEngineBuilder>(cam, simulationDates).get();
387+
388+
dummy |= (std::size_t)boost::make_shared<FixedLegBuilder>().get();
389+
dummy |= (std::size_t)boost::make_shared<ZeroCouponFixedLegBuilder>().get();
390+
dummy |= (std::size_t)boost::make_shared<FloatingLegBuilder>().get();
391+
dummy |= (std::size_t)boost::make_shared<CashflowLegBuilder>().get();
392+
dummy |= (std::size_t)boost::make_shared<CPILegBuilder>().get();
393+
dummy |= (std::size_t)boost::make_shared<YYLegBuilder>().get();
394+
dummy |= (std::size_t)boost::make_shared<CMSLegBuilder>().get();
395+
dummy |= (std::size_t)boost::make_shared<CMBLegBuilder>().get();
396+
dummy |= (std::size_t)boost::make_shared<DigitalCMSLegBuilder>().get();
397+
dummy |= (std::size_t)boost::make_shared<CMSSpreadLegBuilder>().get();
398+
dummy |= (std::size_t)boost::make_shared<DigitalCMSSpreadLegBuilder>().get();
399+
dummy |= (std::size_t)boost::make_shared<EquityLegBuilder>().get();
400+
401+
ELOG("Enforce builder registration: " << dummy);
351402
}
352403

353404
OREApp::~OREApp() {

OREAnalytics/orea/app/oreapp.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ class OREApp {
286286

287287
private:
288288
virtual ReportWriter* getReportWriterImpl() const { return new ReportWriter(); }
289-
289+
// to be removed again once we have resolved the auto-registering problem on windows
290+
void dummyRegisterBuildersForWindows();
290291
};
291292

292293
} // namespace analytics

0 commit comments

Comments
 (0)