SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTFunctor2Imp< S1, S2 > Class Template Reference

Deprecated. Abstract base class for the family of functor bodies that are invoked with two caller arguments and whose invocation returns no value. More...

#include <rw/functor/RWTFunctor2Imp.h>

Inherits RWTFunctorImpBase2< void, S1, S2 >.

Inherited by RWTFunctor2GA1Imp< S1, S2, DR, D1, D2, A1 >, RWTFunctor2GA2Imp< S1, S2, DR, D1, D2, A1, A2 >, RWTFunctor2GImp< S1, S2, DR, D1, D2 >, RWTFunctor2MA1Imp< S1, S2, Callee, DR, D1, D2, A1 >, RWTFunctor2MA2Imp< S1, S2, Callee, DR, D1, D2, A1, A2 >, RWTFunctor2MImp< S1, S2, Callee, DR, D1, D2 >, and RWTFunctorList2Imp< S1, S2 >.

Detailed Description

template<class S1, class S2>
class RWTFunctor2Imp< S1, S2 >
Deprecated
As of SourcePro 12.5, use RWTFunctor<R(As...)> 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.

RWTFunctor2Imp is the abstract base class for the family of functor bodies that are invoked with two caller arguments, and whose invocation returns no 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 at construction that it takes callee arguments. These arguments are stored and added to the caller arguments at invocation time.

The six concrete class names are:

  • RWTFunctor2GImp<S1,S2,DR,D1,D2>
    • No this object, no callee arguments
  • RWTFunctor2GA1Imp<S1,S2,DR,D1,D2,A1>
    • No this object, one callee argument
  • RWTFunctor2GA2Imp<S1,S2,DR,D1,D2,A1,A2>
    • No this object, two callee arguments
  • RWTFunctor2MImp<S1,S2,Callee,DR,D1,D2>
    • Has this object, but no callee arguments
  • RWTFunctor2MA1Imp<S1,S2,Callee,D1,D2,DR,A1>
    • Has this object, one callee arguments
  • RWTFunctor2MA2Imp<S1,S2,Callee,DR,D1,D2,A1,A2>
    • Has this object, two callee arguments 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:

  • S1      The type of the first functor signature argument
  • S2      The type of the second functor signature argument
  • Callee  The class type that declares a member function
  • DR      The return type of the function
  • D1      The type of the first function signature argument; the compiler must be able to convert to this from the S1 type.
  • D2      The type of the second function signature argument; the compiler must be able to convert to this from the S2 type.
  • A1      The type of the first client data argument
  • A2      The type of the second client data argument

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 rwtMakeFunctor2() convenience mechanisms. All other members must be accessed through an RWTFunctor2 handle.

Example
#include <rw/functor/RWTFunctor2GImp.h>
void foo(int, float);
int main(void) {
// Create a functor that calls foo():
RWTFunctor2GImp<int, float, void, int, float>::make(foo);
// Invoke functor
func(7, 1.0);
return 0;
}
Deprecated. A functor that is invoked with two arguments, and whose invocation returns no value.
Definition RWTFunctor2.h:146
See also
rwtMakeFunctor2(), RWTFunctor2

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