Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
databuilders.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file orea/app/initbuilders.hpp
20 \brief add builders to factories
21*/
22
23#pragma once
24
25#define ORE_REGISTER_LEG_DATA(NAME, CLASS, OVERWRITE) \
26 ore::data::LegDataFactory::instance().addBuilder(NAME, &ore::data::createLegData<CLASS>, OVERWRITE);
27
28#define ORE_REGISTER_CALIBRATION_INSTRUMENT(NAME, CLASS, OVERWRITE) \
29 ore::data::CalibrationInstrumentFactory::instance().addBuilder( \
30 NAME, &ore::data::createCalibrationInstrument<CLASS>, OVERWRITE);
31
32#define ORE_REGISTER_REFERENCE_DATUM(NAME, CLASS, OVERWRITE) \
33 ore::data::ReferenceDatumFactory::instance().addBuilder( \
34 NAME, &ore::data::createReferenceDatumBuilder<ore::data::ReferenceDatumBuilder<CLASS>>, OVERWRITE);
35
36#define ORE_REGISTER_BOND_BUILDER(NAME, CLASS, OVERWRITE) \
37 ore::data::BondFactory::instance().addBuilder(NAME, QuantLib::ext::make_shared<CLASS>(), OVERWRITE);
38
39#define ORE_REGISTER_TRADE_BUILDER(NAME, CLASS, OVERWRITE) \
40 ore::data::TradeFactory::instance().addBuilder(NAME, QuantLib::ext::make_shared<ore::data::TradeBuilder<CLASS>>(), \
41 OVERWRITE);
42
43#define ORE_REGISTER_LEGBUILDER(NAME, CLASS, OVERWRITE) \
44 ore::data::EngineBuilderFactory::instance().addLegBuilder([]() { return QuantLib::ext::make_shared<CLASS>(); }, \
45 OVERWRITE);
46
47#define ORE_REGISTER_AMC_ENGINE_BUILDER(CLASS, OVERWRITE) \
48 ore::data::EngineBuilderFactory::instance().addAmcEngineBuilder( \
49 [](const QuantLib::ext::shared_ptr<QuantExt::CrossAssetModel>& cam, \
50 const std::vector<ore::data::Date>& grid) { return QuantLib::ext::make_shared<CLASS>(cam, grid); }, \
51 OVERWRITE);
52
53#define ORE_REGISTER_AMCCG_ENGINE_BUILDER(CLASS, OVERWRITE) \
54 ore::data::EngineBuilderFactory::instance().addAmcCgEngineBuilder( \
55 [](const QuantLib::ext::shared_ptr<ore::data::ModelCG>& model, const std::vector<ore::data::Date>& grid) { \
56 return QuantLib::ext::make_shared<CLASS>(model, grid); \
57 }, \
58 OVERWRITE);
59
60#define ORE_REGISTER_ENGINE_BUILDER(CLASS, OVERWRITE) \
61 ore::data::EngineBuilderFactory::instance().addEngineBuilder([]() { return QuantLib::ext::make_shared<CLASS>(); }, \
62 OVERWRITE);
63
64#define ORE_REGISTER_TRS_UNDERLYING_BUILDER(NAME, CLASS, OVERWRITE) \
65 ore::data::TrsUnderlyingBuilderFactory::instance().addBuilder(NAME, QuantLib::ext::make_shared<CLASS>(), OVERWRITE);
66
67#define ORE_REGISTER_COMPUTE_FRAMEWORK_CREATOR(NAME, CLASS, OVERWRITE) \
68 QuantExt::ComputeFrameworkRegistry::instance().add(NAME, &QuantExt::createComputeFrameworkCreator<CLASS>, \
69 OVERWRITE);
70
71namespace ore::data {
72
73void dataBuilders();
74
75} // namespace ore::data
void dataBuilders()