This class represents a delegate, that is a compound of an object reference and a member function pointer. The generic type of a delegate just depends on the signature of the (member) function pointer but not on the type of the object on which the member function pointer is invoked.
More...
|
|
template<class Lambda > |
| | delegate (Lambda f) |
| | Constructs a delegate through a lambda expression implicitly.
|
| |
|
| delegate (void)=default |
| | The default constructor.
|
| |
| | delegate (const delegate &arg)=default |
| | The default copy constructor. More...
|
| |
| | delegate (delegate &&arg) noexcept=default |
| | The default move constructor. More...
|
| |
| delegate & | operator= (const delegate &arg)=default |
| | The default assign operator. More...
|
| |
| delegate & | operator= (delegate &&arg) noexcept=default |
| | The default move assign operator. More...
|
| |
| bool | operator== (const delegate &rhs) const noexcept |
| | Compares this instance to the as argument passed rhs . More...
|
| |
| bool | operator!= (const delegate &rhs) const noexcept |
| | Compares this instance to the as argument passed rhs . More...
|
| |
|
| delegate (std::nullptr_t) noexcept |
| | Constructs an empty delegate representing a nullptr.
|
| |
| bool | operator== (std::nullptr_t const) const noexcept |
| | Compares this instance to a nullptr. More...
|
| |
| bool | operator!= (std::nullptr_t const) const noexcept |
| | Compares this instance to a nullptr. More...
|
| |
| | operator bool () const noexcept |
| | Converts this instance explicitly to bool. More...
|
| |
| bool | is_lambda (void) const |
| | Determines if this instance wraps a lamda expression or std::function More...
|
| |
| R | operator() (A... args) const |
| | The functor operator invokes the adapted callable target. More...
|
| |
| void | reset () |
| | Resets this instance. More...
|
| |
|
| static delegate | create (R(*const pFunction)(A...)) |
| | Creates a delegate from a static function. More...
|
| |
| template<class C > |
| static delegate | create (C *pObject, R(C::*pMethod)(A...)) noexcept |
| | Creates a delegate from a member function and object pointer. More...
|
| |
| template<class C > |
| static delegate | create (C &object, R(C::*pMethod)(A...)) noexcept |
| | Creates a delegate from a member function and object reference. More...
|
| |
| template<class C > |
| static delegate | create (const C *pObject, R(C::*pMethod)(A...) const) noexcept |
| | Creates a delegate from a const member function and const object pointer. More...
|
| |
| template<class C > |
| static delegate | create (const C &object, R(C::*pMethod)(A...) const) noexcept |
| | Creates a delegate from a const member function and const object reference. More...
|
| |
| static delegate | create (std::function< R(A...)> &&f) |
| | Creates a delegate from a lambda expression or std::function. More...
|
| |
| static delegate | create (const std::function< R(A...)> &f) |
| | Creates a delegate from a lambda expression or std::function. More...
|
| |
template<class R, class ... A>
class Arp::delegate< R(A...)>
This class represents a delegate, that is a compound of an object reference and a member function pointer. The generic type of a delegate just depends on the signature of the (member) function pointer but not on the type of the object on which the member function pointer is invoked.
A delegate might be seen as a generalized function pointer (callback) in OOP design. It might invoke the following callable targets:
-
static functions
-
member functions
-
lambda expressions
-
std::function
The make_delegate function shall be used to create delegates from these callable targets.