ReFRACtor
|
Simple Mixin to be and Observer of another object of class T. More...
#include <observer.h>
Public Member Functions | |
Observer () | |
virtual | ~Observer () |
virtual void | notify_add (T &Observed_object) |
Called when an object is added to an Observable. More... | |
virtual void | notify_add () |
virtual void | notify_remove (T &Observed_object) |
Called when an object is removed from an Observable. More... | |
virtual void | notify_remove () |
virtual void | notify_update (const T &Observed_object) |
Called when the Observed object is updated. More... | |
Friends | |
class | Observable< T > |
Simple Mixin to be and Observer of another object of class T.
We get notified when the other object is updated.
A note on lifetime of objects. When an Observer is destroyed, nothing special needs to be done. The Observable is automatically notified that the Object no longer exists, and shouldn't receive notify_update messages anymore. Likewise, nothing special happens when the Observable is destroyed, this Observe simple receives no more messages from that Observable since it never changes after it is dead.
The relationship between Observer and Observable is m to n, a Observer can be attached to any number of Observables, and likewise an Observable can have any number of Observers attached.
Definition at line 29 of file observer.h.
|
inline |
Definition at line 31 of file observer.h.
|
inlinevirtual |
Definition at line 34 of file observer.h.
|
inlinevirtual |
Called when an object is added to an Observable.
Default is to do nothing.
Reimplemented in FullPhysics::AtmosphereOco, and FullPhysics::SubStateVectorObserver.
Definition at line 47 of file observer.h.
|
inlinevirtual |
Definition at line 48 of file observer.h.
|
inlinevirtual |
Called when an object is removed from an Observable.
Default is to do nothing.
Reimplemented in FullPhysics::AtmosphereOco, and FullPhysics::SubStateVectorObserver.
Definition at line 55 of file observer.h.
|
inlinevirtual |
Definition at line 56 of file observer.h.
|
inlinevirtual |
Called when the Observed object is updated.
Reimplemented in FullPhysics::AtmosphereOco, FullPhysics::AtmosphereOco, FullPhysics::AtmosphereOco, FullPhysics::AbsorberAbsco, FullPhysics::LRadRt, FullPhysics::AbsorberAbsco, FullPhysics::AbsorberAbsco, FullPhysics::AbsorberAbsco, FullPhysics::IlsInstrument, FullPhysics::AerosolOptical, FullPhysics::IlsInstrument, FullPhysics::RadianceScalingSvFit, FullPhysics::AerosolOptical, FullPhysics::AltitudeHydrostatic, FullPhysics::AerosolOptical, FullPhysics::AbsorberAbsco, FullPhysics::AltitudeHydrostatic, FullPhysics::HighResSpectrumOutput, FullPhysics::IlsConvolution, FullPhysics::OutputHdfIteration, FullPhysics::HighResSpectrumOutput, FullPhysics::SpurrRt, FullPhysics::ChapmanBoaRT, FullPhysics::RadiantDriver, FullPhysics::AerosolOptical, FullPhysics::ConnorIterationLog, FullPhysics::SolverIterationLog, FullPhysics::Rayleigh, FullPhysics::Rayleigh, FullPhysics::LogTiming, and FullPhysics::SubStateVectorObserver.
Definition at line 40 of file observer.h.
|
friend |
Definition at line 62 of file observer.h.