LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
LLU::Async::FunctionWrapper Class Reference

Description

Wraps an arbitrary callable object (possibly binding its arguments) to be evaluated later. The callable object, when called on provided arguments, must return void.

#include <Utilities.h>

Public Member Functions

template<typename F , typename = std::enable_if_t<!std::is_same_v<std::remove_cv<F>, FunctionWrapper>>>
 FunctionWrapper (F &&f)
 Create a FunctionWrapper from any callable object by performing type-erasure. More...
 
template<typename F , typename... Args>
 FunctionWrapper (F &&f, Args &&... args)
 Create a FunctionWrapper from a callable object and arguments for the call. More...
 
void operator() ()
 Call the internal callable object. More...
 

Constructor & Destructor Documentation

◆ FunctionWrapper() [1/2]

template<typename F , typename = std::enable_if_t<!std::is_same_v<std::remove_cv<F>, FunctionWrapper>>>
LLU::Async::FunctionWrapper::FunctionWrapper ( F &&  f)
inlineexplicit

Create a FunctionWrapper from any callable object by performing type-erasure.

Template Parameters
F- any callable type (function, lambda, member function, etc)
Parameters
f- a callable object of type F

◆ FunctionWrapper() [2/2]

template<typename F , typename... Args>
LLU::Async::FunctionWrapper::FunctionWrapper ( F &&  f,
Args &&...  args 
)
inlineexplicit

Create a FunctionWrapper from a callable object and arguments for the call.

Template Parameters
F- any callable type (function, lambda, member function, etc)
Args- function call argument types
Parameters
f- a callable object of type F
args- function call arguments

Member Function Documentation

◆ operator()()

void LLU::Async::FunctionWrapper::operator() ( )
inline

Call the internal callable object.