Mistake on this page? Email us
FP2< R, A1, A2 > Class Template Reference

#include <functionpointer.h>

Public Types

typedef R(* static_fp) ()
 

Public Member Functions

 FP2 (R(*function)(A1, A2)=0)
 
template<typename T >
 FP2 (T *object, R(T::*member)(A1, A2))
 
void attach (R(*function)(A1, A2))
 
template<typename T >
void attach (T *object, R(T::*member)(A1, A2))
 
call (A1 a1, A2 a2)
 
static_fp get_function () const
 
operator() (A1 a1, A2 a2)
 
 operator bool (void)
 

Detailed Description

template<typename R, typename A1, typename A2>
class FP2< R, A1, A2 >

A class for storing and calling a pointer to a static or member void function.

Constructor & Destructor Documentation

template<typename R , typename A1 , typename A2 >
FP2< R, A1, A2 >::FP2 ( R(*)(A1, A2)  function = 0)
inline

Create a function pointer, attaching a static function.

Parameters
functionThe void static function to attach (default is none).
template<typename R , typename A1 , typename A2 >
template<typename T >
FP2< R, A1, A2 >::FP2 ( T *  object,
R(T::*)(A1, A2)  member 
)
inline

Create a function pointer, attaching a member function.

Parameters
objectThe object pointer to invoke the member function on (the "this" pointer).
memberThe address of the void member function to attach.

Member Function Documentation

template<typename R , typename A1 , typename A2 >
void FP2< R, A1, A2 >::attach ( R(*)(A1, A2)  function)
inline

Attach a static function.

Parameters
functionThe void static function to attach (default is none).
template<typename R , typename A1 , typename A2 >
template<typename T >
void FP2< R, A1, A2 >::attach ( T *  object,
R(T::*)(A1, A2)  member 
)
inline

Attach a member function

Parameters
objectThe object pointer to invoke the member function on (the "this" pointer).
memberThe address of the void member function to attach.
template<typename R , typename A1 , typename A2 >
R FP2< R, A1, A2 >::call ( A1  a1,
A2  a2 
)
inline

Call the attached static or member function.


The documentation for this class was generated from the following file: