SourcePro® API Reference Guide

 
List of all members
RWTFunctorR2Imp< SR, S1, S2 > Class Template Reference

Deprecated. Abstract base class for the family of functor bodies that are invoked with two arguments and return a value. More...

#include <rw/functor/RWTFunctorR2Imp.h>

Inherits RWTFunctorImpBase2< SR, S1, S2 >.

Inherited by RWTFunctorR2GA1Imp< SR, S1, S2, DR, D1, D2, A1 >, RWTFunctorR2GA2Imp< SR, S1, S2, DR, D1, D2, A1, A2 >, RWTFunctorR2GImp< SR, S1, S2, DR, D1, D2 >, RWTFunctorR2MA1Imp< SR, S1, S2, Callee, DR, D1, D2, A1 >, RWTFunctorR2MA2Imp< SR, S1, S2, Callee, DR, D1, D2, A1, A2 >, and RWTFunctorR2MImp< SR, S1, S2, Callee, DR, D1, D2 >.

Detailed Description

template<class SR, class S1, class S2>
class RWTFunctorR2Imp< SR, S1, S2 >

Deprecated:
As of SourcePro 12.5, use RWTFunctor<SR(S1, S2)> instead.

A function object, or a functor, encapsulates a call to an associated global or member function. When a functor is invoked, it calls the associated function.

RWTFunctorR2Imp is the abstract base class for the family of functor bodies that are invoked with two arguments and return a value.

Each derived class name appends either a G (for global) or an M (for member), to indicate whether 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:

These concrete classes are templatized on the signature of the function that is encapsulated, as well as 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:

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 RWTFunctorR2 handle.

Example
#include <rw/functor/RWTFunctorR2GImp.h>
int foo(int, float);
int main(void)
{
// Create a functor that calls foo():
RWTFunctorR2GImp<int, int, float, int, int, float>::make(foo);
// Invoke functor
int result = func(7, 0.5);
return 0;
}
See also
rwtMakeFunctorR2(), RWTFunctorR2

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.