|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
38 #ifndef OGDF_MEMORY_POOL_NTS
52 template<
typename TObserved,
typename TObserver>
80 m_itObsList = obs->registerObserver(
dynamic_cast<TObserver*
>(
this));
103 template<
typename TObserver,
typename TObserved>
107 #ifndef OGDF_MEMORY_POOL_NTS
141 #ifndef OGDF_MEMORY_POOL_NTS
154 #ifndef OGDF_MEMORY_POOL_NTS
166 obs->reregister(
nullptr);
The namespace for all OGDF objects.
const TObserved * getObserved() const
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Utility macros for declaring copy and move constructors and assignment operations.
const_reference back() const
Returns a const reference to the last element.
ListPure< TObserver * >::iterator registerObserver(TObserver *obs) const
Registers an observer.
void reregister(const TObserved *obs)
Associates observer instance with instance obs.
#define OGDF_NO_MOVE(cls)
Explicitly disables (deletes) move construction and assignment for class cls.
const TObserved * m_pObserved
void unregisterObserver(typename ListPure< TObserver * >::iterator it) const
Unregisters an observer.
Base class for an observable object that can be tracked by multiple Observer objects.
const ListPure< TObserver * > & getObservers() const
Observer()=default
Constructs instance of Observer class.
#define OGDF_NO_COPY(cls)
Explicitly disables (deletes) copy construction and assignment for class cls.
ListPure< TObserver * >::iterator m_itObsList
watched instance
Base class for an observer for a single Observable object.
Basic declarations, included by all source files.
virtual ~Observer()
Destroys the instance, unregisters it from watched instance.
Declaration of doubly linked lists and iterators.
const_reference front() const
Returns a const reference to the first element.
virtual void registrationChanged(const TObserved *old)
Called after reregister() changed the observed instance.
std::mutex m_mutexRegArrays
The critical section for protecting shared access to register/unregister methods.
ListPure< TObserver * > m_regObservers
The registered observers.
void del(iterator it)
Removes it from the list.
bool empty() const
Returns true iff the list is empty.
iterator pushBack(const E &x)
Adds element x at the end of the list.