QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
defaulttype.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 StatPro Italia srl
5 Copyright (C) 2009 Jose Aparicio
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
26#ifndef quantlib_default_type_hpp
27#define quantlib_default_type_hpp
28
29#include <ql/time/period.hpp>
30
31namespace QuantLib {
32
34
37 enum Seniority {
38 SecDom = 0,
43 // Unassigned value, allows for default RR quote
45 // markit parlance
51 };
52
53
55
61 enum Type {
62 // Includes one of the restructuring cases
69 // synonyms
73 // Other non-isda
74 Downgrade, // Non-ISDA, not in FpML
75 MergerEvent // Non-ISDA, not in FpML
76 };
77 };
78
79
80 // these could be merged with the ones above if not because
81 // restructuring types can not be combined together.
82
85 enum Type {
91 // Markit notation:
96 };
97 };
98
99
101
107 public:
108 explicit DefaultType(AtomicDefault::Type defType =
111
112 virtual ~DefaultType() = default;
113
115 return defTypes_;
116 }
118 bool isRestructuring() const {
120 }
121
122 // bool isAtomic() const { return defTypes_.size() == 1;}
123
135 return defTypes_ == defType;
136 }
137
139 return (restrType_ == resType) ||
141 }
142 protected:
143 //std::set<AtomicDefault::Type> defTypes_;
146 };
147
148
160 bool operator==(const DefaultType& lhs, const DefaultType& rhs);
161
162
163
165 class FailureToPay : public DefaultType {
166 public:
167 // Only atomic construction.
168 // Amount contract by default is in dollars as per ISDA doc and not
169 // the contract curr. Theres an issue here...... FIX ME
170 explicit FailureToPay(const Period& grace,
171 Real amount = 1.e+6)
173 gracePeriod_(grace), amountRequired_(amount) {}
174
176 const Period& gracePeriod() const {return gracePeriod_;}
177 private:
178 // Grace period to consider the event. If payment occurs during
179 // the period the event should be removed from its container.
181 // Minimum default amount triggering the event
183 };
184
185}
186
187#endif
Atomic credit-event type.
virtual ~DefaultType()=default
Restructuring::Type restructuringType() const
Restructuring::Type restrType_
AtomicDefault::Type defTypes_
bool containsRestructuringType(Restructuring::Type resType) const
bool containsDefaultType(AtomicDefault::Type defType) const
bool isRestructuring() const
AtomicDefault::Type defaultType() const
Failure to Pay atomic event type.
const Period & gracePeriod() const
FailureToPay(const Period &grace, Real amount=1.e+6)
Real amountRequired() const
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
bool operator==(const Currency &c1, const Currency &c2)
Definition: currency.hpp:191
Seniority
Seniority of a bond.
Definition: defaulttype.hpp:37
Atomic (single contractual event) default events.
Definition: defaulttype.hpp:60
Restructuring type.
Definition: defaulttype.hpp:84