Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
tranche.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 portfolio/tranche.hpp
20 \brief cbo tranche data model and serialization
21 \ingroup portfolio
22*/
23
24#pragma once
25
28
29namespace ore {
30namespace data {
31
32using namespace QuantLib;
34
35//! Serializable Bond-Basket Data
36/*!
37 \ingroup tradedata
38*/
39
41public:
42 //! Default constructor
44
45 TrancheData(const std::string& name, double icRatio, double ocRatio, const QuantLib::ext::shared_ptr<LegAdditionalData>& concreteLegData)
47
48 //! \name Inspectors
49 //@{
50 const std::string name() const { return name_; }
51 double faceAmount() { return faceAmount_; }
52 double icRatio() { return icRatio_; }
53 double ocRatio() { return ocRatio_; }
54 const QuantLib::ext::shared_ptr<LegAdditionalData> concreteLegData() {return concreteLegData_; }
55 //@}
56
57 //! \name Serialisation
58 //@{
59 virtual void fromXML(XMLNode* node) override;
60 virtual XMLNode* toXML(ore::data::XMLDocument& doc) const override;
61
62 //@}
63private:
64 std::string name_;
66 double icRatio_;
67 double ocRatio_;
68 QuantLib::ext::shared_ptr<LegAdditionalData> concreteLegData_;
69
70};
71} // namespace data
72} // namespace ore
Serializable Bond-Basket Data.
Definition: tranche.hpp:40
std::string name_
Definition: tranche.hpp:64
const QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData()
Definition: tranche.hpp:54
QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData_
Definition: tranche.hpp:68
virtual void fromXML(XMLNode *node) override
Definition: tranche.cpp:28
virtual XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: tranche.cpp:58
TrancheData(const std::string &name, double icRatio, double ocRatio, const QuantLib::ext::shared_ptr< LegAdditionalData > &concreteLegData)
Definition: tranche.hpp:45
TrancheData()
Default constructor.
Definition: tranche.hpp:43
const std::string name() const
Definition: tranche.hpp:50
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.