class to help setup a callback handling. More...
Public Member Functions | |
| void | trigger (T &t) |
| Notifier (T *c) | |
| void | trigger (CallBacker *c=0, CallBacker *exclude=0) |
class to help setup a callback handling.
What we have discovered is that the two things:
Simply declare a Notifier<T> in the interface, like:
Notifier<MyClass> buttonclicked;
Then users of the class can issue:
amyclass.buttonclicked.notify( mCB(this,TheClassOfThis,theMethodToBeCalled) );
The callback is issued when you call the trigger() method, like:
buttonclicked.trigger();
The notification can be temporary stopped using disable()/enable() pair, or by use of a NotifyStopper, which automatically restores the callback when going out of scope.
| void Notifier< T >::trigger | ( | T & | t | ) | [inline] |
| void Notifier< T >::trigger | ( | CallBacker * | c = 0, |
|
| CallBacker * | exclude = 0 | |||
| ) | [inline] |
1.7.1