Embedded Template Library 1.0
etl::delegate< TReturn(void)> Class Template Reference

Specialisation for void parameter. More...

#include <delegate_cpp03.h>

Public Member Functions

 delegate ()
 Default constructor.
 
 delegate (const delegate &other)
 
template<typename TFunctor >
 delegate (TFunctor &instance, typename etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, int >::type=0)
 
template<typename TFunctor >
 delegate (const TFunctor &instance, typename etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, int >::type=0)
 
template<TReturn(*)() Method>
void set ()
 Set from function (Compile time).
 
template<typename TFunctor >
etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, void >::type set (TFunctor &instance)
 Set from Functor.
 
template<typename TFunctor >
etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, void >::type set (const TFunctor &instance)
 Set from const Functor.
 
template<typename T , TReturn(T::*)() Method>
void set (T &instance)
 Set from instance method (Run time).
 
template<typename T , TReturn(T::*)() const Method>
void set (T &instance)
 Set from const instance method (Run time).
 
template<typename T , T & Instance, TReturn(T::*)() Method>
void set ()
 Set from instance method (Compile time).
 
template<typename T , T const & Instance, TReturn(T::*)() const Method>
void set ()
 Set from const instance method (Compile time).
 
ETL_CONSTEXPR14 void clear ()
 Clear the delegate.
 
TReturn operator() () const
 Execute the delegate.
 
template<typename TAlternative >
TReturn call_or (TAlternative alternative) const
 
template<TReturn(*)() Method>
TReturn call_or () const
 
delegateoperator= (const delegate &rhs)
 Assignment.
 
template<typename TFunctor >
etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, delegate & >::type operator= (TFunctor &instance)
 Create from Functor.
 
template<typename TFunctor >
etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, delegate & >::type operator= (const TFunctor &instance)
 Create from const Functor.
 
bool operator== (const delegate &rhs) const
 Checks equality.
 
bool operator!= (const delegate &rhs) const
 Returns true if the delegate is valid.
 
bool is_valid () const
 Returns true if the delegate is valid.
 
 operator bool () const
 Returns true if the delegate is valid.
 
- Public Member Functions inherited from etl::private_delegate::call_if_impl< delegate< TReturn(void)>, TReturn, void >
etl::optional< TReturn > call_if (void param)
 

Static Public Member Functions

template<TReturn(*)() Method>
static delegate create ()
 Create from function (Compile time).
 
template<typename TFunctor >
static etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, delegate >::type create (TFunctor &instance)
 Create from Functor.
 
template<typename TFunctor >
static etl::enable_if< etl::is_class< TFunctor >::value &&!etl::is_same< delegate_type, TFunctor >::value, delegate >::type create (const TFunctor &instance)
 Create from const Functor.
 
template<typename T , TReturn(T::*)() Method>
static delegate create (T &instance)
 Create from instance method (Run time).
 
template<typename T , TReturn(T::*)() const Method>
static delegate create (const T &instance)
 Create from const instance method (Run time).
 
template<typename T , T & Instance, TReturn(T::*)() Method>
static delegate create ()
 Create from instance method (Compile time).
 
template<typename T , T const & Instance, TReturn(T::*)() const Method>
static delegate create ()
 Create from const instance method (Compile time).
 
template<typename T , T & Instance>
static delegate create ()
 

Detailed Description

template<typename TReturn>
class etl::delegate< TReturn(void)>

Specialisation for void parameter.

Member Function Documentation

◆ call_or() [1/2]

template<typename TReturn >
template<TReturn(*)() Method>
TReturn etl::delegate< TReturn(void)>::call_or ( ) const
inline

Execute the delegate if valid or call alternative. Compile time alternative.

◆ call_or() [2/2]

template<typename TReturn >
template<typename TAlternative >
TReturn etl::delegate< TReturn(void)>::call_or ( TAlternative  alternative) const
inline

Execute the delegate if valid or call alternative. Run time alternative.

◆ create()

template<typename TReturn >
template<typename T , T & Instance>
static delegate etl::delegate< TReturn(void)>::create ( )
inlinestatic

Create from instance function operator (Compile time). At the time of writing, GCC appears to have trouble with this.


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