c++-gtk-utils
|
Functor class holding a Callback::CallbackArg object, with thread-safe reference count. More...
#include <c++-gtk-utils/callback.h>
Public Member Functions | |
void | operator() (typename Cgu::Param< FreeArgs >::ParamType...args) const |
SafeFunctorArg & | operator= (const SafeFunctorArg &f) |
SafeFunctorArg & | operator= (SafeFunctorArg &&f) |
SafeFunctorArg (const CallbackArg< FreeArgs...> *cb) | |
SafeFunctorArg (const SafeFunctorArg &f) | |
SafeFunctorArg (SafeFunctorArg &&f) | |
SafeFunctorArg () |
Friends | |
struct | std::hash< SafeFunctorArg > |
bool | operator== (const SafeFunctorArg &, const SafeFunctorArg &) |
bool | operator< (const SafeFunctorArg &, const SafeFunctorArg &) |
Functor class holding a Callback::CallbackArg object, with thread-safe reference count.
This class is the same as Callback::FunctorArg except that it will provide synchronisation of the reference count between threads. Use it where a functor wrapper object is to be passed between threads. The FunctorArg documentation gives details on usage.
Callback::SafeFunctorArg<> is typedef'ed to Callback::SafeFunctor.
For further background, read this: Callback
|
inline |
Constructor of first SafeFunctorArg holding the referenced callback. As it is not marked explicit, it is also a type conversion constructor.
cb | The CallbackArg object which the functor is to manage. |
std::bad_alloc | This might throw std::bad_alloc if memory is exhausted and the system throws in that case. Note that if such an exception is thrown, then this constructor will clean itself up and also delete the callback object passed to it. |
|
inline |
The copy constructor does not throw.
f | The assignor. |
|
inline |
The move constructor does not throw.
f | The functor to be moved. |
|
inline |
Default constructor, where a Callback::CallbackArg object is to be assigned later (via the type conversion constructor and/or the assignment operator). This constructor does not throw.
|
inline |
This will execute the referenced function or class method encapsulated by this class. It will only throw if the executed function or class method throws, or if the copy constructor of the free or a bound argument throws and it is not a reference argument. It is thread safe if the referenced function or class method is thread safe.
args | The unbound arguments to be passed to the referenced function or class method, if any. |
|
inline |
This function does not throw.
f | The assignor. |
|
inline |
This function does not throw.
f | The functor to be moved. |
|
friend |
One SafeFunctorArg object is less than another if the address of the CallbackArg object contained by the first is regarded by std::less as less than the address of the CallbackArg object contained by the other. This comparison operator does not throw.
|
friend |
Two SafeFunctorArg objects compare equal if the addresses of the CallbackArg objects they contain are the same. This comparison operator does not throw.
|
friend |