Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
barrierdata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 ORE is free software: you can redistribute it and/or modify it
8 under the terms of the Modified BSD License. You should have received a
9 copy of the license along with this program.
10 The license is also available online at <http://opensourcerisk.org>
11 This program is distributed on the basis that it will form a useful
12 contribution to risk analytics and model standardisation, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
15 */
16
17/*! \file ored/portfolio/optiondata.hpp
18 \brief trade option data model and serialization
19 \ingroup portfolio
20*/
21
22#pragma once
23
26
27namespace ore {
28namespace data {
29
30//! Serializable obejct holding barrier data
31/*!
32 \ingroup tradedata
33*/
35public:
36 //! Default constructor
37 BarrierData() : initialized_(false), rebate_(0.0) {}
38 //! Constructor
39 BarrierData(std::string barrierType, std::vector<double> levels, double rebate,
40 std::vector<ore::data::TradeBarrier> tradeBarriers, std::string style = "")
41 : initialized_(true), type_(barrierType), levels_(levels), rebate_(rebate), tradeBarriers_(tradeBarriers),
42 style_(style) {}
43
44 //! \name Inspectors
45 //@{
46 const std::string& type() const { return type_; }
47 double rebate() const { return rebate_; }
48 const std::string& rebateCurrency() const { return rebateCurrency_; }
49 const std::string& rebatePayTime() const { return rebatePayTime_; }
50 std::vector<ore::data::TradeBarrier> levels() const { return tradeBarriers_; }
51 const std::string& style() const { return style_; }
52 bool initialized() const { return initialized_; }
53 //@}
54
55 //! \name Serialisation
56 //@{
57 virtual void fromXML(ore::data::XMLNode* node) override;
58 virtual ore::data::XMLNode* toXML(ore::data::XMLDocument& doc) const override;
59 //@}
60
61private:
63 std::string type_;
64 std::vector<double> levels_;
65 double rebate_;
66 std::vector<ore::data::TradeBarrier> tradeBarriers_;
67 std::string rebateCurrency_;
68 std::string rebatePayTime_;
69 std::string style_;
70};
71} // namespace data
72} // namespace oreplus
Serializable obejct holding barrier data.
Definition: barrierdata.hpp:34
BarrierData(std::string barrierType, std::vector< double > levels, double rebate, std::vector< ore::data::TradeBarrier > tradeBarriers, std::string style="")
Constructor.
Definition: barrierdata.hpp:39
BarrierData()
Default constructor.
Definition: barrierdata.hpp:37
std::string rebatePayTime_
Definition: barrierdata.hpp:68
const std::string & type() const
Definition: barrierdata.hpp:46
virtual void fromXML(ore::data::XMLNode *node) override
Definition: barrierdata.cpp:25
std::string rebateCurrency_
Definition: barrierdata.hpp:67
double rebate() const
Definition: barrierdata.hpp:47
const std::string & rebatePayTime() const
Definition: barrierdata.hpp:49
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: barrierdata.cpp:49
std::vector< double > levels_
Definition: barrierdata.hpp:64
std::vector< ore::data::TradeBarrier > tradeBarriers_
Definition: barrierdata.hpp:66
const std::string & rebateCurrency() const
Definition: barrierdata.hpp:48
std::vector< ore::data::TradeBarrier > levels() const
Definition: barrierdata.hpp:50
const std::string & style() const
Definition: barrierdata.hpp:51
bool initialized() const
Definition: barrierdata.hpp:52
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade schedule data model and serialization