15 #include <boost/shared_ptr.hpp>
16 #include <boost/function.hpp>
18 #include <tbb/spin_mutex.h>
31 template <
typename T_CallbackFunctionType>
75 return !(*
this == rhs);
90 template <
typename T_CallbackArg>
177 void invokeCallbacks();
202 template <
typename Callback>
222 if (myDisconnectFunction)
224 bool value = myDisconnectFunction();
233 template <
typename Callback>
239 : myDisconnectFunction(func) { }
254 template <
typename Callback>
281 void removeCallback(
const boost::function<
bool(
const Callback&)>& removePredicate,
bool* removedLast = 0);
291 template <
typename T1>
294 template <
typename T1,
typename T2>
297 template <
typename T1,
typename T2,
typename T3>
323 #define callbackList_inl_
324 #include "readerWriter/noArgumentCallbackList.inl"
325 #undef callbackList_inl_
void removeAll()
Removes all callbacks that have been registered.
bool isDeleted() const
Definition: noArgumentCallbackList.h:79
DtCallbackConnection addCallback(const Callback &callback, bool *addedFirst=0)
Adds a new callback to the list. A duplicate entry is checked for first, and if found, this new function is not added.
#define DT_DLL_readerWriter
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: readerWriterDefines.h:34
bool operator<(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:57
DtCallbackList()
Default constructor.
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:143
void invokeCallbacks(T_CallbackArg arg)
Invokes all the callbacks currently on the callback list.
bool operator>(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:62
std::set< DtCallbackInfoType > DtCallbackListType
Definition: noArgumentCallbackList.h:138
void setIsDeleted(bool b)
Definition: noArgumentCallbackList.h:78
void removeAll()
Removes all callbacks that have been registered.
void * usrData
Definition: noArgumentCallbackList.h:87
DtCallbackList; DtNoArgumentCallbackList.
Definition: noArgumentCallbackList.h:32
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:312
Represents the connection of a specific callback to a DtCallbackListT. Saving a DtCallbackConnection ...
Definition: noArgumentCallbackList.h:210
DtCallbackInfoType(DtCallbackFunctionType callback, void *userData)
Definition: noArgumentCallbackList.h:185
bool disconnect()
Disconnect the connection. Can be called multiple times. Can be called on a default constructed objec...
Definition: noArgumentCallbackList.h:220
bool operator==(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:67
T_CallbackFunctionType callback
Definition: noArgumentCallbackList.h:86
bool disconnect(const DtCallbackInfoType &)
Definition: noArgumentCallbackList.h:302
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:193
bool removeCallback(DtCallbackFunctionType fcn, void *usrData)
Removes the specified callback from the list.
DtCallbackList & operator=(const DtCallbackList &orig)
Definition: noArgumentCallbackList.h:121
DtCallbackConnection()
Default constructor.
Definition: noArgumentCallbackList.h:214
DtCallbackListT & operator=(const DtCallbackListT &)
DtCallbackFunctionInfo & operator=(const DtCallbackFunctionInfo &rhs)
Definition: noArgumentCallbackList.h:48
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:196
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:140
bool addCallback(DtCallbackFunctionType fcn, void *usrData)
Adds a new callback to the list. A duplicate entry is checked for first, and if found, this new function is not added.
DtCallbackFunctionInfo(T_CallbackFunctionType func, void *usr=0)
Definition: noArgumentCallbackList.h:34
This is a templated class which manages a list of callbacks. A class is instantiated from this templa...
Definition: noArgumentCallbackList.h:203
DtCallbackInfoType(const Callback &callback)
Definition: noArgumentCallbackList.h:304
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:315
DtCallbackConnection(const DisconnectFunctionType &func)
Definition: noArgumentCallbackList.h:238
This class works just as DtCalllbackTable, but manages callbacks that have no arguments, and therefore don't fit in the template defined by DtCallbackList.
Definition: noArgumentCallbackList.h:152
boost::function< bool()> DisconnectFunctionType
Definition: noArgumentCallbackList.h:236
Definition: noArgumentCallbackList.h:91
DisconnectFunctionType myDisconnectFunction
Definition: noArgumentCallbackList.h:241
Definition: noArgumentCallbackList.h:130
void removeCallback(const Callback &callback, bool *removedLast=0)
Removes the specified callback from the list if it exists. Uses the equality operator of the supplied...
DtCallbackFunctionInfo(const DtCallbackFunctionInfo &orig)
Definition: noArgumentCallbackList.h:41
bool operator!=(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:73
std::set< DtCallbackInfoType > DtCallbackListType
Definition: noArgumentCallbackList.h:191
void * userData() const
Definition: noArgumentCallbackList.h:82
const T_CallbackFunctionType & getCallback() const
Definition: noArgumentCallbackList.h:81
DtCallbackInfoType(DtCallbackFunctionType callback, void *userData=0)
Definition: noArgumentCallbackList.h:132
boost::shared_ptr< bool > deletedFlag
Definition: noArgumentCallbackList.h:82
DtCallbackInfoType::List myCallbackList
Definition: noArgumentCallbackList.h:314
DtCallbackListT()
Default constructor.
Definition: noArgumentCallbackList.h:259
DtCallbackListType myCallbackList
Definition: noArgumentCallbackList.h:142
void invokeCallbacks()
Invokes all the callbacks currently on the callback list.
Definition: noArgumentCallbackList.h:183
DtCallbackListType myCallbackList
Definition: noArgumentCallbackList.h:195