Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::closure< TReturn(TArg0), TCallback > Class Template Reference

#include <closure.h>

Public Types

typedef TCallback callback_type
 The callback type to be invoked.

Public Member Functions

 closure (const callback_type &f, const TArg0 arg0)
TReturn operator() () const

Detailed Description

template<typename TReturn, typename TArg0, typename TCallback>
class etl::closure< TReturn(TArg0), TCallback >

Closure for binding one argument to a callback and invoking it later.

Template Parameters
TReturnThe return type of the callback.
TArg0The type of the argument.
TCallbackThe callback type.

Constructor & Destructor Documentation

◆ closure()

template<typename TReturn, typename TArg0, typename TCallback>
etl::closure< TReturn(TArg0), TCallback >::closure ( const callback_type & f,
const TArg0 arg0 )
inline

Construct a closure with a callback and its argument.

Parameters
fThe callback to be invoked.
arg0The argument to bind to the callback.

Member Function Documentation

◆ operator()()

template<typename TReturn, typename TArg0, typename TCallback>
TReturn etl::closure< TReturn(TArg0), TCallback >::operator() ( ) const
inline

Invoke the stored callback with the bound argument.

Returns
The result of the callback invocation.

The documentation for this class was generated from the following file: