Callable< R, As > Class Template Referenceabstract

#include <Pt/Callable.h>

An interface for all callable entities. More...

Inherits Invokable< As... >.

Public Member Functions

virtual Callableclone () 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...
 
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.
 

Detailed Description

template<typename R, typename... As>
class Pt::Callable< R, As >

The Callable interface extends the Invokable interface to handle return values. The variadic template argument list determines the callable signature.

Member Function Documentation

◆ clone()

virtual Callable* clone ( ) const
pure virtual

A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.

◆ call()

◆ invoke()