RWTFunctorR0Imp<SR> RWBodyBase RWTFunctorR0<SR> Implementation Classes RWTFunctorR0Imp<SR>
#include <rw/functor/RWTFunctorR0Imp.h> #include <rw/functor/RWTFunctorR0GImp.h> #include <rw/functor/RWTFunctorR0GA1Imp.h> #include <rw/functor/RWTFunctorR0GA2Imp.h> #include <rw/functor/RWTFunctorR0GA3Imp.h> #include <rw/functor/RWTFunctorR0MImp.h> #include <rw/functor/RWTFunctorR0MA1Imp.h> #include <rw/functor/RWTFunctorR0MA2Imp.h> #include <rw/functor/RWTFunctorR0MA3Imp.h>
A function object, or a functor, is an object that encapsulates a call to an associated global or member function. When a functor is invoked, it calls the associated function.
RWTFunctorR0Imp<SR> is the abstract base class for the family of functor bodies that take no caller arguments at invocation time and return a value.
The make() function is the only member of these functor classes that is intended to be accessed directly; it is often called through one of the rwtMakeFunctor0() convenience mechanisms. All other members must be accessed through an RWFunctor0 handle.
Each derived class name appends either a G (for global) or an M (for member), to indicate whether or not it is invoked upon an object. Static member functions use the G version, since there is no object associated with the call.
The class name may also append A1, A2, or A3, to indicate that it takes callee arguments at construction time. These arguments are stored and added to the caller argument at invocation time.
The eight concrete class names are:
RWTFunctorR0GImp<SR,DR> | No this object, no callee arguments |
RWTFunctorR0GA1Imp<SR,DR,A1> | No this object, one callee argument |
RWTFunctorR0GA2Imp<SR,DR,A1,A2> | No this object, two callee arguments |
RWTFunctorR0GA3Imp<SR,DR,A1,A2,A3> | No this object, three callee arguments |
RWTFunctorR0MImp<SR,Callee,DR> | Has this object, but no callee arguments |
RWTFunctorR0MA1Imp<SR,Callee,DR,A1> | Has this object, and one callee argument |
RWTFunctorR0MA2Imp<SR,Callee,DR,A1,A2> | Has this object, and two callee arguments |
RWTFunctorR0MA3Imp<SR,Callee,DR,A1,A2,A3> | Has this object, and three callee arguments |
These concrete classes are templatized on the signature of the function that is encapsulated, as well as on the signature of the functor invocation.
The template parameters describe the invocation signature of the functor and the function call it encapsulates. These parameters are:
SR | The return type of the functor |
Callee | The class type that declares a member function |
DR | The return type of the function; the compiler must be able to convert this to the SR type |
A1 | The type of the first client data argument |
A2 | The type of the second client data argument |
A3 | The type of the third client data argument |
#include <rw/functor/RWTFunctorR0GA1Imp.h> float foo(int); // Create a functor that calls foo(7): RWTFunctorR0<SR> func; func = RWTFunctorR0GA1Imp<float,float,int>::make(foo,7); // Invoke Functor float result = func();
typedef DR (*CalleeSignature)(void);
In RWTFunctorR0GImp<SR,DR>.
typedef DR (*CalleeSignature)(A1);
In RWTFunctorR0GA1Imp<SR,DR,A1>.
typedef DR (*CalleeSignature)(A1,A2);
In RWTFunctorR0GA2Imp<SR,DR,A1,A2>.
typedef DR (*CalleeSignature)(A1,A2,A3);
In RWTFunctorR0GA3Imp<SR,DR,A1,A2,A3>.
typedef DR (Callee::*CalleeSignature)(void);
In RWTFunctorR0MImp<SR,Callee,DR>.
typedef DR (Callee::*CalleeSignature)(A1);
In RWTFunctorR0MA1Imp<SR,Callee,DR,A1>.
typedef DR (Callee::*CalleeSignature)(A1,A2);
In RWTFunctorR0MA2Imp<SR,Callee,DR,A1,A2>.
typedef DR (Callee::*CalleeSignature)(A1,A2,A3);
In RWTFunctorR0MA3Imp<SR,Callee,DR,A1,A2,A3>.
static RWTFunctorR0<SR> RWTFunctorR0GImp<SR,DR>:: make(CalleeSignature function);
static RWTFunctorR0<SR> RWTFunctorR0GA1Imp<SR,DR,A1>:: make(CalleeSignature function, A1 a1);
static RWTFunctorR0<SR> RWTFunctorR0GA2Imp<SR,DR,A1,A2>:: make(CalleeSignature function, A1 a1, A2 a2);
static RWTFunctorR0<SR> RWTFunctorR0GA3Imp<SR,DR,A1,A2,A3>:: make(CalleeSignature function, A1 a1, A2 a2, A3 a3);
static RWTFunctorR0<SR> RWTFunctorR0MImp<SR,Callee,DR>:: make(Callee& callee, CalleeSignature function);
static RWTFunctorR0<SR> RWTFunctorR0MA1Imp<SR,Callee,DR,A1>:: make(Callee& callee, CalleeSignature function, A1 a1);
static RWTFunctorR0<SR> RWTFunctorR0MA2Imp<SR,Callee,DR,A1,A2>:: make(Callee& callee, CalleeSignature function, A1 a1, A2 a2);
static RWTFunctorR0<SR> RWTFunctorR0MA3Imp<SR,Callee,DR,A1,A2,A3>:: make(Callee& callee, CalleeSignature function, A1 a1, A2 a2, A3 a3);
These make() functions dynamically construct an instance of the corresponding implementation class and bind it to the returned RWTFunctorR0<SR> handle instance.
rwtMakeFunctorR0, RWTFunctorR0<SR>
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.