base class for commodity indexes More...
#include <ql/experimental/commodities/commodityindex.hpp>
Public Member Functions | |
CommodityIndex (const std::string &name, const CommodityType &commodityType, const Currency ¤cy, const UnitOfMeasure &unitOfMeasure, const Calendar &calendar, Real lotQuantity, const ext::shared_ptr< CommodityCurve > &forwardCurve, const ext::shared_ptr< ExchangeContracts > &exchangeContracts, int nearbyOffset) | |
Index interface | |
std::string | name () const |
Observer interface | |
void | update () |
![]() | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
void | notifyObservers () |
![]() | |
Observer (const Observer &) | |
Observer & | operator= (const 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 | deepUpdate () |
Inspectors | |
std::string | name_ |
CommodityType | commodityType_ |
UnitOfMeasure | unitOfMeasure_ |
Currency | currency_ |
Calendar | calendar_ |
Real | lotQuantity_ |
TimeSeries< Real > | quotes_ |
ext::shared_ptr< CommodityCurve > | forwardCurve_ |
Real | forwardCurveUomConversionFactor_ |
ext::shared_ptr< ExchangeContracts > | exchangeContracts_ |
Integer | nearbyOffset_ |
const CommodityType & | commodityType () const |
const Currency & | currency () const |
const UnitOfMeasure & | unitOfMeasure () const |
const Calendar & | calendar () const |
const ext::shared_ptr< CommodityCurve > & | forwardCurve () const |
Real | lotQuantity () const |
Real | price (const Date &date) |
Real | forwardPrice (const Date &date) const |
Date | lastQuoteDate () const |
void | addQuote (const Date "eDate, Real quote) |
void | addQuotes (const std::map< Date, Real > "es) |
void | clearQuotes () const |
bool | isValidQuoteDate (const Date "eDate) const |
returns TRUE if the quote date is valid | |
bool | empty () const |
bool | forwardCurveEmpty () const |
const TimeSeries< Real > & | quotes () const |
std::ostream & | operator<< (std::ostream &, const CommodityIndex &) |
Additional Inherited Members | |
![]() | |
typedef boost::unordered_set< ext::shared_ptr< Observable > > | set_type |
typedef set_type::iterator | iterator |
base class for commodity indexes
|
virtual |
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.