#include <Pt/Method.h>
Adapter for class methods. More...
Inherits Callable< R, ARGUMENTS >.
Public Types | |
typedef R(ClassT::* | MemFuncT )(ARGUMENTS) |
The wrapped member function signature. | |
Public Member Functions | |
Method (ClassT &object, MemFuncT ptr) | |
Wraps the given object/member pair. | |
R | call (ARGUMENTS) const |
Same as operator(). | |
Method< R, ClassT, ARGUMENTS > * | clone () const |
Returns a copy of this instance. More... | |
void | invoke (ARGUMENTS) const |
Invoke the callable entity. More... | |
const MemFuncT & | method () const |
Returns a reference to the wrapped member function. | |
ClassT & | object () |
Returns a reference to this object's wrapped ClassT object. | |
const ClassT & | object () const |
Returns a const reference to the wrapped ClassT object. | |
virtual R | operator() (ARGUMENTS) const =0 |
Call the callable entity. More... | |
bool | operator== (const Method &rhs) const |
Returns true if both use the same object and function pointer. | |
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 Method class wraps member functions as Callable objects so that they can be used with the signals/slots framework. There are partial specializations of this class template for up to ten arguments.
|
virtual |
A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.
Implements Callable< R, ARGUMENTS >.
|
pure virtualinherited |
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 >.
|
virtualinherited |
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 >.