Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
nettingsetmanager.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/nettingsetmanager.hpp
20 \brief Manager class for repository of netting set details
21 \ingroup tradedata
22*/
23
24#pragma once
25
29#include <ql/shared_ptr.hpp>
30
31namespace ore {
32namespace data {
33
35
36//! Netting Set Manager
37/*!
38 This class is a manager to store netting set definitions
39
40 \ingroup tradedata
41*/
43public:
44 /*!
45 default constructor
46 */
48
49 /*!
50 clears the manager of all data
51 */
52 void reset();
53
54 /*!
55 checks if the manager is empty
56 */
57 const bool empty() const;
58
59 /*!
60 checks if at least one of the netting set definitions has calculateIMAmount = true
61 */
62 const bool calculateIMAmount() const;
63
64 /*!
65 returns the list of netting sets for which SIMM will be calculated as IM
66 */
67 const std::set<NettingSetDetails> calculateIMNettingSets() const;
68
69 /*!
70 checks if object named id exists in manager
71 */
72 bool has(const string& id) const;
73
74 /*!
75 checks if object with the given nettingSetDetails exists in manager
76 */
77 bool has(const NettingSetDetails& nettingSetDetails) const;
78
79 /*!
80 adds a new NettingSetDefinition object to manager
81 */
82 void add(const QuantLib::ext::shared_ptr<NettingSetDefinition>& nettingSet);
83
84 /*!
85 extracts a pointer to a NettingSetDefinition from manager
86 */
87 QuantLib::ext::shared_ptr<NettingSetDefinition> get(const string& id) const;
88 QuantLib::ext::shared_ptr<NettingSetDefinition> get(const NettingSetDetails& nettingSetDetails) const;
89
90 /*!
91 vector containing the ids of all objects stored in manager
92 */
93 vector<NettingSetDetails> uniqueKeys() const { return uniqueKeys_; }
94
95 void fromXML(XMLNode* node) override;
96 XMLNode* toXML(XMLDocument& doc) const override;
97 const std::map<NettingSetDetails, const QuantLib::ext::shared_ptr<NettingSetDefinition>>& nettingSetDefinitions() { return data_; }
98
99private:
100 map<NettingSetDetails, const QuantLib::ext::shared_ptr<NettingSetDefinition>> data_;
101 vector<NettingSetDetails> uniqueKeys_;
102};
103} // namespace data
104} // namespace ore
Serializable object holding netting set identification data.
const std::map< NettingSetDetails, const QuantLib::ext::shared_ptr< NettingSetDefinition > > & nettingSetDefinitions()
vector< NettingSetDetails > uniqueKeys() const
vector< NettingSetDetails > uniqueKeys_
map< NettingSetDetails, const QuantLib::ext::shared_ptr< NettingSetDefinition > > data_
const std::set< NettingSetDetails > calculateIMNettingSets() const
const bool calculateIMAmount() const
void add(const QuantLib::ext::shared_ptr< NettingSetDefinition > &nettingSet)
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
bool has(const string &id) const
QuantLib::ext::shared_ptr< NettingSetDefinition > get(const string &id) const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
trade envelope data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Netting Set Definition - including CSA information where available.
XML utility functions.