QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
Public Member Functions | List of all members
CompositeQuote< BinaryFunction > Class Template Reference

market element whose value depends on two other market element More...

#include <ql/quotes/compositequote.hpp>

+ Inheritance diagram for CompositeQuote< BinaryFunction >:

Public Member Functions

 CompositeQuote (const Handle< Quote > &element1, const Handle< Quote > &element2, const BinaryFunction &f)
 
inspectors
Real value1 () const
 
Real value2 () const
 
Quote interface
Real value () const
 returns the current value
 
bool isValid () const
 returns true if the Quote holds a valid value
 
- Public Member Functions inherited from Observable
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer (const Observer &)
 
Observeroperator= (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 ()
 

Observer interface

void update ()
 

Additional Inherited Members

- Public Types inherited from Observer
typedef boost::unordered_set< ext::shared_ptr< Observable > > set_type
 
typedef set_type::iterator iterator
 

Detailed Description

template<class BinaryFunction>
class QuantLib::CompositeQuote< BinaryFunction >

market element whose value depends on two other market element

Tests:
the correctness of the returned values is tested by checking them against numerical calculations.

Member Function Documentation

◆ update()

void update ( )
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.