Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
enginedata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 ored/portfolio/enginedata.hpp
20 \brief A class to hold pricing engine parameters
21 \ingroup tradedata
22*/
23
24#pragma once
25
29
30namespace ore {
31namespace data {
35using std::string;
36using std::vector;
37
38//! Pricing engine description
39/*! \ingroup tradedata
40 */
42public:
43 //! Default constructor
45
46 //! \name Inspectors
47 //@{
48 bool hasProduct(const string& productName);
49 const string& model(const string& productName) const { return model_.at(productName); }
50 const map<string, string>& modelParameters(const string& productName) const { return modelParams_.at(productName); }
51 const string& engine(const string& productName) const { return engine_.at(productName); }
52 const map<string, string>& engineParameters(const string& productName) const {
53 return engineParams_.at(productName);
54 }
55 const std::map<std::string, std::string>& globalParameters() const { return globalParams_; }
56
57 //! Return all products
58 vector<string> products() const;
59 //@}
60
61 //! \name Setters
62 //@{
63 string& model(const string& productName) { return model_[productName]; }
64 map<string, string>& modelParameters(const string& productName) { return modelParams_[productName]; }
65 string& engine(const string& productName) { return engine_[productName]; }
66 map<string, string>& engineParameters(const string& productName) { return engineParams_[productName]; }
67 std::map<std::string, std::string>& globalParameters() { return globalParams_; }
68 //@}
69
70 //! Clear all data
71 void clear();
72
73 //! \name Serialisation
74 //@{
75 virtual void fromXML(XMLNode* node) override;
76 virtual XMLNode* toXML(XMLDocument& doc) const override;
77 //@}
78
79private:
80 map<string, string> model_;
81 map<string, map<string, string>> modelParams_;
82 map<string, string> engine_;
83 map<string, map<string, string>> engineParams_;
84 std::map<std::string, std::string> globalParams_;
85};
86
87bool operator==(const EngineData& lhs, const EngineData& rhs);
88bool operator!=(const EngineData& lhs, const EngineData& rhs);
89
90} // namespace data
91} // namespace ore
Pricing engine description.
Definition: enginedata.hpp:41
map< string, map< string, string > > engineParams_
Definition: enginedata.hpp:83
map< string, string > & engineParameters(const string &productName)
Definition: enginedata.hpp:66
map< string, string > model_
Definition: enginedata.hpp:80
std::map< std::string, std::string > globalParams_
Definition: enginedata.hpp:84
map< string, string > engine_
Definition: enginedata.hpp:82
string & engine(const string &productName)
Definition: enginedata.hpp:65
bool hasProduct(const string &productName)
Definition: enginedata.cpp:118
vector< string > products() const
Return all products.
Definition: enginedata.cpp:120
virtual void fromXML(XMLNode *node) override
Definition: enginedata.cpp:36
std::map< std::string, std::string > & globalParameters()
Definition: enginedata.hpp:67
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: enginedata.cpp:79
const std::map< std::string, std::string > & globalParameters() const
Definition: enginedata.hpp:55
map< string, string > & modelParameters(const string &productName)
Definition: enginedata.hpp:64
const map< string, string > & modelParameters(const string &productName) const
Definition: enginedata.hpp:50
void clear()
Clear all data.
Definition: enginedata.cpp:28
EngineData()
Default constructor.
Definition: enginedata.hpp:44
string & model(const string &productName)
Definition: enginedata.hpp:63
const map< string, string > & engineParameters(const string &productName) const
Definition: enginedata.hpp:52
const string & model(const string &productName) const
Definition: enginedata.hpp:49
map< string, map< string, string > > modelParams_
Definition: enginedata.hpp:81
const string & engine(const string &productName) const
Definition: enginedata.hpp:51
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
XML Utilities Class.
Definition: xmlutils.hpp:119
@ data
Definition: log.hpp:77
bool operator!=(const Filter &a, const Filter &b)
bool operator==(const Dividend &d1, const Dividend &d)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Map text representations to QuantLib/QuantExt types.
XML utility functions.