SourcePro® API Reference Guide

 
List of all members
RWTFunctor1Imp< S1 > Class Template Reference

Deprecated. Abstract base class for the family of functor bodies that are invoked with one argument and return no value. More...

#include <rw/functor/RWTFunctor1Imp.h>

Inherits RWTFunctorImpBase1< void, S1 >.

Inherited by RWTFunctor1GA1Imp< S1, DR, D1, A1 >, RWTFunctor1GA2Imp< S1, DR, D1, A1, A2 >, RWTFunctor1GImp< S1, DR, D1 >, RWTFunctor1MA1Imp< S1, Callee, DR, D1, A1 >, RWTFunctor1MA2Imp< S1, Callee, DR, D1, A1, A2 >, RWTFunctor1MImp< S1, Callee, DR, D1 >, and RWTFunctorList1Imp< S1 >.

Detailed Description

template<class S1>
class RWTFunctor1Imp< S1 >

Deprecated:
As of SourcePro 12.5, use RWTFunctor<void(S1)> 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.

RWTFunctor1Imp is the abstract base class for the family of functor bodies that are invoked with one argument and return 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 in the functor body and then 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 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:

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

Example
#include <rw/functor/RWTFunctor1GImp.h>
void foo(int);
int main(void)
{
// Create a functor that calls foo():
RWTFunctor1<int> func = RWTFunctor1GImp<int, void, int>::make(foo);
// Invoke Functor
func(7);
return 0;
}
See also
rwtMakeFunctor1(), RWTFunctor1

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