Helper class to implement callbacks with lifetime management. More...
#include <notifiee.hpp>
Public Types | |
typedef FUNCTOR | tfunctor |
Public Member Functions | |
tnotifier () | |
~tnotifier () | |
void | connect_notifiee (tnotifiee< tfunctor > ¬ifiee, tfunctor functor) |
Connects a callback. More... | |
void | disconnect_notifiee (tnotifiee< tfunctor > ¬ifiee) |
Disconnects a callback. More... | |
const std::map< tnotifiee < tfunctor > *, tfunctor > & | notifiees () const |
Private Attributes | |
std::map< tnotifiee< tfunctor > *, tfunctor > | notifiees_ |
List of registered callbacks. More... | |
Helper class to implement callbacks with lifetime management.
This part manages the connecting and disconnecting of the callbacks.
Subclasses should implement a way to call all callback.
Definition at line 24 of file notifiee.hpp.
typedef FUNCTOR gui2::tnotifier< FUNCTOR >::tfunctor |
Definition at line 37 of file notifier.hpp.
|
inline |
Definition at line 39 of file notifier.hpp.
|
inline |
Definition at line 43 of file notifier.hpp.
|
inline |
Connects a callback.
notifiee | The notifiee controlling the lifetime of the callback. |
functor | The callback to call. |
Definition at line 61 of file notifier.hpp.
|
inline |
Disconnects a callback.
notifiee | The notifiee controlling the lifetime of the callback. Uses since its address is an unique key. |
Definition at line 77 of file notifier.hpp.
Referenced by gui2::tnotifiee< tfunctor >::~tnotifiee().
|
inline |
Definition at line 94 of file notifier.hpp.
|
private |
List of registered callbacks.
Definition at line 101 of file notifier.hpp.
Referenced by gui2::tnotifier< tfunctor >::connect_notifiee(), gui2::tnotifier< tfunctor >::disconnect_notifiee(), gui2::tnotifier< tfunctor >::notifiees(), and gui2::tnotifier< tfunctor >::~tnotifier().