ADTF  3.18.2
UnaryDelegate< ReturnType, ParamType >

General function template: encapsulates a function or a method with a single parameter. More...

Inheritance diagram for UnaryDelegate< ReturnType, ParamType >:
[legend]

Public Member Functions

 UnaryDelegate (ReturnType(*Function)(ParamType))
 CTOR to delegate an unary function. More...
 
template<typename Method , typename Instance >
 UnaryDelegate (Method method, Instance &instance)
 CTOR to delegate an unary class method. More...
 
ReturnType operator() (ParamType param)
 Invocation operator - invokes the delegated method or function. More...
 

Private Types

typedef detail::DelegateBase< detail::functions::DelegateInterface< ReturnType, ParamType > > Base
 

Detailed Description

template<typename ReturnType, typename ParamType>
class a_util::experimental::UnaryDelegate< ReturnType, ParamType >

General function template: encapsulates a function or a method with a single parameter.

Template Parameters
ReturnTypeReturn type of the function to delegate
Parametertype of the method or function

Definition at line 162 of file delegate_decl.h.

Constructor & Destructor Documentation

◆ UnaryDelegate() [1/2]

UnaryDelegate ( ReturnType(*)(ParamType)  Function)
inline

CTOR to delegate an unary function.

Parameters
[in]FunctionPointer to the function to delegate

Definition at line 202 of file delegate_impl.h.

◆ UnaryDelegate() [2/2]

UnaryDelegate ( Method  method,
Instance &  instance 
)
inline

CTOR to delegate an unary class method.

Template Parameters
MethodPointer to the method
InstanceClass the method shall be invoked from
Parameters
[in]methodPointer to the method to delegate
[in]instanceReference to the class instance the method is member of

Definition at line 212 of file delegate_impl.h.

Member Function Documentation

◆ operator()()

ReturnType operator() ( ParamType  param)
inline

Invocation operator - invokes the delegated method or function.

Parameters
[in]paramParameter forwarded to the delegated function or method
Returns
Return value of the invoked function or method

Definition at line 222 of file delegate_impl.h.