15 #include <boost/function.hpp>
17 #include <tbb/spin_mutex.h>
30 template <
typename T_CallbackFunctionType>
74 return !(*
this == rhs);
89 template <
typename T_CallbackArg>
176 void invokeCallbacks();
201 template <
typename Callback>
221 if (myDisconnectFunction)
223 bool value = myDisconnectFunction();
232 template <
typename Callback>
238 : myDisconnectFunction(func) { }
253 template <
typename Callback>
280 void removeCallback(
const boost::function<
bool(
const Callback&)>& removePredicate,
bool* removedLast = 0);
290 template <
typename T1>
293 template <
typename T1,
typename T2>
296 template <
typename T1,
typename T2,
typename T3>
322 #define callbackList_inl_
323 #include "readerWriter/noArgumentCallbackList.inl"
324 #undef callbackList_inl_
void removeAll()
Removes all callbacks that have been registered.
bool isDeleted() const
Definition: noArgumentCallbackList.h:78
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
std::shared_ptr< bool > deletedFlag
Definition: noArgumentCallbackList.h:81
bool operator<(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:56
DtCallbackList()
Default constructor.
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:142
void invokeCallbacks(T_CallbackArg arg)
Invokes all the callbacks currently on the callback list.
bool operator>(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:61
std::set< DtCallbackInfoType > DtCallbackListType
Definition: noArgumentCallbackList.h:137
void setIsDeleted(bool b)
Definition: noArgumentCallbackList.h:77
void removeAll()
Removes all callbacks that have been registered.
void * usrData
Definition: noArgumentCallbackList.h:86
DtCallbackList; DtNoArgumentCallbackList.
Definition: noArgumentCallbackList.h:31
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:311
Represents the connection of a specific callback to a DtCallbackListT. Saving a DtCallbackConnection ...
Definition: noArgumentCallbackList.h:209
DtCallbackInfoType(DtCallbackFunctionType callback, void *userData)
Definition: noArgumentCallbackList.h:184
bool disconnect()
Disconnect the connection. Can be called multiple times. Can be called on a default constructed objec...
Definition: noArgumentCallbackList.h:219
bool operator==(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:66
T_CallbackFunctionType callback
Definition: noArgumentCallbackList.h:85
bool disconnect(const DtCallbackInfoType &)
Definition: noArgumentCallbackList.h:301
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:192
bool removeCallback(DtCallbackFunctionType fcn, void *usrData)
Removes the specified callback from the list.
DtCallbackList & operator=(const DtCallbackList &orig)
Definition: noArgumentCallbackList.h:120
DtCallbackConnection()
Default constructor.
Definition: noArgumentCallbackList.h:213
DtCallbackListT & operator=(const DtCallbackListT &)
DtCallbackFunctionInfo & operator=(const DtCallbackFunctionInfo &rhs)
Definition: noArgumentCallbackList.h:47
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:195
tbb::spin_mutex myMutex
Definition: noArgumentCallbackList.h:139
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:33
This is a templated class which manages a list of callbacks. A class is instantiated from this templa...
Definition: noArgumentCallbackList.h:202
DtCallbackInfoType(const Callback &callback)
Definition: noArgumentCallbackList.h:303
unsigned myCallbackCount
Definition: noArgumentCallbackList.h:314
DtCallbackConnection(const DisconnectFunctionType &func)
Definition: noArgumentCallbackList.h:237
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:151
boost::function< bool()> DisconnectFunctionType
Definition: noArgumentCallbackList.h:235
Definition: noArgumentCallbackList.h:90
DisconnectFunctionType myDisconnectFunction
Definition: noArgumentCallbackList.h:240
Definition: noArgumentCallbackList.h:129
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:40
bool operator!=(const DtCallbackFunctionInfo &rhs) const
Definition: noArgumentCallbackList.h:72
std::set< DtCallbackInfoType > DtCallbackListType
Definition: noArgumentCallbackList.h:190
void * userData() const
Definition: noArgumentCallbackList.h:81
const T_CallbackFunctionType & getCallback() const
Definition: noArgumentCallbackList.h:80
DtCallbackInfoType(DtCallbackFunctionType callback, void *userData=0)
Definition: noArgumentCallbackList.h:131
DtCallbackInfoType::List myCallbackList
Definition: noArgumentCallbackList.h:313
DtCallbackListT()
Default constructor.
Definition: noArgumentCallbackList.h:258
DtCallbackListType myCallbackList
Definition: noArgumentCallbackList.h:141
void invokeCallbacks()
Invokes all the callbacks currently on the callback list.
Definition: noArgumentCallbackList.h:182
DtCallbackListType myCallbackList
Definition: noArgumentCallbackList.h:194