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

#include <qle/cashflows/commoditycashflow.hpp>

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

Public Member Functions

 CommodityCashFlow (QuantLib::Real quantity, QuantLib::Real spread, QuantLib::Real gearing, bool useFuturePrice, const ext::shared_ptr< CommodityIndex > &index, const ext::shared_ptr< FxIndex > &fxIndex)
 
QuantLib::Real quantity () const
 
QuantLib::Real spread () const
 
QuantLib::Real gearing () const
 
bool useFuturePrice () const
 
ext::shared_ptr< CommodityIndexindex () const
 
ext::shared_ptr< FxIndexfxIndex () const
 
virtual const std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > & indices () const =0
 Return a map of pricing date and corresponding commodity index. More...
 
virtual QuantLib::Date lastPricingDate () const =0
 
virtual QuantLib::Real periodQuantity () const =0
 
virtual QuantLib::Real fixing () const =0
 

Visitability

QuantLib::Real quantity_
 
QuantLib::Real spread_
 
QuantLib::Real gearing_
 
bool useFuturePrice_
 
ext::shared_ptr< CommodityIndexindex_
 
ext::shared_ptr< FxIndexfxIndex_
 
QuantLib::Real amount_
 
void accept (QuantLib::AcyclicVisitor &v) override
 

Detailed Description

Definition at line 80 of file commoditycashflow.hpp.

Constructor & Destructor Documentation

◆ CommodityCashFlow()

CommodityCashFlow ( QuantLib::Real  quantity,
QuantLib::Real  spread,
QuantLib::Real  gearing,
bool  useFuturePrice,
const ext::shared_ptr< CommodityIndex > &  index,
const ext::shared_ptr< FxIndex > &  fxIndex 
)

Definition at line 37 of file commoditycashflow.cpp.

42 registerWith(index_);
43 if (fxIndex) {
44 registerWith(fxIndex);
45 }
46}
QuantLib::Real spread() const
ext::shared_ptr< FxIndex > fxIndex() const
ext::shared_ptr< FxIndex > fxIndex_
QuantLib::Real gearing() const
ext::shared_ptr< CommodityIndex > index_
ext::shared_ptr< CommodityIndex > index() const
QuantLib::Real quantity() const
+ Here is the call graph for this function:

Member Function Documentation

◆ quantity()

QuantLib::Real quantity ( ) const

Definition at line 84 of file commoditycashflow.hpp.

84{ return quantity_; }

◆ spread()

QuantLib::Real spread ( ) const

Definition at line 85 of file commoditycashflow.hpp.

85{ return spread_; }

◆ gearing()

QuantLib::Real gearing ( ) const

Definition at line 86 of file commoditycashflow.hpp.

86{ return gearing_; }

◆ useFuturePrice()

bool useFuturePrice ( ) const

Definition at line 87 of file commoditycashflow.hpp.

87{ return useFuturePrice_; }

◆ index()

ext::shared_ptr< CommodityIndex > index ( ) const

Definition at line 89 of file commoditycashflow.hpp.

89{ return index_; };

◆ fxIndex()

ext::shared_ptr< FxIndex > fxIndex ( ) const

Definition at line 90 of file commoditycashflow.hpp.

90{ return fxIndex_; }
+ Here is the caller graph for this function:

◆ indices()

virtual const std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > & indices ( ) const
pure virtual

Return a map of pricing date and corresponding commodity index.

Implemented in CommodityIndexedAverageCashFlow, and CommodityIndexedCashFlow.

◆ lastPricingDate()

virtual QuantLib::Date lastPricingDate ( ) const
pure virtual

◆ periodQuantity()

virtual QuantLib::Real periodQuantity ( ) const
pure virtual

◆ fixing()

virtual QuantLib::Real fixing ( ) const
pure virtual

◆ accept()

void accept ( QuantLib::AcyclicVisitor &  v)
override

Definition at line 30 of file commoditycashflow.cpp.

30 {
31 if (QuantLib::Visitor<CommodityCashFlow>* v1 = dynamic_cast<QuantLib::Visitor<CommodityCashFlow>*>(&v))
32 v1->visit(*this);
33 else
34 CashFlow::accept(v);
35}

Member Data Documentation

◆ quantity_

QuantLib::Real quantity_
protected

Definition at line 104 of file commoditycashflow.hpp.

◆ spread_

QuantLib::Real spread_
protected

Definition at line 105 of file commoditycashflow.hpp.

◆ gearing_

QuantLib::Real gearing_
protected

Definition at line 106 of file commoditycashflow.hpp.

◆ useFuturePrice_

bool useFuturePrice_
protected

Definition at line 107 of file commoditycashflow.hpp.

◆ index_

ext::shared_ptr<CommodityIndex> index_
protected

Definition at line 108 of file commoditycashflow.hpp.

◆ fxIndex_

ext::shared_ptr<FxIndex> fxIndex_
protected

Definition at line 109 of file commoditycashflow.hpp.

◆ amount_

QuantLib::Real amount_
mutableprotected

Definition at line 110 of file commoditycashflow.hpp.