Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MarketObserver Class Reference

Observer class for Model Builders. More...

#include <qle/models/marketobserver.hpp>

+ Inheritance diagram for MarketObserver:
+ Collaboration diagram for MarketObserver:

Public Member Functions

 MarketObserver ()
 
void addObservable (QuantLib::ext::shared_ptr< Observable > observable)
 Add an observable. More...
 
void update () override
 Observer interface. More...
 
bool hasUpdated (const bool reset)
 Returns true if has been updated, reset updated flag if required. More...
 

Private Attributes

bool updated_
 Flag to indicate if updated. More...
 

Detailed Description

Observer class for Model Builders.

This class holds all observables of a builder, except special ones like vol surfaces that should be handled separately in the builders to determine whether a recalibration of the model is required.

Definition at line 39 of file marketobserver.hpp.

Constructor & Destructor Documentation

◆ MarketObserver()

Definition at line 41 of file marketobserver.hpp.

41: updated_(true){};
bool updated_
Flag to indicate if updated.

Member Function Documentation

◆ addObservable()

void addObservable ( QuantLib::ext::shared_ptr< Observable observable)

Add an observable.

Definition at line 57 of file marketobserver.hpp.

57 {
58 registerWith(observable);
59 updated_ = true;
60}

◆ update()

void update ( )
override

Observer interface.

Definition at line 62 of file marketobserver.hpp.

62 {
63 updated_ = true;
64 notifyObservers();
65};

◆ hasUpdated()

bool hasUpdated ( const bool  reset)

Returns true if has been updated, reset updated flag if required.

Definition at line 67 of file marketobserver.hpp.

67 {
68 if (!reset)
69 return updated_;
70 else {
71 bool upd = updated_;
72 updated_ = false;
73 return upd;
74 }
75}

Member Data Documentation

◆ updated_

bool updated_
private

Flag to indicate if updated.

Definition at line 52 of file marketobserver.hpp.