QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | Private Types | List of all members
DefaultEvent Class Reference

Credit event on a bond of a certain seniority(ies)/currency. More...

#include <defaultevent.hpp>

+ Inheritance diagram for DefaultEvent:
+ Collaboration diagram for DefaultEvent:

Classes

class  DefaultSettlement
 

Public Member Functions

 DefaultEvent (const Date &creditEventDate, const DefaultType &atomicEvType, Currency curr, Seniority bondsSen, const Date &settleDate=Null< Date >(), const std::map< Seniority, Real > &recoveryRates=rate_map())
 
 DefaultEvent (const Date &creditEventDate, const DefaultType &atomicEvType, Currency curr, Seniority bondsSen, const Date &settleDate, Real recoveryRate)
 
Date date () const override
 returns the date at which the event occurs More...
 
bool isRestructuring () const
 
bool isDefault () const
 
bool hasSettled () const
 
const DefaultSettlementsettlement () const
 
const DefaultTypedefaultType () const
 
const Currencycurrency () const
 returns the currency of the bond this event refers to. More...
 
Seniority eventSeniority () const
 returns the seniority of the bond that triggered the event. More...
 
virtual Real recoveryRate (Seniority seniority) const
 
virtual bool matchesEventType (const ext::shared_ptr< DefaultType > &contractEvType) const
 
virtual bool matchesDefaultKey (const DefaultProbKey &contractKey) const
 
void accept (AcyclicVisitor &) override
 
- Public Member Functions inherited from Event
 ~Event () override=default
 
virtual bool hasOccurred (const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
 returns true if an event has already occurred before a date More...
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Protected Attributes

Currency bondsCurrency_
 
Date defaultDate_
 
DefaultType eventType_
 
Seniority bondsSeniority_
 
DefaultSettlement defSettlement_
 

Private Types

typedef std::map< Seniority, Realrate_map
 

Detailed Description

Credit event on a bond of a certain seniority(ies)/currency.

Represents a credit event affecting all bonds with a given \ seniority and currency. It assumes that all such bonds suffer \ the event simultaneously. Some events affect all seniorities and this has to be encoded through a different set of events of the same event type. The event is an actual realization, not a contractual reference, as such it contains only an atomic type.

Definition at line 49 of file defaultevent.hpp.

Member Typedef Documentation

◆ rate_map

typedef std::map<Seniority, Real> rate_map
private

Definition at line 86 of file defaultevent.hpp.

Constructor & Destructor Documentation

◆ DefaultEvent() [1/2]

DefaultEvent ( const Date creditEventDate,
const DefaultType atomicEvType,
Currency  curr,
Seniority  bondsSen,
const Date settleDate = Null<Date>(),
const std::map< Seniority, Real > &  recoveryRates = rate_map() 
)

Credit event with optional settlement information. Represents a credit event that has taken place. Realized events are of an atomic type. If the settlement information is given seniorities present are the seniorities/bonds affected by the event.

Definition at line 90 of file defaultevent.cpp.

◆ DefaultEvent() [2/2]

DefaultEvent ( const Date creditEventDate,
const DefaultType atomicEvType,
Currency  curr,
Seniority  bondsSen,
const Date settleDate,
Real  recoveryRate 
)

Use NoSeniority to settle to all seniorities with that recovery. In that case the event is assumed to have affected all seniorities.

Definition at line 108 of file defaultevent.cpp.

Member Function Documentation

◆ date()

Date date ( ) const
overridevirtual

returns the date at which the event occurs

Implements Event.

Definition at line 29 of file defaultevent.cpp.

+ Here is the caller graph for this function:

◆ isRestructuring()

bool isRestructuring ( ) const

Definition at line 114 of file defaultevent.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDefault()

bool isDefault ( ) const

Definition at line 115 of file defaultevent.hpp.

+ Here is the call graph for this function:

◆ hasSettled()

bool hasSettled ( ) const

Definition at line 116 of file defaultevent.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settlement()

const DefaultSettlement & settlement ( ) const

Definition at line 119 of file defaultevent.hpp.

◆ defaultType()

const DefaultType & defaultType ( ) const

Definition at line 122 of file defaultevent.hpp.

+ Here is the caller graph for this function:

◆ currency()

const Currency & currency ( ) const

returns the currency of the bond this event refers to.

Definition at line 126 of file defaultevent.hpp.

+ Here is the caller graph for this function:

◆ eventSeniority()

Seniority eventSeniority ( ) const

returns the seniority of the bond that triggered the event.

Definition at line 130 of file defaultevent.hpp.

+ Here is the caller graph for this function:

◆ recoveryRate()

virtual Real recoveryRate ( Seniority  seniority) const
virtual

returns a value if the event lead to a settlement for the requested seniority. Specializations on the default atomics and recoveries could change the default policy.

Definition at line 137 of file defaultevent.hpp.

+ Here is the call graph for this function:

◆ matchesEventType()

virtual bool matchesEventType ( const ext::shared_ptr< DefaultType > &  contractEvType) const
virtual

matches the event if this event would trigger a contract related to the requested event type. Notice the contractual event types are not neccesarily atomic. Notice it does not check seniority or currency only event type. typically used from Issuer

Reimplemented in BankruptcyEvent, and FailureToPayEvent.

Definition at line 150 of file defaultevent.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ matchesDefaultKey()

bool matchesDefaultKey ( const DefaultProbKey contractKey) const
virtual

Returns true if this event would trigger a contract with the arguments characteristics.

Definition at line 123 of file defaultevent.cpp.

+ Here is the call graph for this function:

◆ accept()

void accept ( AcyclicVisitor v)
overridevirtual

Reimplemented from Event.

Definition at line 33 of file defaultevent.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ bondsCurrency_

Currency bondsCurrency_
protected

Definition at line 168 of file defaultevent.hpp.

◆ defaultDate_

Date defaultDate_
protected

Definition at line 169 of file defaultevent.hpp.

◆ eventType_

DefaultType eventType_
protected

Definition at line 170 of file defaultevent.hpp.

◆ bondsSeniority_

Seniority bondsSeniority_
protected

Definition at line 171 of file defaultevent.hpp.

◆ defSettlement_

DefaultSettlement defSettlement_
protected

Definition at line 172 of file defaultevent.hpp.