#include <Pt/Callable.h>
An interface for all callable entities. More...
Inherits Invokable< As... >.
Public Member Functions | |
| virtual Callable * | clone () const =0 |
| Returns a copy of this instance. More... | |
| virtual R | call (As... args) const =0 |
| Calls the callable entity and returns its result. More... | |
| R | operator() (As... args) const |
| Same as call(). | |
| virtual void | invoke (As... args) const =0 |
| Invokes the invokable entity with the given arguments. More... | |
Related Functions | |
| template<typename R , typename BaseT , typename ClassT , typename... As> | |
| ConstMethod< R, ClassT, As... > | callable (ClassT &object, R(BaseT::*method)(As...) const) |
| Returns a ConstMethod object for the given object/method pair. | |
| template<typename R , typename... As> | |
| Function< R, As... > | callable (R(*function)(As...)) |
| Returns a Function wrapper for the given free/static function. | |
| template<typename R , typename BaseT , typename ClassT , typename... As> | |
| Method< R, ClassT, As... > | callable (ClassT &object, R(BaseT::*method)(As...)) |
| Returns a Method object for the given object/method pair. | |
The Callable interface extends the Invokable interface to handle return values. The variadic template argument list determines the callable signature.
|
pure virtual |
A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.
|
pure virtual |
This is the primary non-virtual entry point used by Delegate and other callers that need the return value. All derived classes must implement this.
Implemented in Method< R, ClassT, As >, Method< void, C, A1, A2, A3, A4, A5 >, Method< R, ClassT, As... >, Method< void, C >, Method< void, C, A1 >, Method< void, C, A1, A2, A3 >, Method< void, Pt::Signal< As... >, As... >, Method< R, Pt::Delegate< R, As... >, As... >, Method< void, C, A1, A2, A3, A4 >, Method< void, C, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void >, Method< void, C, A1, A2 >, Function< R, As >, Function< R, As... >, ConstMethod< R, ClassT, As >, and ConstMethod< R, ClassT, As... >.
|
pure virtual |
The passed arguments must match the template parameters.
Implements Invokable< As... >.
Implemented in Method< R, ClassT, As >, Method< void, C, A1, A2, A3, A4, A5 >, Method< R, ClassT, As... >, Method< void, C >, Method< void, C, A1 >, Method< void, C, A1, A2, A3 >, Method< void, Pt::Signal< As... >, As... >, Method< R, Pt::Delegate< R, As... >, As... >, Method< void, C, A1, A2, A3, A4 >, Method< void, C, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void, Pt::Void >, Method< void, C, A1, A2 >, Function< R, As >, Function< R, As... >, ConstMethod< R, ClassT, As >, and ConstMethod< R, ClassT, As... >.