Embedded Template Library  1.0
etl::delegate< TReturn(TParams...)> Class Template Referencefinal

Public Member Functions

 delegate ()=default
 Default constructor.
 
 delegate (const delegate &other)=default
 
template<typename TLambda , typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
 delegate (const TLambda &instance)
 
TReturn operator() (TParams... args) const
 Execute the delegate.
 
delegateoperator= (const delegate &rhs)=default
 Create from function (Compile time).
 
template<typename TLambda , typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
delegateoperator= (const TLambda &instance)
 Create from Lambda or 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.
 

Static Public Member Functions

template<TReturn(*)(TParams...) Method>
constexpr static delegate create ()
 Create from function (Compile time).
 
template<typename TLambda , typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
constexpr static delegate create (const TLambda &instance)
 Create from Lambda or Functor.
 
template<typename T , TReturn(T::*)(TParams...) Method>
constexpr static delegate create (T &instance)
 Create from instance method (Run time).
 
template<typename T , TReturn(T::*)(TParams...) Method>
static delegate create (T &&instance)=delete
 
template<typename T , TReturn(T::*)(TParams...) const Method>
constexpr static delegate create (const T &instance)
 Create from const instance method (Run time).
 
template<typename T , TReturn(T::*)(TParams...) const Method>
constexpr static delegate create (T &&instance)=delete
 Disable create from rvalue instance method (Run time).
 
template<typename T , T & Instance, TReturn(T::*)(TParams...) Method>
constexpr static delegate create ()
 Create from instance method (Compile time).
 
template<typename T , T const & Instance, TReturn(T::*)(TParams...) const Method>
constexpr static delegate create ()
 Create from const instance method (Compile time).
 
template<typename T , T & Instance>
constexpr static delegate create ()
 

Member Function Documentation

◆ create() [1/2]

template<typename TReturn , typename... TParams>
template<typename T , T & Instance>
constexpr static delegate etl::delegate< TReturn(TParams...)>::create ( )
inlinestaticconstexpr

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

◆ create() [2/2]

template<typename TReturn , typename... TParams>
template<typename T , TReturn(T::*)(TParams...) Method>
static delegate etl::delegate< TReturn(TParams...)>::create ( T &&  instance)
staticdelete

Create from instance method (Run time). Deleted for rvalue references.


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