QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Object that gets notified when a given observable changes. More...
#include <observable.hpp>
Public Types | |
typedef set_type::iterator | iterator |
Public Member Functions | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~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 | update ()=0 |
virtual void | deepUpdate () |
Private Types | |
typedef std::set< ext::shared_ptr< Observable > > | set_type |
Private Attributes | |
set_type | observables_ |
Object that gets notified when a given observable changes.
Definition at line 116 of file observable.hpp.
|
private |
Definition at line 118 of file observable.hpp.
typedef set_type::iterator iterator |
Definition at line 120 of file observable.hpp.
|
default |
Definition at line 207 of file observable.hpp.
|
virtual |
Definition at line 222 of file observable.hpp.
Definition at line 213 of file observable.hpp.
std::pair< Observer::iterator, bool > registerWith | ( | const ext::shared_ptr< Observable > & | h | ) |
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.
Size unregisterWith | ( | const ext::shared_ptr< Observable > & | h | ) |
void unregisterWithAll | ( | ) |
Definition at line 251 of file observable.hpp.
|
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< 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.
|
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.
|
private |
Definition at line 155 of file observable.hpp.