QuantLib
A free/open-source library for quantitative finance
Fully annotated sources - version 1.22
Public Member Functions | Protected Attributes | List of all members
GenericEngine< ArgumentsType, ResultsType > Class Template Reference

template base class for option pricing engines More...

#include <ql/pricingengine.hpp>

+ Inheritance diagram for GenericEngine< ArgumentsType, ResultsType >:
+ Collaboration diagram for GenericEngine< ArgumentsType, ResultsType >:

Public Member Functions

PricingEngine::argumentsgetArguments () const override
 
const PricingEngine::resultsgetResults () const override
 
void reset () override
 
void update () override
 
- Public Member Functions inherited from PricingEngine
 ~PricingEngine () override=default
 
virtual void calculate () const =0
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
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 deepUpdate ()
 

Protected Attributes

ArgumentsType arguments_
 
ResultsType results_
 

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 ArgumentsType, class ResultsType>
class QuantLib::GenericEngine< ArgumentsType, ResultsType >

template base class for option pricing engines

Derived engines only need to implement the calculate() method.

Definition at line 63 of file pricingengine.hpp.

Member Function Documentation

◆ getArguments()

PricingEngine::arguments* getArguments ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 66 of file pricingengine.hpp.

+ Here is the caller graph for this function:

◆ getResults()

const PricingEngine::results* getResults ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 67 of file pricingengine.hpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( )
overridevirtual

Implements PricingEngine.

Definition at line 68 of file pricingengine.hpp.

+ Here is the caller graph for this function:

◆ 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.

Reimplemented in LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results >, LatticeShortRateModelEngine< VanillaSwap::arguments, VanillaSwap::results >, LatticeShortRateModelEngine< Swaption::arguments, Swaption::results >, and LatticeShortRateModelEngine< CallableBond::arguments, CallableBond::results >.

Definition at line 69 of file pricingengine.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ arguments_

ArgumentsType arguments_
mutableprotected

Definition at line 72 of file pricingengine.hpp.

◆ results_

ResultsType results_
mutableprotected

Definition at line 73 of file pricingengine.hpp.