Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
rangebound.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/rangebound.hpp
20 \brief rangebound data model
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30using QuantLib::Null;
31using QuantLib::Real;
32using std::string;
33using std::vector;
34
35//! Serializable obejct holding range bound data
36/*!
37 \ingroup tradedata
38*/
40public:
41 //! Default constructor
42 RangeBound() : from_(Null<Real>()), to_(Null<Real>()), leverage_(Null<Real>()), strike_(Null<Real>()) {}
43 //! Constructor
44 RangeBound(const Real from, const Real to, const Real leverage, const Real strike, const Real strikeAdjustment)
46
47 //! \name Inspectors
48 //@{
49 Real from() const { return from_; }
50 Real to() const { return to_; }
51 Real leverage() const { return leverage_; }
52 Real strike() const { return strike_; }
53 Real strikeAdjustment() const { return strikeAdjustment_; }
54 //@}
55
56 //! \name Serialisation
57 //@{
58 virtual void fromXML(ore::data::XMLNode* node) override;
59 virtual ore::data::XMLNode* toXML(ore::data::XMLDocument& doc) const override;
60 //@}
61
62private:
64};
65
66bool operator==(const RangeBound& a, const RangeBound& b);
67std::ostream& operator<<(std::ostream& out, const RangeBound& t);
68std::ostream& operator<<(std::ostream& out, const std::vector<RangeBound>& t);
69
70} // namespace data
71} // namespace ore
Serializable obejct holding range bound data.
Definition: rangebound.hpp:39
virtual void fromXML(ore::data::XMLNode *node) override
Definition: rangebound.cpp:27
Real leverage() const
Definition: rangebound.hpp:51
RangeBound()
Default constructor.
Definition: rangebound.hpp:42
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: rangebound.cpp:51
RangeBound(const Real from, const Real to, const Real leverage, const Real strike, const Real strikeAdjustment)
Constructor.
Definition: rangebound.hpp:44
Real strike() const
Definition: rangebound.hpp:52
Real strikeAdjustment() const
Definition: rangebound.hpp:53
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
bool operator==(const Dividend &d1, const Dividend &d)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade schedule data model and serialization