QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Base class for cash flows. More...
#include <cashflow.hpp>
Public Member Functions | |
~CashFlow () override=default | |
Event interface | |
Date | date () const override=0 |
bool | hasOccurred (const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const override |
returns true if an event has already occurred before a date More... | |
LazyObject interface | |
void | performCalculations () const override |
CashFlow interface | |
virtual Real | amount () const =0 |
returns the amount of the cash flow More... | |
virtual Date | exCouponDate () const |
returns the date that the cash flow trades exCoupon More... | |
bool | tradingExCoupon (const Date &refDate=Date()) const |
returns true if the cashflow is trading ex-coupon on the refDate More... | |
Visitability | |
void | accept (AcyclicVisitor &) override |
Public Member Functions inherited from Event | |
~Event () override=default | |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from LazyObject | |
virtual void | calculate () const |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
Base class for cash flows.
This class is purely virtual and acts as a base class for the actual cash flow implementations.
Definition at line 40 of file cashflow.hpp.
|
overridedefault |
|
overridepure virtual |
Implements Event.
Implemented in Coupon, Dividend, IndexedCashFlow, SimpleCashFlow, and CommodityCashFlow.
|
overridevirtual |
returns true if an event has already occurred before a date
overloads Event::hasOccurred in order to take Settings::includeTodaysCashflows in account
Reimplemented from Event.
Definition at line 27 of file cashflow.cpp.
|
overridevirtual |
This method must implement any calculations which must be (re)done in order to calculate the desired results.
Implements LazyObject.
Reimplemented in CappedFlooredCoupon, DigitalCoupon, FixedRateCoupon, FloatingRateCoupon, IndexedCashFlow, InflationCoupon, ZeroInflationCashFlow, and StrippedCappedFlooredCoupon.
Definition at line 56 of file cashflow.hpp.
|
pure virtual |
returns the amount of the cash flow
Implemented in CPICashFlow, FixedDividend, FractionalDividend, EquityCashFlow, FixedRateCoupon, FloatingRateCoupon, IndexedCashFlow, InflationCoupon, SimpleCashFlow, CommodityCashFlow, and Dividend.
|
virtual |
returns the date that the cash flow trades exCoupon
Reimplemented in Coupon.
Definition at line 66 of file cashflow.hpp.
returns true if the cashflow is trading ex-coupon on the refDate
Definition at line 51 of file cashflow.cpp.
|
overridevirtual |
Reimplemented from Event.
Reimplemented in AverageBMACoupon, CappedFlooredCoupon, CmsCoupon, Coupon, CPICoupon, DigitalCmsCoupon, DigitalCoupon, DigitalIborCoupon, Dividend, EquityCashFlow, FixedRateCoupon, FloatingRateCoupon, IborCoupon, IndexedCashFlow, InflationCoupon, OvernightIndexedCoupon, RangeAccrualFloatersCoupon, SimpleCashFlow, Redemption, AmortizingPayment, SubPeriodsCoupon, YoYInflationCoupon, ZeroInflationCashFlow, CommodityCashFlow, CmsSpreadCoupon, DigitalCmsSpreadCoupon, StrippedCappedFlooredCoupon, CappedFlooredIborCoupon, CappedFlooredCmsCoupon, CappedFlooredYoYInflationCoupon, and CappedFlooredCmsSpreadCoupon.
Definition at line 63 of file cashflow.cpp.