Callable< R, ARGUMENTS > Class Template Referenceabstract

#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

call (ARGUMENTS) const
 Same as operator().
virtual Callableclone () 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.

Detailed Description

template<typename R, typename ARGUMENTS>
class Pt::Callable< R, ARGUMENTS >

The Callable interface extends the Invokable interface to handle return values. There are partial specializations of this class template for up to ten arguments.

Member Function Documentation

virtual R operator() ( ARGUMENTS  ) const
pure virtual
void invoke ( ARGUMENTS  ) const

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 >.