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

indexed cashflow More...

#include <qle/cashflows/indexedcoupon.hpp>

+ Inheritance diagram for IndexWrappedCashFlow:
+ Collaboration diagram for IndexWrappedCashFlow:

Public Member Functions

 IndexWrappedCashFlow (const QuantLib::ext::shared_ptr< CashFlow > &c, const Real qty, const QuantLib::ext::shared_ptr< Index > &index, const Date &fixingDate)
 
 IndexWrappedCashFlow (const QuantLib::ext::shared_ptr< CashFlow > &c, const Real qty, const Real initialFixing)
 
Observer interface
void update () override
 
Cashflow interface
Date date () const override
 
Real amount () const override
 
Inspectors
QuantLib::ext::shared_ptr< CashFlow > underlying () 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< CashFlow > c_
 
Real qty_
 
QuantLib::ext::shared_ptr< Index > index_
 
Date fixingDate_
 
Real initialFixing_
 
void accept (AcyclicVisitor &) override
 

Detailed Description

indexed cashflow

Definition at line 87 of file indexedcoupon.hpp.

Constructor & Destructor Documentation

◆ IndexWrappedCashFlow() [1/2]

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

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

Definition at line 77 of file indexedcoupon.cpp.

79 : c_(c), qty_(qty), index_(index), fixingDate_(fixingDate), initialFixing_(Null<Real>()) {
80 QL_REQUIRE(index, "IndexWrappedCashFlow: index is null");
81 QL_REQUIRE(fixingDate != Date(), "IndexWrappedCashFlow: fixingDate is null");
82 registerWith(c);
83 registerWith(index);
84}
QuantLib::ext::shared_ptr< Index > index() const
QuantLib::ext::shared_ptr< Index > index_
QuantLib::ext::shared_ptr< CashFlow > c_
const Date & fixingDate() const
+ Here is the call graph for this function:

◆ IndexWrappedCashFlow() [2/2]

IndexWrappedCashFlow ( const QuantLib::ext::shared_ptr< CashFlow > &  c,
const Real  qty,
const Real  initialFixing 
)

pays c->amount() * qty * initialFixing

Definition at line 86 of file indexedcoupon.cpp.

88 : c_(c), qty_(qty), initialFixing_(initialFixing) {
89 QL_REQUIRE(initialFixing != Null<Real>(), "IndexWrappedCashFlow: initial fixing is null");
90 registerWith(c);
91}
+ Here is the call graph for this function:

Member Function Documentation

◆ update()

void update ( )
override

Definition at line 93 of file indexedcoupon.cpp.

93{ notifyObservers(); }

◆ date()

Date date ( ) const
override

Definition at line 95 of file indexedcoupon.cpp.

95{ return c_->date(); }

◆ amount()

Real amount ( ) const
override

Definition at line 96 of file indexedcoupon.cpp.

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

◆ underlying()

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

Definition at line 102 of file indexedcoupon.cpp.

102{ return c_; }

◆ quantity()

Real quantity ( ) const

Definition at line 104 of file indexedcoupon.cpp.

104{ return qty_; }

◆ index()

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

Definition at line 110 of file indexedcoupon.cpp.

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

◆ fixingDate()

const Date & fixingDate ( ) const

Definition at line 106 of file indexedcoupon.cpp.

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

◆ initialFixing()

Real initialFixing ( ) const

Definition at line 108 of file indexedcoupon.cpp.

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

◆ multiplier()

Real multiplier ( ) const

Definition at line 98 of file indexedcoupon.cpp.

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

◆ accept()

void accept ( AcyclicVisitor &  v)
override

Definition at line 112 of file indexedcoupon.cpp.

112 {
113 Visitor<IndexWrappedCashFlow>* v1 = dynamic_cast<Visitor<IndexWrappedCashFlow>*>(&v);
114 if (v1 != 0)
115 v1->visit(*this);
116 else
117 CashFlow::accept(v);
118}

Member Data Documentation

◆ c_

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

Definition at line 122 of file indexedcoupon.hpp.

◆ qty_

Real qty_
private

Definition at line 123 of file indexedcoupon.hpp.

◆ index_

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

Definition at line 124 of file indexedcoupon.hpp.

◆ fixingDate_

Date fixingDate_
private

Definition at line 125 of file indexedcoupon.hpp.

◆ initialFixing_

Real initialFixing_
private

Definition at line 126 of file indexedcoupon.hpp.