vSMC
vSMC: Scalable Monte Carlo
|
Wrap a callable object into a dispatch_function_t
type pointer.
More...
#include <vsmc/gcd/dispatch_function.hpp>
Public Member Functions | |
DispatchFunction (const T &work) | |
DispatchFunction (T &&work) noexcept | |
void * | context () |
::dispatch_function_t | function () const |
Wrap a callable object into a dispatch_function_t
type pointer.
It is important that this object live at least after the completion of the work. This is a thin wrapper around a regular C++ callable object (including lambda expressions) that make it easier to interface them with GCD. The memory management issue is the same as using raw GCD interface with a context variable, which shall not be destroyed before the execution of the function finishes. The original object does not need to exist after the creation of DispatchFunction.
Definition at line 52 of file dispatch_function.hpp.
|
inline |
Definition at line 56 of file dispatch_function.hpp.
|
inlinenoexcept |
Definition at line 59 of file dispatch_function.hpp.
|
inline |
Definition at line 62 of file dispatch_function.hpp.
|
inline |
Definition at line 64 of file dispatch_function.hpp.