31 #ifndef __BASE_CALLBACK_HH__
32 #define __BASE_CALLBACK_HH__
63 template <
class T,
void (T::* F)()>
100 std::string
name()
const {
return "CallbackQueue"; }
112 template <
class T,
void (T::* F)()>
119 template <
class T,
void (T::* F)()>
156 #endif // __BASE_CALLBACK_HH__
virtual void process()=0
virtual process function that is invoked when the callback queue is executed.
void process()
process all callbacks
void process()
virtual process function that is invoked when the callback queue is executed.
virtual void autoDestruct()
virtual ~Callback()
virtualize the destructor to make sure that the correct one gets called.
MakeCallback(T &o, bool auto_destroy=false)
bool empty() const
Find out if there are any callbacks in the queue.
void add(Callback *callback)
Add a callback to the end of the queue.
queue callbacks
List of all callbacks.
void clear()
clear the callback queue
Helper template class to turn a simple class member function into a callback.
std::list< Callback * > queue
Simple typedef for the data structure that stores all of the callbacks.
MakeCallback(T *o, bool auto_destroy=false)