Public Member Functions

Notifier< T > Class Template Reference

class to help setup a callback handling. More...

Inheritance diagram for Notifier< T >:
i_Notifier NotifierAccess

List of all members.

Public Member Functions

void trigger (T &t)
 Notifier (T *c)
void trigger (CallBacker *c=0, CallBacker *exclude=0)

Detailed Description

template<class T>
class Notifier< T >

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.


Constructor & Destructor Documentation

template<class T>
Notifier< T >::Notifier ( T *  c  )  [inline]

Member Function Documentation

template<class T>
void Notifier< T >::trigger ( T &  t  )  [inline]
template<class T>
void Notifier< T >::trigger ( CallBacker c = 0,
CallBacker exclude = 0 
) [inline]