Webmaster  |  Imprint 
Platinum
Platinum C++ Framework
Main  |  License  |  Documentation  |  Download  |  Support 

Function Class Template Reference

Wraps free functions into a generic callable for use with the signals/slots framework. More...

#include <Pt/Function.h>

Inheritance diagram for Function:

Callable Invokable

List of all members.

Public Types

typedef R(* FuncT )(ARGUMENTS)
 The function signature wrapped by this class.

Public Member Functions

 Function (FuncT func)
 Construct from function pointer.
 Function (const Function &f)
 Copy Constructor.
operator() (ARGUMENTS args) const
 Call the callable entity.
Function< R, ARGUMENTS > * clone () const
 Returns a copy of this instance.
bool operator== (const Function &rhs) const
 Returns true if both use the same function pointer.


Detailed Description

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

The Function class wraps free functions in the form of a Callable, for use with the signals/slots framework.

Member Function Documentation

R operator() ( ARGUMENTS   )  const [virtual]

Since this class template is partially specialized, the passed arguments ARGUMENTS must match the template parameters.

Implements Callable.

Function<R, ARGUMENTS>* clone (  )  const [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.

Copyright © 2003-2007 The Pt Development Team
Pt 1.0