ADTF  3.18.2
NullaryDelegate< ReturnType >

General delegate template: encapsulates a function or a method without a parameter. More...

Inheritance diagram for NullaryDelegate< ReturnType >:
[legend]

Public Member Functions

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

Private Types

typedef detail::DelegateBase< detail::delegates::DelegateInterface< ReturnType > > Base
 

Detailed Description

template<typename ReturnType>
class a_util::experimental::NullaryDelegate< ReturnType >

General delegate template: encapsulates a function or a method without a parameter.

Template Parameters
ReturnTypeReturn type of the function to delegate

Definition at line 128 of file delegate_decl.h.

Constructor & Destructor Documentation

◆ NullaryDelegate() [1/2]

NullaryDelegate ( ReturnType(*)()  Function)
inline

CTOR to delegate a function.

Parameters
[in]FunctionPointer to the function to delegate

Definition at line 175 of file delegate_impl.h.

◆ NullaryDelegate() [2/2]

NullaryDelegate ( Method  method,
Instance &  instance 
)
inline

CTOR to delegate a 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 185 of file delegate_impl.h.

Member Function Documentation

◆ operator()()

ReturnType operator()
inline

Invocation operator - invokes the delegated method or function.

Returns
Return value of the invoked function or method

Definition at line 194 of file delegate_impl.h.