Inviwo  0.9.10.1
Inviwo documentation
inviwo::Observer Class Reference

#include <observer.h>

+ Inheritance diagram for inviwo::Observer:

Public Member Functions

 Observer (const Observer &other)
 
 Observer (Observer &&other)
 
Observeroperator= (Observer &&other)
 
Observeroperator= (const Observer &other)
 
virtual ~Observer ()
 
void removeObservation (ObservableInterface *observable)
 
void removeObservations ()
 

Protected Types

using ObservableSet = std::unordered_set< ObservableInterface * >
 

Protected Member Functions

void addObservation (ObservableInterface *observable)
 

Protected Attributes

ObservableSet observables_
 

Friends

class ObservableInterface
 

Detailed Description

Class to support observer pattern. An example of usage is given in the Observable class.

See also
Observable

Constructor & Destructor Documentation

◆ ~Observer()

inviwo::Observer::~Observer ( )
virtual

Removes the observer from all observable objects. Makes sure that it cannot be called when destroyed.

Member Function Documentation

◆ addObservation()

void inviwo::Observer::addObservation ( ObservableInterface observable)
protected

Add an object to observe.

Parameters
observableThe observable to add.

◆ removeObservation()

void inviwo::Observer::removeObservation ( ObservableInterface observable)

Stop observing object by removing it from observation list.

Parameters
observable(ObservableInterface *) The observable to stop observing.

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