#include <Pt/Callable.h>
An interface for all callable entities. More...
Inherits Invokable< ARGUMENTS >.
Inherited by ConstMethod< R, Pt::Delegate< R, ARGUMENTS >, ARGUMENTS >, ConstMethod< R, ClassT, ARGUMENTS >, Function< R, ARGUMENTS >, and Method< R, ClassT, ARGUMENTS >.
Public Member Functions | |
R | call (ARGUMENTS) const |
Same as operator(). | |
virtual Callable * | clone () const =0 |
Returns a copy of this instance. More... | |
void | invoke (ARGUMENTS) const |
Invoke the callable entity. More... | |
virtual R | operator() (ARGUMENTS) const =0 |
Call the callable entity. More... | |
Related Functions | |
template<class R , class BaseT , class ClassT , typename ARGS > | |
Method< R, ClassT, ARGS > | callable (ClassT &obj, R(BaseT::*ptr)(ARGS)) |
Returns a Method object for the given object/method pair. | |
template<class R , class BaseT , class C , typename ARGS > | |
ConstMethod< R, C, ARGS > | callable (C &obj, R(BaseT::*ptr)(ARGS) const ) |
Returns a ConstMethod object for the given object/method pair. | |
template<typename R , typename ARGS > | |
Function< R, ARGS > | callable (R(*func)(ARGS)) |
Returns a Function wrapper for the given free/static function. | |
The Callable interface extends the Invokable interface to handle return values. There are partial specializations of this class template for up to ten arguments.
|
pure virtual |
A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.
Implemented in Function< R, ARGUMENTS >, ConstMethod< R, ClassT, ARGUMENTS >, ConstMethod< void, Pt::Signal< ARGUMENTS >, ARGUMENTS >, ConstMethod< R, ClassT, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 >, ConstMethod< R, Pt::Delegate< R, ARGUMENTS >, ARGUMENTS >, Method< R, ClassT, ARGUMENTS >, Method< void, C, A1, A2, A3, A4, A5 >, Method< R, ClassT, ARGUMENTS0 >, Method< void, C >, Method< void, C, A1 >, Method< void, C, A1, A2, A3 >, Method< void, C, A1, A2, A3, A4 >, Method< void, C, A1, A2 >, and Method< void, C, A1, A2, A3, A4, A5, A6, A7, A8 >.
|
pure virtual |
Since this class template is partially specialized, the passed arguments ARGUMENTS must match the template parameters.
Implemented in Function< R, ARGUMENTS >, ConstMethod< R, ClassT, ARGUMENTS >, ConstMethod< void, Pt::Signal< ARGUMENTS >, ARGUMENTS >, ConstMethod< R, ClassT, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 >, and ConstMethod< R, Pt::Delegate< R, ARGUMENTS >, ARGUMENTS >.
|
virtual |
Inherited from Invokable. Ignores the return value of the Callable. Since this class template is partially specialized, the passed arguments ARGUMENTS must match the template parameters.
Implements Invokable< ARGUMENTS >.