Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IndexedCoupon Class Reference

indexed coupon More...

#include <qle/cashflows/indexedcoupon.hpp>

+ Inheritance diagram for IndexedCoupon:
+ Collaboration diagram for IndexedCoupon:

Public Member Functions

 IndexedCoupon (const QuantLib::ext::shared_ptr< Coupon > &c, const Real qty, const QuantLib::ext::shared_ptr< Index > &index, const Date &fixingDate)
 
 IndexedCoupon (const QuantLib::ext::shared_ptr< Coupon > &c, const Real qty, const Real initialFixing)
 
Observer interface
void update () override
 
Coupon interface
Real amount () const override
 
Real nominal () const override
 
Real rate () const override
 
DayCounter dayCounter () const override
 
Real accruedAmount (const Date &d) const override
 
Inspectors
QuantLib::ext::shared_ptr< Couponunderlying () const
 
Real quantity () const
 
QuantLib::ext::shared_ptr< Index > index () const
 
const Date & fixingDate () const
 
Real initialFixing () const
 
Real multiplier () const
 

Visitability

QuantLib::ext::shared_ptr< Couponc_
 
Real qty_
 
QuantLib::ext::shared_ptr< Index > index_
 
Date fixingDate_
 
Real initialFixing_
 
void accept (AcyclicVisitor &) override
 

Detailed Description

indexed coupon

Definition at line 38 of file indexedcoupon.hpp.

Constructor & Destructor Documentation

◆ IndexedCoupon() [1/2]

IndexedCoupon ( const QuantLib::ext::shared_ptr< Coupon > &  c,
const Real  qty,
const QuantLib::ext::shared_ptr< Index > &  index,
const Date &  fixingDate 
)

pays c->amount() * qty * index(fixingDate)

Definition at line 26 of file indexedcoupon.cpp.

28 : Coupon(c->date(), 0.0, c->accrualStartDate(), c->accrualEndDate(), c->referencePeriodStart(),
29 c->referencePeriodEnd(), c->exCouponDate()),
30 c_(c), qty_(qty), index_(index), fixingDate_(fixingDate), initialFixing_(Null<Real>()) {
31 QL_REQUIRE(index, "IndexedCoupon: index is null");
32 QL_REQUIRE(fixingDate != Date(), "IndexedCoupon: fixingDate is null");
33 registerWith(c);
34 registerWith(index);
35}
QuantLib::ext::shared_ptr< Index > index() const
QuantLib::ext::shared_ptr< Index > index_
QuantLib::ext::shared_ptr< Coupon > c_
const Date & fixingDate() const
+ Here is the call graph for this function:

◆ IndexedCoupon() [2/2]

IndexedCoupon ( const QuantLib::ext::shared_ptr< Coupon > &  c,
const Real  qty,
const Real  initialFixing 
)

pays c->amount() * qty * initialFixing

Definition at line 37 of file indexedcoupon.cpp.

38 : Coupon(c->date(), c->nominal(), c->accrualStartDate(), c->accrualEndDate(), c->referencePeriodStart(),
39 c->referencePeriodEnd(), c->exCouponDate()),
41 QL_REQUIRE(initialFixing != Null<Real>(), "IndexedCoupon: initial fixing is null");
42 registerWith(c);
43}
+ Here is the call graph for this function:

Member Function Documentation

◆ update()

void update ( )
override

Definition at line 45 of file indexedcoupon.cpp.

45{ notifyObservers(); }

◆ amount()

Real amount ( ) const
override

Definition at line 47 of file indexedcoupon.cpp.

47{ return c_->amount() * multiplier(); }
+ Here is the call graph for this function:

◆ nominal()

Real nominal ( ) const
override

Definition at line 53 of file indexedcoupon.cpp.

53{ return c_->nominal() * multiplier(); }
+ Here is the call graph for this function:

◆ rate()

Real rate ( ) const
override

Definition at line 55 of file indexedcoupon.cpp.

55{ return c_->rate(); }

◆ dayCounter()

DayCounter dayCounter ( ) const
override

Definition at line 57 of file indexedcoupon.cpp.

57{ return c_->dayCounter(); }

◆ accruedAmount()

Real accruedAmount ( const Date &  d) const
override

Definition at line 49 of file indexedcoupon.cpp.

49{ return c_->accruedAmount(d) * multiplier(); }
+ Here is the call graph for this function:

◆ underlying()

QuantLib::ext::shared_ptr< Coupon > underlying ( ) const

Definition at line 59 of file indexedcoupon.cpp.

59{ return c_; }

◆ quantity()

Real quantity ( ) const

Definition at line 61 of file indexedcoupon.cpp.

61{ return qty_; }

◆ index()

QuantLib::ext::shared_ptr< Index > index ( ) const

Definition at line 67 of file indexedcoupon.cpp.

67{ return index_; }
+ Here is the caller graph for this function:

◆ fixingDate()

const Date & fixingDate ( ) const

Definition at line 63 of file indexedcoupon.cpp.

63{ return fixingDate_; }
+ Here is the caller graph for this function:

◆ initialFixing()

Real initialFixing ( ) const

Definition at line 65 of file indexedcoupon.cpp.

65{ return initialFixing_; }
+ Here is the caller graph for this function:

◆ multiplier()

Real multiplier ( ) const

Definition at line 51 of file indexedcoupon.cpp.

51{ return index_ ? qty_ * index_->fixing(fixingDate_) : qty_ * initialFixing_; }
+ Here is the caller graph for this function:

◆ accept()

void accept ( AcyclicVisitor &  v)
override

Definition at line 69 of file indexedcoupon.cpp.

69 {
70 Visitor<IndexedCoupon>* v1 = dynamic_cast<Visitor<IndexedCoupon>*>(&v);
71 if (v1 != 0)
72 v1->visit(*this);
73 else
74 Coupon::accept(v);
75}

Member Data Documentation

◆ c_

QuantLib::ext::shared_ptr<Coupon> c_
private

Definition at line 76 of file indexedcoupon.hpp.

◆ qty_

Real qty_
private

Definition at line 77 of file indexedcoupon.hpp.

◆ index_

QuantLib::ext::shared_ptr<Index> index_
private

Definition at line 78 of file indexedcoupon.hpp.

◆ fixingDate_

Date fixingDate_
private

Definition at line 79 of file indexedcoupon.hpp.

◆ initialFixing_

Real initialFixing_
private

Definition at line 80 of file indexedcoupon.hpp.