Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
premiumdata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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/premiumdata.hpp
20 \brief premium data
21 \ingroup tradedata
22*/
23
24#pragma once
25
27
28#include <ql/time/date.hpp>
29
30namespace ore {
31namespace data {
32
33//! Serializable object holding premium data
34/*!
35 \ingroup tradedata
36*/
38public:
39 struct PremiumDatum {
41 PremiumDatum(double amount, const string& ccy, const QuantLib::Date& payDate)
43 double amount = QuantLib::Null<double>();
44 string ccy;
45 QuantLib::Date payDate;
46 };
47
49 PremiumData(double amount, const string& ccy, const QuantLib::Date& payDate)
50 : premiumData_(1, PremiumDatum(amount, ccy, payDate)) {}
51 explicit PremiumData(const std::vector<PremiumDatum>& premiumData) : premiumData_(premiumData) {}
52
53 QuantLib::Date latestPremiumDate() const;
54
55 //! \name Inspectors
56 //@{
57 const std::vector<PremiumDatum>& premiumData() const { return premiumData_; }
58 //@}
59
60 //! \name Serialisation
61 //@{
62 virtual void fromXML(XMLNode* node) override;
63 virtual XMLNode* toXML(XMLDocument& doc) const override;
64 //@}
65
66private:
67 std::vector<PremiumDatum> premiumData_;
68};
69
70} // namespace data
71} // namespace ore
Serializable object holding premium data.
Definition: premiumdata.hpp:37
const std::vector< PremiumDatum > & premiumData() const
Definition: premiumdata.hpp:57
std::vector< PremiumDatum > premiumData_
Definition: premiumdata.hpp:67
PremiumData(double amount, const string &ccy, const QuantLib::Date &payDate)
Definition: premiumdata.hpp:49
PremiumData(const std::vector< PremiumDatum > &premiumData)
Definition: premiumdata.hpp:51
QuantLib::Date latestPremiumDate() const
Definition: premiumdata.cpp:28
virtual void fromXML(XMLNode *node) override
Definition: premiumdata.cpp:37
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: premiumdata.cpp:76
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
PremiumDatum(double amount, const string &ccy, const QuantLib::Date &payDate)
Definition: premiumdata.hpp:41
XML utility functions.