Base class for an observer for a single Observable object. More...
#include <ogdf/basic/Observer.h>
Public Member Functions | |
Observer ()=default | |
Constructs instance of Observer class. More... | |
Observer (const Observer ©)=delete | |
If you want to copy a subclass of Observer, call the default Observer() constructor and optionally also call reregister if it makes sense. More... | |
Observer (Observer &&move)=delete | |
If you want to move a subclass of Observer, call the default Observer() constructor and optionally also call reregister if it makes sense. More... | |
virtual | ~Observer () |
Destroys the instance, unregisters it from watched instance. More... | |
const TObserved * | getObserved () const |
Observer & | operator= (const Observer ©)=delete |
Observer & | operator= (Observer &&move)=delete |
virtual void | registrationChanged (const TObserved *old) |
Called after reregister() changed the observed instance. More... | |
void | reregister (const TObserved *obs) |
Associates observer instance with instance obs . More... | |
Private Attributes | |
ListPure< TObserver * >::iterator | m_itObsList |
watched instance More... | |
const TObserved * | m_pObserved = nullptr |
Base class for an observer for a single Observable object.
Will be notified when the observable is destructed and can be subclassed to provide further callbacks. For compatibility with MSVC, the Observer subclass has to be defined before the Observable subclass.
TObserved | The subclass of Observable that will be observed. |
TObserver | The subclass of Observer that defines all virtual callback methods. |
Definition at line 53 of file Observer.h.
|
default |
Constructs instance of Observer class.
|
inlinevirtual |
Destroys the instance, unregisters it from watched instance.
Definition at line 59 of file Observer.h.
|
delete |
If you want to copy a subclass of Observer, call the default Observer() constructor and optionally also call reregister if it makes sense.
|
delete |
If you want to move a subclass of Observer, call the default Observer() constructor and optionally also call reregister if it makes sense.
|
inline |
Definition at line 88 of file Observer.h.
|
delete |
|
delete |
|
inlinevirtual |
Called after reregister() changed the observed instance.
Reimplemented in ogdf::ClusterGraph.
Definition at line 86 of file Observer.h.
|
inline |
Associates observer instance with instance obs
.
Definition at line 73 of file Observer.h.
|
private |
watched instance
Definition at line 92 of file Observer.h.
|
private |
Definition at line 91 of file Observer.h.