Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWTFunctorR1Imp<SR,S1>

Module:  Threads   Package:  Functor


RWTFunctorR1Imp<SR,S1> RWBodyBase RWTFunctorR1<SR,S1> Implementation Classes RWTFunctorR1Imp<SR,S1>

Local Index

Members

Header Files

#include <rw/functor/RWTFunctorR1Imp.h>

#include <rw/functor/RWTFunctorR1GImp.h>
#include <rw/functor/RWTFunctorR1GA1Imp.h>
#include <rw/functor/RWTFunctorR1GA2Imp.h>
#include <rw/functor/RWTFunctorR1MImp.h>
#include <rw/functor/RWTFunctorR1MA1Imp.h>
#include <rw/functor/RWTFunctorR1MA2Imp.h>

Description

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.

RWTFunctorR1Imp<SR,S1> is the abstract base class for the family of functor bodies that take one caller argument 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 or A2 to indicate that it takes callee arguments at construction time. These arguments are stored and added to the caller argument at invocation time.

The six concrete class names are:

RWTFunctorR1GImp<SR,S1,DR,D1>

No this object, no callee arguments

RWTFunctorR1GA1Imp<SR,S1,DR,D1,A1>

No this object, one callee argument

RWTFunctorR1GA2Imp<SR,S1,DR,D1,A1,A2>

No this object, two callee arguments

RWTFunctorR1MImp<SR,S1,Callee,DR,D1>

Has this object, but no callee arguments

RWTFunctorR1MA1Imp<SR,S1,Callee,D1,DR,A1>

Has this object, and one callee argument

RWTFunctorR1MA2Imp<SR,S1,Callee,DR,D1,A1,A2>

Has this object, and two 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:

Example

#include <rw/functor/RWTFunctorR1GImp.h>

int foo(float);

// Create a functor that calls foo():
RWTFunctorR1<int,float> func;
func = RWTFunctorR1GImp<int,float,int,float>::make(foo);
// Invoke Functor
int result = func(7.0);

Public Typedefs

typedef DR (*CalleeSignature)(D1);
typedef DR (*CalleeSignature)(D1,A1);
typedef DR (*CalleeSignature)(D1,A1,A2);
typedef DR (Callee::*CalleeSignature)(D1);
typedef DR (Callee::*CalleeSignature)(D1,A1);
typedef DR (Callee::*CalleeSignature)(D1,A1,A2);

Static Member Functions

static
RWTFunctorR1<SR,S1>
RWTFunctorR1GImp<SR,S1,DR,D1>::
make(CalleeSignature function);

static
RWTFunctorR1<SR,S1>
RWTFunctorR1GA1Imp<SR,S1,DR,D1,A1>::
make(CalleeSignature function,
     A1 a1);

static
RWTFunctorR1<SR,S1>
RWTFunctorR1GA2Imp<SR,S1,DR,D1,A1,A2>::
make(CalleeSignature function,
     A1 a1,
     A2 a2);

static
RWTFunctorR1<SR,S1>
RWTFunctorR1MImp<SR,S1,Callee,DR,D1>::
make(Callee& callee,
     CalleeSignature function);

static
RWTFunctorR1<SR,S1>
RWTFunctorR1MA1Imp<SR,S1,Callee,DR,D1,A1>::
make(Callee& callee,
     CalleeSignature function,
     A1 a1);

static
RWTFunctorR1<SR,S1>
RWTFunctorR1MA2Imp<SR,S1,Callee,DR,D1,A1,A2>::
make(Callee& callee,
     CalleeSignature function,
     A1 a1,
     A2 a2);

See Also

rwtMakeFunctorR1(), RWTFunctorR1<SR,S1>



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.