QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
Observer Class Referenceabstract

Object that gets notified when a given observable changes. More...

#include <ql/patterns/observable.hpp>

+ Inheritance diagram for Observer:
+ Collaboration diagram for Observer:

Public Types

typedef set_type::iterator iterator
 

Public Member Functions

 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 ()
 

Private Types

typedef std::set< ext::shared_ptr< Observable > > set_type
 

Private Attributes

set_type observables_
 

Detailed Description

Object that gets notified when a given observable changes.

Definition at line 116 of file observable.hpp.

Member Typedef Documentation

◆ set_type

typedef std::set<ext::shared_ptr<Observable> > set_type
private

Definition at line 118 of file observable.hpp.

◆ iterator

typedef set_type::iterator iterator

Definition at line 120 of file observable.hpp.

Constructor & Destructor Documentation

◆ Observer() [1/2]

Observer ( )
default

◆ Observer() [2/2]

Observer ( const Observer o)

Definition at line 207 of file observable.hpp.

◆ ~Observer()

~Observer ( )
virtual

Definition at line 222 of file observable.hpp.

Member Function Documentation

◆ operator=()

Observer & operator= ( const Observer o)

Definition at line 213 of file observable.hpp.

◆ registerWith()

std::pair< Observer::iterator, bool > registerWith ( const ext::shared_ptr< Observable > &  h)

Definition at line 228 of file observable.hpp.

+ Here is the caller graph for this function:

◆ registerWithObservables()

void registerWithObservables ( const ext::shared_ptr< Observer > &  o)

register with all observables of a given observer. Note that this does not include registering with the observer itself.

Definition at line 237 of file observable.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterWith()

Size unregisterWith ( const ext::shared_ptr< Observable > &  h)

Definition at line 245 of file observable.hpp.

+ Here is the caller graph for this function:

◆ unregisterWithAll()

void unregisterWithAll ( )

Definition at line 251 of file observable.hpp.

◆ update()

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

Implemented in CappedFlooredYoYInflationCoupon, FloatingRateCouponPricer, EquityCashFlowPricer, InflationCouponPricer, CommodityIndex, BaseCorrelationLossModel< BaseModel_T, Corr2DInt_T >, BaseCorrelationTermStructure< Interpolator2D_T >, Basket, DefaultLatentModel< copulaPolicy >, GaussianLHPLossModel, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, RandomDefaultModel, ConstantRecoveryModel, AssetSwapHelper, DeltaVolQuote, PiecewiseYoYOptionletVolatilityCurve< Interpolator, Bootstrap, Traits >, InterpolatedYoYCapFloorTermPriceSurface< Interpolator2D, Interpolator1D >, LatentModel< copulaPolicyImpl >, LatentModel< copulaPolicy >, LatentModel< GaussianCopulaPolicy >, AbcdAtmVolCurve, ExtendedBlackVarianceCurve, ExtendedBlackVarianceSurface, NoArbSabrInterpolatedSmileSection, SabrVolSurface, SviInterpolatedSmileSection, ZabrInterpolatedSmileSection< Evaluation >, Handle< T >::Link, EquityIndex, InflationIndex, InterestRateIndex, RendistatoBasket, Claim, CotSwapToFwdAdapterFactory, FlatVolFactory, FwdToCotSwapAdapterFactory, CalibratedModel, Gsr, Gsr::VolatilityObserver, Gsr::ReversionObserver, MarkovFunctional, LazyObject, GenericEngine< ArgumentsType, ResultsType >, GenericEngine< VanillaOption::arguments, VanillaOption::results >, GenericEngine< CapFloor::arguments, CapFloor::results >, GenericEngine< ForwardOptionArguments< VanillaOption::arguments >, VanillaOption::results >, GenericEngine< BarrierOption::arguments, BarrierOption::results >, GenericEngine< BasketOption::arguments, BasketOption::results >, GenericEngine< Bond::arguments, Bond::results >, GenericEngine< CPICapFloor::arguments, CPICapFloor::results >, GenericEngine< CPISwap::arguments, CPISwap::results >, GenericEngine< CallableBond::arguments, CallableBond::results >, GenericEngine< CatBond::arguments, CatBond::results >, GenericEngine< CdsOption::arguments, CdsOption::results >, GenericEngine< CliquetOption::arguments, CliquetOption::results >, GenericEngine< ComplexChooserOption::arguments, ComplexChooserOption::results >, GenericEngine< CompoundOption::arguments, CompoundOption::results >, GenericEngine< ContinuousAveragingAsianOption::arguments, ContinuousAveragingAsianOption::results >, GenericEngine< ContinuousFixedLookbackOption::arguments, ContinuousFixedLookbackOption::results >, GenericEngine< ContinuousFloatingLookbackOption::arguments, ContinuousFloatingLookbackOption::results >, GenericEngine< ContinuousPartialFixedLookbackOption::arguments, ContinuousPartialFixedLookbackOption::results >, GenericEngine< ContinuousPartialFloatingLookbackOption::arguments, ContinuousPartialFloatingLookbackOption::results >, GenericEngine< ConvertibleBond::arguments, ConvertibleBond::results >, GenericEngine< CreditDefaultSwap::arguments, CreditDefaultSwap::results >, GenericEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveragingAsianOption::results >, GenericEngine< DividendBarrierOption::arguments, DividendBarrierOption::results >, GenericEngine< DividendVanillaOption::arguments, DividendVanillaOption::results >, GenericEngine< DoubleBarrierOption::arguments, DoubleBarrierOption::results >, GenericEngine< VanillaVPPOption::arguments, VanillaVPPOption::results >, GenericEngine< EnergyCommodity::arguments, EnergyCommodity::results >, GenericEngine< EverestOption::arguments, EverestOption::results >, GenericEngine< Swaption::arguments, Swaption::results >, GenericEngine< VanillaSwingOption::arguments, VanillaSwingOption::results >, GenericEngine< VanillaStorageOption::arguments, VanillaStorageOption::results >, GenericEngine< FixedVsFloatingSwap::arguments, FixedVsFloatingSwap::results >, GenericEngine< FloatFloatSwap::arguments, FloatFloatSwap::results >, GenericEngine< FloatFloatSwaption::arguments, FloatFloatSwaption::results >, GenericEngine< NonstandardSwaption::arguments, NonstandardSwaption::results >, GenericEngine< IrregularSwaption::arguments, IrregularSwaption::results >, GenericEngine< HimalayaOption::arguments, HimalayaOption::results >, GenericEngine< HolderExtensibleOption::arguments, HolderExtensibleOption::results >, GenericEngine< IrregularSwap::arguments, IrregularSwap::results >, GenericEngine< Arguments, Results >, GenericEngine< MargrabeOption::arguments, MargrabeOption::results >, GenericEngine< MultiAssetOption::arguments, MultiAssetOption::results >, GenericEngine< NonstandardSwap::arguments, NonstandardSwap::results >, GenericEngine< NthToDefault::arguments, NthToDefault::results >, GenericEngine< OneAssetOption::arguments, OneAssetOption::results >, GenericEngine< PagodaOption::arguments, PagodaOption::results >, GenericEngine< PartialTimeBarrierOption::arguments, PartialTimeBarrierOption::results >, GenericEngine< PathMultiAssetOption::arguments, PathMultiAssetOption::results >, GenericEngine< Instr::arguments, QuantoOptionResults< Instr::results > >, GenericEngine< SimpleChooserOption::arguments, SimpleChooserOption::results >, GenericEngine< SpreadOption::arguments, SpreadOption::results >, GenericEngine< Swap::arguments, Swap::results >, GenericEngine< SyntheticCDO::arguments, SyntheticCDO::results >, GenericEngine< VanillaSwap::arguments, VanillaSwap::results >, GenericEngine< TwoAssetBarrierOption::arguments, TwoAssetBarrierOption::results >, GenericEngine< TwoAssetCorrelationOption::arguments, TwoAssetCorrelationOption::results >, GenericEngine< VarianceOption::arguments, VarianceOption::results >, GenericEngine< VarianceSwap::arguments, VarianceSwap::results >, GenericEngine< WriterExtensibleOption::arguments, WriterExtensibleOption::results >, GenericEngine< YearOnYearInflationSwap::arguments, YearOnYearInflationSwap::results >, GenericEngine< YoYInflationCapFloor::arguments, YoYInflationCapFloor::results >, GenericEngine< ZeroCouponInflationSwap::arguments, ZeroCouponInflationSwap::results >, LatticeShortRateModelEngine< Arguments, Results >, LatticeShortRateModelEngine< CallableBond::arguments, CallableBond::results >, LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results >, LatticeShortRateModelEngine< Swaption::arguments, Swaption::results >, LatticeShortRateModelEngine< VanillaSwap::arguments, VanillaSwap::results >, AnalyticHestonHullWhiteEngine, COSHestonEngine, FdHestonHullWhiteVanillaEngine, FdHestonVanillaEngine, GeneralizedBlackScholesProcess, HestonSLVProcess, HybridHestonHullWhiteProcess, JointStochasticProcess, CompositeQuote< BinaryFunction >, DerivedQuote< UnaryFunction >, ForwardSwapQuote, ForwardValueQuote, FuturesConvAdjustmentQuote, LastFixingQuote, StochasticProcess, TermStructure, BootstrapHelper< TS >, BootstrapHelper< YoYInflationTermStructure >, BootstrapHelper< YoYOptionletVolatilitySurface >, BootstrapHelper< ZeroInflationTermStructure >, RelativeDateBootstrapHelper< TS >, CdsHelper, PiecewiseDefaultCurve< Traits, Interpolator, Bootstrap >, DefaultProbabilityTermStructure, PiecewiseYoYInflationCurve< Interpolator, Bootstrap, Traits >, PiecewiseZeroInflationCurve< Interpolator, Bootstrap, Traits >, CapFloorTermVolCurve, CapFloorTermVolSurface, GridModelLocalVolSurface, InterpolatedSmileSection< Interpolator >, StrippedOptionletAdapter, SabrInterpolatedSmileSection, SmileSection, SpreadedSmileSection, CmsMarket, XabrSwaptionVolatilityCube< Model >::PrivateObserver, SwaptionVolatilityDiscrete, CompositeZeroYieldStructure< BinaryFunction >, FittedBondDiscountCurve, FlatForward, ForwardSpreadedTermStructure, PiecewiseYieldCurve< Traits, Interpolator, Bootstrap >, InterpolatedPiecewiseZeroSpreadedTermStructure< Interpolator >, UltimateForwardTermStructure, ZeroSpreadedTermStructure, and YieldTermStructure.

+ Here is the caller graph for this function:

◆ deepUpdate()

void deepUpdate ( )
virtual

This method allows to explicitly update the instance itself and nested observers. If notifications are disabled a call to this method ensures an update of such nested observers. It should be implemented in derived classes whenever applicable

Reimplemented in CappedFlooredCoupon, DigitalCoupon, StrippedCappedFlooredCoupon, Bond, CapFloor, CompositeInstrument, Swap, Swaption, and StrippedOptionletAdapter.

Definition at line 257 of file observable.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ observables_

set_type observables_
private

Definition at line 155 of file observable.hpp.