Poplar and PopLibs
|
Wrapper for HostCallback instances. More...
#include <HostFunctionCallback.hpp>
Public Member Functions | |
template<class CallbackImpl , typename = typename std::enable_if< std::is_base_of<HostCallback, CallbackImpl>::value>::type> | |
HostCallbackHandle (std::unique_ptr< CallbackImpl > f) | |
Constructs a handle from an instance of a host callback implementation. More... | |
template<class F , typename = typename std::enable_if< traits::is_host_callback<F>::value>::type> | |
HostCallbackHandle (F &&f) | |
Constructs a handle from a callable instance. More... | |
operator std::unique_ptr< HostCallback > () && | |
Extracts the callback implementation from the handle. | |
Wrapper for HostCallback instances.
Provides a way to specify a callback using one of the following options:
HostCallback
interfacestd::function
|
inline |
Constructs a handle from an instance of a host callback implementation.
This constructor only participates in overload resolution if CallbackImpl is derived from poplar::HostCallback (in other words, it is an implementation of the host callback interface).
|
inline |
Constructs a handle from a callable instance.
This constructor only participates in overload resolution if F
satisfies the requirements of a Function Object. It transforms f
into a HostCallback implementation.