QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CommodityCashFlow Class Reference

#include <ql/experimental/commodities/commoditycashflow.hpp>

+ Inheritance diagram for CommodityCashFlow:
+ Collaboration diagram for CommodityCashFlow:

Public Member Functions

 CommodityCashFlow (const Date &date, Money discountedAmount, Money undiscountedAmount, Money discountedPaymentAmount, Money undiscountedPaymentAmount, Real discountFactor, Real paymentDiscountFactor, bool finalized)
 
Event interface
Date date () const override
 
CashFlow interface
Real amount () const override
 returns the amount of the cash flow More...
 
const Currencycurrency () const
 
const MoneydiscountedAmount () const
 
const MoneyundiscountedAmount () const
 
const MoneydiscountedPaymentAmount () const
 
const MoneyundiscountedPaymentAmount () const
 
Real discountFactor () const
 
Real paymentDiscountFactor () const
 
bool finalized () const
 
- Public Member Functions inherited from CashFlow
 ~CashFlow () override=default
 
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...
 
void performCalculations () const override
 
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...
 
- Public Member Functions inherited from Event
 ~Event () override=default
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (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 &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (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 ()
 

Visitability

Date date_
 
Money discountedAmount_
 
Money undiscountedAmount_
 
Money discountedPaymentAmount_
 
Money undiscountedPaymentAmount_
 
Real discountFactor_
 
Real paymentDiscountFactor_
 
bool finalized_
 
void accept (AcyclicVisitor &) override
 

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_
 

Detailed Description

Definition at line 34 of file commoditycashflow.hpp.

Constructor & Destructor Documentation

◆ CommodityCashFlow()

CommodityCashFlow ( const Date date,
Money  discountedAmount,
Money  undiscountedAmount,
Money  discountedPaymentAmount,
Money  undiscountedPaymentAmount,
Real  discountFactor,
Real  paymentDiscountFactor,
bool  finalized 
)

Definition at line 36 of file commoditycashflow.hpp.

Member Function Documentation

◆ date()

Date date ( ) const
overridevirtual
Note
This is inherited from the event class

Implements CashFlow.

Definition at line 52 of file commoditycashflow.hpp.

◆ amount()

Real amount ( ) const
overridevirtual

returns the amount of the cash flow

Note
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow.

Definition at line 56 of file commoditycashflow.hpp.

+ Here is the call graph for this function:

◆ currency()

const Currency & currency ( ) const

Definition at line 58 of file commoditycashflow.hpp.

+ Here is the call graph for this function:

◆ discountedAmount()

const Money & discountedAmount ( ) const

Definition at line 62 of file commoditycashflow.hpp.

◆ undiscountedAmount()

const Money & undiscountedAmount ( ) const

Definition at line 63 of file commoditycashflow.hpp.

◆ discountedPaymentAmount()

const Money & discountedPaymentAmount ( ) const

Definition at line 64 of file commoditycashflow.hpp.

◆ undiscountedPaymentAmount()

const Money & undiscountedPaymentAmount ( ) const

Definition at line 67 of file commoditycashflow.hpp.

◆ discountFactor()

Real discountFactor ( ) const

Definition at line 70 of file commoditycashflow.hpp.

◆ paymentDiscountFactor()

Real paymentDiscountFactor ( ) const

Definition at line 71 of file commoditycashflow.hpp.

◆ finalized()

bool finalized ( ) const

Definition at line 72 of file commoditycashflow.hpp.

◆ accept()

void accept ( AcyclicVisitor v)
overridevirtual

Reimplemented from CashFlow.

Definition at line 26 of file commoditycashflow.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ date_

Date date_
private

Definition at line 79 of file commoditycashflow.hpp.

◆ discountedAmount_

Money discountedAmount_
private

Definition at line 80 of file commoditycashflow.hpp.

◆ undiscountedAmount_

Money undiscountedAmount_
private

Definition at line 80 of file commoditycashflow.hpp.

◆ discountedPaymentAmount_

Money discountedPaymentAmount_
private

Definition at line 81 of file commoditycashflow.hpp.

◆ undiscountedPaymentAmount_

Money undiscountedPaymentAmount_
private

Definition at line 81 of file commoditycashflow.hpp.

◆ discountFactor_

Real discountFactor_
private

Definition at line 82 of file commoditycashflow.hpp.

◆ paymentDiscountFactor_

Real paymentDiscountFactor_
private

Definition at line 82 of file commoditycashflow.hpp.

◆ finalized_

bool finalized_
private

Definition at line 83 of file commoditycashflow.hpp.