Dev Essential
Loading...
Searching...
No Matches
a_util::experimental::UnaryDelegate< ReturnType, ParamType > Class Template Reference

#include <delegate_decl.h>

Inherits detail::DelegateBase< detail::functions::DelegateInterface< ReturnType, ParamType > >.

Public Member Functions

 UnaryDelegate (ReturnType(*Function)(ParamType))
 
template<typename Method, typename Instance>
 UnaryDelegate (Method method, Instance &instance)
 
ReturnType operator() (ParamType param)
 

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

Constructor & Destructor Documentation

◆ UnaryDelegate() [1/2]

template<typename ReturnType, typename ParamType>
a_util::experimental::UnaryDelegate< ReturnType, ParamType >::UnaryDelegate ( ReturnType(* Function )(ParamType))
inline

CTOR to delegate an unary function

Parameters
[in]FunctionPointer to the function to delegate

◆ UnaryDelegate() [2/2]

template<typename ReturnType, typename ParamType>
template<typename Method, typename Instance>
a_util::experimental::UnaryDelegate< ReturnType, ParamType >::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

Member Function Documentation

◆ operator()()

template<typename ReturnType, typename ParamType>
ReturnType a_util::experimental::UnaryDelegate< ReturnType, ParamType >::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

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