SourcePro® API Reference Guide

 
List of all members
RWFunctor0Imp Class Reference

Deprecated. Abstract base class for functor body classes that are invoked with no caller arguments and return no value. More...

#include <rw/functor/RWFunctor0Imp.h>

Inherits RWTFunctorImpBase0< void >.

Inherited by RWFunctorList0Imp, RWTFunctor0GA1Imp< DR, A1 >, RWTFunctor0GA2Imp< DR, A1, A2 >, RWTFunctor0GA3Imp< DR, A1, A2, A3 >, RWTFunctor0GImp< DR >, RWTFunctor0MA1Imp< Callee, DR, A1 >, RWTFunctor0MA2Imp< Callee, DR, A1, A2 >, RWTFunctor0MA3Imp< Callee, DR, A1, A2, A3 >, and RWTFunctor0MImp< Callee, DR >.

Detailed Description

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.

Class RWFunctor0Imp is the abstract base class for functor bodies that are invoked with no caller arguments and return no value. These functor classes can accept up to three client data arguments at construction time, which are passed to the function each time the functor is invoked.

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, A2, or A3, to indicate that it takes callee arguments at construction time. These arguments are stored in the functor body and passed to the function at invocation time.

The eight 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 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.

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

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