QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CompositeQuote< BinaryFunction > Class Template Reference

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

#include <compositequote.hpp>

+ Inheritance diagram for CompositeQuote< BinaryFunction >:
+ Collaboration diagram for CompositeQuote< BinaryFunction >:

Public Member Functions

 CompositeQuote (Handle< Quote > element1, Handle< Quote > element2, const BinaryFunction &f)
 
inspectors
Real value1 () const
 
Real value2 () const
 
Quote interface
Real value () const override
 returns the current value More...
 
bool isValid () const override
 returns true if the Quote holds a valid value More...
 
- Public Member Functions inherited from Quote
 ~Quote () override=default
 
virtual Real value () const =0
 returns the current value More...
 
virtual bool isValid () const =0
 returns true if the Quote holds a valid value More...
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (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 ()
 

Observer interface

Handle< Quoteelement1_
 
Handle< Quoteelement2_
 
BinaryFunction f_
 
void update () override
 

Additional Inherited Members

- Public Types inherited from Observer
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.

Definition at line 40 of file compositequote.hpp.

Constructor & Destructor Documentation

◆ CompositeQuote()

CompositeQuote ( Handle< Quote element1,
Handle< Quote element2,
const BinaryFunction &  f 
)

Definition at line 73 of file compositequote.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ value1()

Real value1 ( ) const

Definition at line 45 of file compositequote.hpp.

◆ value2()

Real value2 ( ) const

Definition at line 46 of file compositequote.hpp.

◆ value()

Real value ( ) const
overridevirtual

returns the current value

Implements Quote.

Definition at line 82 of file compositequote.hpp.

◆ isValid()

bool isValid ( ) const
overridevirtual

returns true if the Quote holds a valid value

Implements Quote.

Definition at line 88 of file compositequote.hpp.

◆ update()

void update ( )
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 94 of file compositequote.hpp.

Member Data Documentation

◆ element1_

Handle<Quote> element1_
private

Definition at line 58 of file compositequote.hpp.

◆ element2_

Handle<Quote> element2_
private

Definition at line 58 of file compositequote.hpp.

◆ f_

BinaryFunction f_
private

Definition at line 59 of file compositequote.hpp.