QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
base class for commodity indexes More...
#include <commodityindex.hpp>
Public Member Functions | |
CommodityIndex (const std::string &name, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure, Calendar calendar, Real lotQuantity, ext::shared_ptr< CommodityCurve > forwardCurve, ext::shared_ptr< ExchangeContracts > exchangeContracts, int nearbyOffset) | |
Index interface | |
std::string | name () const |
Observer interface | |
void | update () override |
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 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 |
base class for commodity indexes
Definition at line 35 of file commodityindex.hpp.
CommodityIndex | ( | const std::string & | name, |
CommodityType | commodityType, | ||
Currency | currency, | ||
UnitOfMeasure | unitOfMeasure, | ||
Calendar | calendar, | ||
Real | lotQuantity, | ||
ext::shared_ptr< CommodityCurve > | forwardCurve, | ||
ext::shared_ptr< ExchangeContracts > | exchangeContracts, | ||
int | nearbyOffset | ||
) |
std::string name | ( | ) | const |
|
overridevirtual |
This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.
Implements Observer.
Definition at line 108 of file commodityindex.hpp.
const CommodityType & commodityType | ( | ) | const |
Definition at line 116 of file commodityindex.hpp.
const Currency & currency | ( | ) | const |
Definition at line 124 of file commodityindex.hpp.
const UnitOfMeasure & unitOfMeasure | ( | ) | const |
Definition at line 120 of file commodityindex.hpp.
const Calendar & calendar | ( | ) | const |
const ext::shared_ptr< CommodityCurve > & forwardCurve | ( | ) | const |
Definition at line 137 of file commodityindex.hpp.
Real lotQuantity | ( | ) | const |
Definition at line 132 of file commodityindex.hpp.
Definition at line 156 of file commodityindex.hpp.
Date lastQuoteDate | ( | ) | const |
void clearQuotes | ( | ) | const |
returns TRUE if the quote date is valid
Definition at line 197 of file commodityindex.hpp.
bool empty | ( | ) | const |
bool forwardCurveEmpty | ( | ) | const |
Definition at line 177 of file commodityindex.hpp.
const TimeSeries< Real > & quotes | ( | ) | const |
|
friend |
Definition at line 54 of file commodityindex.cpp.
|
protected |
Definition at line 88 of file commodityindex.hpp.
|
protected |
Definition at line 89 of file commodityindex.hpp.
|
protected |
Definition at line 90 of file commodityindex.hpp.
|
protected |
Definition at line 91 of file commodityindex.hpp.
|
protected |
Definition at line 92 of file commodityindex.hpp.
|
protected |
Definition at line 93 of file commodityindex.hpp.
|
protected |
Definition at line 94 of file commodityindex.hpp.
|
protected |
Definition at line 95 of file commodityindex.hpp.
|
protected |
Definition at line 96 of file commodityindex.hpp.
|
protected |
Definition at line 97 of file commodityindex.hpp.
|
protected |
Definition at line 98 of file commodityindex.hpp.