Helper class to implement callbacks with lifetime management. More...
#include <notifier.hpp>

Public Types | |
| typedef FUNCTOR | tfunctor |
Public Member Functions | |
| tnotifier () | |
| ~tnotifier () | |
| void | connect_notifiee (tnotifiee< tfunctor > ¬ifiee, tfunctor functor) |
| Connects a callback. | |
| void | disconnect_notifiee (tnotifiee< tfunctor > ¬ifiee) |
| Disonnects a callback. | |
| const std::map< tnotifiee < tfunctor > *, tfunctor > & | notifiees () const |
Private Attributes | |
| std::map< tnotifiee< tfunctor > *, tfunctor > | notifiees_ |
| List of registered callbacks. | |
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 32 of file notifier.hpp.
| typedef FUNCTOR gui2::tnotifier< FUNCTOR >::tfunctor |
Definition at line 25 of file notifier.hpp.
| gui2::tnotifier< FUNCTOR >::tnotifier | ( | ) | [inline] |
Definition at line 27 of file notifier.hpp.
Referenced by gui2::tnotifier< tfunctor >::~tnotifier().

| gui2::tnotifier< FUNCTOR >::~tnotifier | ( | ) | [inline] |
Definition at line 32 of file notifier.hpp.
Referenced by gui2::tnotifier< tfunctor >::~tnotifier().

| void gui2::tnotifier< FUNCTOR >::connect_notifiee | ( | tnotifiee< tfunctor > & | notifiee, | |
| tfunctor | functor | |||
| ) | [inline] |
Connects a callback.
| notifiee | The notifiee controlling the lifetime of the callback. | |
| functor | The callback to call. |
Definition at line 50 of file notifier.hpp.
| void gui2::tnotifier< FUNCTOR >::disconnect_notifiee | ( | tnotifiee< tfunctor > & | notifiee | ) | [inline] |
Disonnects a callback.
| notifiee | The notifiee controlling the lifetime of the callback. Uses since its address is an unique key. |
Definition at line 68 of file notifier.hpp.
Referenced by gui2::tnotifiee< tfunctor >::~tnotifiee().

| const std::map<tnotifiee<tfunctor>*, tfunctor>& gui2::tnotifier< FUNCTOR >::notifiees | ( | ) | const [inline] |
Definition at line 85 of file notifier.hpp.
std::map<tnotifiee<tfunctor>*, tfunctor> gui2::tnotifier< FUNCTOR >::notifiees_ [private] |
List of registered callbacks.
Definition at line 93 of file notifier.hpp.
Referenced by gui2::tnotifier< tfunctor >::disconnect_notifiee(), and gui2::tnotifier< tfunctor >::~tnotifier().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:21:50 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |