Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

QuantLib::EnergyCommodity Class Reference

#include <energycommodity.hpp>

Inheritance diagram for QuantLib::EnergyCommodity:

QuantLib::Commodity QuantLib::Instrument QuantLib::LazyObject QuantLib::Observable QuantLib::Observer QuantLib::EnergyFuture QuantLib::EnergyBasisSwap QuantLib::EnergyVanillaSwap

List of all members.


Detailed Description

Energy commodity class.

Definition at line 61 of file energycommodity.hpp.


Public Types

enum  DeliverySchedule {
  Constant, Window, Hourly, Daily,
  Weekly, Monthly, Quarterly, Yearly
}
enum  PaymentSchedule { WindowSettlement, MonthlySettlement, QuarterlySettlement, YearlySettlement }
enum  QuantityPeriodicity {
  Absolute, PerHour, PerDay, PerWeek,
  PerMonth, PerQuarter, PerYear
}

Public Member Functions

void addPricingError (PricingError::Level errorLevel, const std::string &error, const std::string &detail="") const
const CommodityTypecommodityType () const
 EnergyCommodity (const CommodityType &commodityType, const boost::shared_ptr< SecondaryCosts > &secondaryCosts)
void fetchResults (const PricingEngine::results *) const
void notifyObservers ()
const PricingErrors & pricingErrors () const
virtual Quantity quantity () const =0
void registerWith (const boost::shared_ptr< Observable > &)
const SecondaryCostAmounts & secondaryCostAmounts () const
const boost::shared_ptr
< SecondaryCosts > & 
secondaryCosts () const
void setupArguments (PricingEngine::arguments *) const
void unregisterWith (const boost::shared_ptr< Observable > &)
Inspectors
const std::map< std::string,
boost::any > & 
additionalResults () const
 returns all additional result returned by the pricing engine.
Real errorEstimate () const
 returns the error estimate on the NPV when available.
virtual bool isExpired () const =0
 returns whether the instrument might have value greater than zero.
Real NPV () const
 returns the net present value of the instrument.
template<typename T>
result (const std::string &tag) const
 returns any additional result returned by the pricing engine.
const DatevaluationDate () const
 returns the date the net present value refers to.
Calculations
These methods do not modify the structure of the object and are therefore declared as const. Data members which will be calculated on demand need to be declared as mutable.

void freeze ()
void recalculate ()
void unfreeze ()
Modifiers
void setPricingEngine (const boost::shared_ptr< PricingEngine > &)
 set the pricing engine to be used.
Observer interface
void update ()

Protected Member Functions

void calculateSecondaryCostAmounts (const CommodityType &commodityType, Real totalQuantityValue, const Date &evaluationDate) const
Real calculateUnitCost (const CommodityType &commodityType, const CommodityUnitCost &unitCost, const Date &evaluationDate) const
Calculations
void calculate () const
virtual void performCalculations () const
virtual void setupExpired () const

Static Protected Member Functions

static Real calculateFxConversionFactor (const Currency &fromCurrency, const Currency &toCurrency, const Date &evaluationDate)
static Real calculateUomConversionFactor (const CommodityType &commodityType, const UnitOfMeasure &fromUnitOfMeasure, const UnitOfMeasure &toUnitOfMeasure)

Protected Attributes

bool calculated_
CommodityType commodityType_
boost::shared_ptr< PricingEngineengine_
bool frozen_
PricingErrors pricingErrors_
SecondaryCostAmounts secondaryCostAmounts_
boost::shared_ptr< SecondaryCosts > secondaryCosts_
Results
The value of this attribute and any other that derived classes might declare must be set during calculation.

std::map< std::string, boost::any > additionalResults_
Real errorEstimate_
Real NPV_
Date valuationDate_

Classes

class  arguments
class  engine
class  results

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index