anatomist  5.1.2
3D neuroimaging data viewer
anatomist::Observer Class Referenceabstract

A class can implement the Observer interface when it wants to be informed of changes in observable objects. More...

#include <anatomist/observer/Observer.h>

Inheritance diagram for anatomist::Observer:

Public Member Functions

virtual ~Observer ()
 
virtual void update (const Observable *observable, void *arg)=0
 This method is called whenever the observed object is changed. More...
 

Protected Member Functions

virtual void cleanupObserver ()
 call this function from inherited classes destructors. More...
 
virtual void registerObservable (Observable *)
 only called by Observable: don't use this function directly More...
 
virtual void unregisterObservable (Observable *)
 Called when an observable is destroyed, only called by Observable: don't use this function directly. More...
 
const std::set< Observable * > & observed () const
 

Friends

class Observable
 

Detailed Description

A class can implement the Observer interface when it wants to be informed of changes in observable objects.

Definition at line 54 of file Observer.h.

Constructor & Destructor Documentation

◆ ~Observer()

virtual anatomist::Observer::~Observer ( )
virtual

Member Function Documentation

◆ cleanupObserver()

virtual void anatomist::Observer::cleanupObserver ( )
protectedvirtual

call this function from inherited classes destructors.

Derived classes may have to manually call it, especially if they have overloaded unregisterObservable() otherwise it may be called by the destructor of a base class which will not be able to access the correct overloaded functions anymore.

It's not an error to call cleanupObserver() several times: basically each destructor in the inheritance tree of a derived class will call it, but only the first call will have any effect.

◆ observed()

const std::set<Observable *>& anatomist::Observer::observed ( ) const
inlineprotected

Definition at line 85 of file Observer.h.

◆ registerObservable()

virtual void anatomist::Observer::registerObservable ( Observable )
protectedvirtual

only called by Observable: don't use this function directly

Reimplemented in anatomist::NormalsSettingsPanel::NormalsObserver.

◆ unregisterObservable()

◆ update()

virtual void anatomist::Observer::update ( const Observable observable,
void *  arg 
)
pure virtual

This method is called whenever the observed object is changed.

The programmer calls an observable object's notifyObservers method to have all the object's observers notified of the change.

Parameters
observablethe observable object

Implemented in anatomist::NormalsSettingsPanel, anatomist::NormalsSettingsPanel::NormalsObserver, anatomist::AWindow, anatomist::AVolumeView< T >, anatomist::Slice, anatomist::ATexture, anatomist::ATexSurface, anatomist::TesselatedMesh, anatomist::ANormalsMesh, anatomist::PlanarFusion3D, anatomist::CutMesh, anatomist::AConnectivityMatrix, anatomist::CommandWriter, anatomist::VolRenderShader, anatomist::VolRender, anatomist::AObject, anatomist::ClippedObject, anatomist::MObject, anatomist::Fusion3D, anatomist::Fusion2D, anatomist::AInterpoler, anatomist::PaintActionSharedData, anatomist::RoiLevelSetActionSharedData, anatomist::ReferentialObserver, anatomist::VectorField, anatomist::AMTexture, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::RoiManagementActionSharedData, Tools3DWindow, LightModelWindow, FixedPointOfViewWindow, VectorFieldEditionWindow, ChooseReferentialWindow, VolRenderPanel, QTextureWin, QTexturePanel, Fusion3DWindow, Fusion2DWindow, anatomist::ConstraintEditorWindow, RenderingWindow, MaterialWindow, QObjectBrowser, PaintActionView, ALandmarkPicker, GraphLandmarkPicker, QSurfMatchWin, QGraphProperties, QAPaletteWin, ErpWraper, RoiManagementActionView, RoiMorphoMathActionView, RoiLevelSetActionView, RoiHistoPlot, RoiDynSegmentActionView, and anatomist::RoiDynSegmentAction.

Friends And Related Function Documentation

◆ Observable

friend class Observable
friend

Definition at line 90 of file Observer.h.


The documentation for this class was generated from the following file: