Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ObserverPool Class Reference

List of observers. More...

#include <arcane/core/ObserverPool.h>

Collaboration diagram for Arcane::ObserverPool:

Public Types

typedef Collection< IObserver * > ObserverCollection

Public Member Functions

 ObserverPool ()
 Constructor.
 ~ObserverPool ()
 Frees resources.
template<class T>
void addObserver (T *obj, void(T::*func)(const IObservable &), IObservable *oba)
 Adds an observer.
template<class T>
void addObserver (T *obj, void(T::*func)(), IObservable *oba)
 Adds an observer.
ObserverCollection observers ()
 List of observers.
void detachAll ()
 Detaches all observers (also detaches them in the process).

Private Attributes

List< IObserver * > m_observers
 List of observers.

Detailed Description

List of observers.

This class allows managing a list of observers and ensuring their destruction when the observer's target object is destroyed.

Definition at line 37 of file ObserverPool.h.

Member Typedef Documentation

◆ ObserverCollection

typedef Collection<IObserver*> Arcane::ObserverPool::ObserverCollection

Definition at line 41 of file ObserverPool.h.

Constructor & Destructor Documentation

◆ ObserverPool()

Arcane::ObserverPool::ObserverPool ( )
inline

Constructor.

Definition at line 46 of file ObserverPool.h.

◆ ~ObserverPool()

Arcane::ObserverPool::~ObserverPool ( )

Frees resources.

Definition at line 29 of file ObserverPool.cc.

References m_observers.

Member Function Documentation

◆ addObserver() [1/2]

template<class T>
void Arcane::ObserverPool::addObserver ( T * obj,
void(T::* func )(),
IObservable * oba )
inline

Adds an observer.

Definition at line 62 of file ObserverPool.h.

References Arcane::IObservable::attachObserver(), and m_observers.

Here is the call graph for this function:

◆ addObserver() [2/2]

template<class T>
void Arcane::ObserverPool::addObserver ( T * obj,
void(T::* func )(const IObservable &),
IObservable * oba )
inline

Adds an observer.

Definition at line 53 of file ObserverPool.h.

References Arcane::IObservable::attachObserver(), and m_observers.

Here is the call graph for this function:

◆ detachAll()

void Arcane::ObserverPool::detachAll ( )

Detaches all observers (also detaches them in the process).

Definition at line 35 of file ObserverPool.cc.

References m_observers.

◆ observers()

ObserverCollection Arcane::ObserverPool::observers ( )
inline

List of observers.

Definition at line 70 of file ObserverPool.h.

References m_observers.

Member Data Documentation

◆ m_observers

List<IObserver*> Arcane::ObserverPool::m_observers
private

List of observers.

Definition at line 77 of file ObserverPool.h.

Referenced by addObserver(), addObserver(), detachAll(), observers(), and ~ObserverPool().


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