Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
Delegate< ReturnType(ParamsList...)> Class Template Reference

Delegate class. More...

#include <Delegate.h>

Public Member Functions

__forceinline Delegate ()
 Instantiate a delegate object. More...
 
template<class ClassType >
__forceinline Delegate (MethodDeclaration< ClassType > m, ClassType *c)
 Delegate a class method. More...
 
__forceinline Delegate (FunctionDeclaration m)
 Delegate a function. More...
 
__forceinline ReturnType operator() (ParamsList...params) const
 Invoke a delegate. More...
 
__forceinline Delegate (Delegate &&that)
 Move a delegate from another object. More...
 
__forceinline Delegate (const Delegate &that)
 Copy a delegate from another Delegate object. More...
 
__forceinline Delegateoperator= (const Delegate &that)
 Copy a delegate from another Delegate object. More...
 
Delegateoperator= (Delegate &&that)
 Move a delegate from another Delegate object. More...
 
__forceinline operator bool () const
 Check for null pointer. More...
 

Protected Member Functions

void copy (const Delegate &other)
 

Detailed Description

template<class ReturnType, class... ParamsList>
class Delegate< ReturnType(ParamsList...)>

Delegate class.

Constructor & Destructor Documentation

template<class ReturnType , class... ParamsList>
__forceinline Delegate< ReturnType(ParamsList...)>::Delegate ( )
inline

Instantiate a delegate object.

template<class ReturnType , class... ParamsList>
template<class ClassType >
__forceinline Delegate< ReturnType(ParamsList...)>::Delegate ( MethodDeclaration< ClassType >  m,
ClassType *  c 
)
inline

Delegate a class method.

Parameters
mMethod declaration to delegate
cPointer to the class type
template<class ReturnType , class... ParamsList>
__forceinline Delegate< ReturnType(ParamsList...)>::Delegate ( FunctionDeclaration  m)
inline

Delegate a function.

Parameters
mFunction declaration to delegate
template<class ReturnType , class... ParamsList>
__forceinline Delegate< ReturnType(ParamsList...)>::Delegate ( Delegate< ReturnType(ParamsList...)> &&  that)
inline

Move a delegate from another object.

Parameters
thatPointer to the delegate to move
template<class ReturnType , class... ParamsList>
__forceinline Delegate< ReturnType(ParamsList...)>::Delegate ( const Delegate< ReturnType(ParamsList...)> &  that)
inline

Copy a delegate from another Delegate object.

Parameters
thatThe delegate to copy

Member Function Documentation

template<class ReturnType , class... ParamsList>
__forceinline Delegate< ReturnType(ParamsList...)>::operator bool ( ) const
inline

Check for null pointer.

Return values
boolFalse if null pointer
template<class ReturnType , class... ParamsList>
__forceinline ReturnType Delegate< ReturnType(ParamsList...)>::operator() ( ParamsList...  params) const
inline

Invoke a delegate.

Parameters
paramsDelegate parameters
Return values
ReturnTypeReturn value from delgate
template<class ReturnType , class... ParamsList>
__forceinline Delegate& Delegate< ReturnType(ParamsList...)>::operator= ( const Delegate< ReturnType(ParamsList...)> &  that)
inline

Copy a delegate from another Delegate object.

Parameters
thatThe delegate to copy
Return values
DelegatePointer to the copied delegate
template<class ReturnType , class... ParamsList>
Delegate& Delegate< ReturnType(ParamsList...)>::operator= ( Delegate< ReturnType(ParamsList...)> &&  that)
inline

Move a delegate from another Delegate object.

Parameters
thatDelegate to move and assign
Return values
DelegatePointer to the moved delegate