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

QuantLib::Instrument Class Reference

#include <instrument.hpp>

Inheritance diagram for QuantLib::Instrument:

QuantLib::LazyObject QuantLib::Observable QuantLib::Observer QuantLib::Bond QuantLib::CapFloor QuantLib::CompositeInstrument QuantLib::Forward QuantLib::Option QuantLib::Stock QuantLib::Swap QuantLib::VarianceSwap

List of all members.

Detailed Description

Abstract instrument class.

This class is purely abstract and defines the interface of concrete instruments which will be derived from this one.

observability of class instances is checked.

Definition at line 41 of file instrument.hpp.

Public Member Functions

virtual void fetchResults (const Results *) const
void notifyObservers ()
void registerWith (const boost::shared_ptr< Observable > &)
virtual void setupArguments (Arguments *) const
void unregisterWith (const boost::shared_ptr< Observable > &)
Real errorEstimate () const
 returns the error estimate on the NPV when available.
virtual bool isExpired () const =0
 returns whether the instrument is still tradable.
Real NPV () const
 returns the net present value of the instrument.
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 ()
void setPricingEngine (const boost::shared_ptr< PricingEngine > &)
 set the pricing engine to be used.
Observer interface
void update ()

Protected Member Functions

void calculate () const
virtual void performCalculations () const
virtual void setupExpired () const

Protected Attributes

bool calculated_
boost::shared_ptr< PricingEngineengine_
bool frozen_
The value of this attribute and any other that derived classes might declare must be set during calculation.

Real errorEstimate_
Real NPV_

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

Generated by  Doxygen 1.6.0   Back to index