Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.3 Functor Package

2.3.1 Description

The Functor2 package includes two subpackages, Functor List and Functor Map. For complete information about the Functor package, see Chapter 8 of the Threads.h++ User's Guide.

2.3.2 Functor Class Hierarchy

The Functor package contains a large family of template classes designed to accommodate global, static, and member function calls with varying numbers of arguments, as shown in Figure 2 and Figure 3. Like many other Threads.h++ packages, the Functor package uses the handle-body idiom. In the hierarchies, the handle classes are on the left and the matching sets of body classes are on the right.

Figure 2 -- Hierarchy of functor classes for functions whose return values are ignored

Figure 3 -- Hierarchy of functor classes for functions with return values

2.3.3 Functor List Class Hierarchy

The Functor List subpackage is made up of classes designed for creating functors which are themselves lists of functors to be invoked in turn. Functor list classes are an extension to the functor class hierarchy, as shown in Figure 4.

Figure 4 -- Hierarchy of functor list classes and the functor classes from which they derive

Class names are constructed from the base name RWTFunctorList for templatized classes or RWFunctorList for the few non-templatized classes by adding 0, 1 or 2 for the number of caller arguments.

The formal template parameters (shown in the hierarchy) include:

S1 - The type of the functor list's first argument.

S2 - The type of the functor list's second argument.


NOTE: Functor lists do not provide R0, R1, or R2 classes.

2.3.4 Functor Map Class Hierarchy

The Functor Map subpackage is made up of classes designed for creating functors which are themselves a collection of functors, one of which is to be invoked according to a given key. Functor map classes are an extension to the functor class hierarchy, as shown in Figure 5.

Figure 5 -- Hierarchy of functor map classes and the functor classes from which they derive

Class names are constructed from the base name RWTFunctorMap by adding 1 or 2 for the number of caller arguments and an optional R if the map returns a value. Because every functor map invocation requires a key, there is no RWTFunctorMap0.

The formal template parameters (shown in the hierarchy) include:

SR - The type of the functor map's return value

Key - The type of the functor map's key (which is the functor map's first argument)

S1 - The type of the encapsulated functor's first argument (which is the functor map's second argument)

2.3.5 Index of Classes

Table 3 contains an alphabetical listing of the public classes and global functions and macros in the Functor package.

Table 3 -- Index of Functor Classes 

 
Class NameDescription
RWFunctor0
The handle class for functors that are invoked without any caller arguments, and whose invocation returns no value.
RWFunctor0Imp
The abstract base class for functor bodies that are invoked without any caller arguments, and whose invocation returns no value.
RWTFunctor0GA1Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a global function that takes one callee argument and whose return value is ignored.
RWTFunctor0GA2Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a global function that takes two callee arguments and whose return value is ignored.
RWTFunctor0GA3Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a global function that takes three callee arguments and whose return value is ignored.
RWTFunctor0GImp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a global function that takes no callee arguments.
RWTFunctor0MA1Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a member function that takes one callee argument and whose return value is ignored.
RWTFunctor0MA2Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a member function that takes two callee arguments and whose return value is ignored.
RWTFunctor0MA3Imp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a member function that takes three callee arguments and whose return value is ignored.
RWTFunctor0MImp
The body class for functors that:
  • Take no caller arguments.
  • Encapsulate a member function that takes no callee arguments and whose return value is ignored.
RWTFunctor1
The handle class for functors that are invoked with one caller argument.
RWTFunctor1GA1Imp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a global function that takes one additional callee argument and whose return value is ignored.
RWTFunctor1GA2Imp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a global function that takes two additional callee arguments and whose return value is ignored.
RWTFunctor1GImp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a global function that takes no additional callee arguments and whose return value is ignored.
RWTFunctor1Imp
The abstract base class for functor bodies that are invoked with one caller argument.
RWTFunctor1MA1Imp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a member function that takes one additional callee argument and whose return value is ignored.
RWTFunctor1MA2Imp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a member function that takes two additional callee arguments and whose return value is ignored.
RWTFunctor1MImp
The body class for functors that:
  • Take one caller argument.
  • Encapsulate a member function that takes no additional callee arguments and whose return value is ignored.
RWTFunctor2
The handle class for functors that are invoked with two caller arguments.
RWTFunctor2GA1Imp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a global function that takes one additional callee argument and whose return value is ignored.
RWTFunctor2GA2Imp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a global function that takes two additional callee arguments and whose return value is ignored.
RWTFunctor2GImp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a global function that takes no additional callee arguments and whose return value is ignored.
RWTFunctor2Imp
The abstract base class for functor bodies that are invoked with two caller arguments.
RWTFunctor2MA1Imp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a member function that takes one additional callee argument and whose return value is ignored.
RWTFunctor2MA2Imp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a member function that takes two additional callee arguments and whose return value is ignored.
RWTFunctor2MImp
The body class for functors that:
  • Take two caller arguments.
  • Encapsulate a member function that takes no additional callee arguments and whose return value is ignored.
RWTFunctorR0
The handle class for functor bodies that are invoked with no caller arguments and return a value.
RWTFunctorR0GA1Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a global function that takes one callee argument.
RWTFunctorR0GA2Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a global function that takes two callee arguments.
RWTFunctorR0GA3Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a global function that takes three callee arguments.
RWTFunctorR0GImp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a global function that takes no callee arguments.
RWTFunctorR0Imp
The abstract base class for functor bodies that are invoked with no caller arguments and return a value.
RWTFunctorR0MA1Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a member function that takes one callee argument.
RWTFunctorR0MA2Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a member function that takes two callee arguments.
RWTFunctorR0MA3Imp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a member function that takes three callee arguments.
RWTFunctorR0MImp
The body class for functors that:
  • Take no caller arguments.
  • Return a value.
  • Encapsulate a member function that takes no callee arguments.
RWTFunctorR1
  • The handle class for functor bodies that are invoked with one caller argument and return a value.
RWTFunctorR1GA1Imp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a global function that takes one additional callee argument.
RWTFunctorR1GA2Imp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a global function that takes two additional callee arguments.
RWTFunctorR1GImp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a global function that takes no additional callee arguments.
RWTFunctorR1Imp
The abstract base class for functor bodies that are invoked with one caller argument and return a value.
RWTFunctorR1MA1Imp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a member function that takes one additional callee argument.
RWTFunctorR1MA2Imp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a member function that takes two additional callee arguments.
RWTFunctorR1MImp
The body class for functors that:
  • Take one caller argument.
  • Return a value.
  • Encapsulate a member function that takes no additional callee arguments.
RWTFunctorR2
The handle class for functors that are invoked with two caller arguments and that return a value.
RWTFunctorR2GA1Imp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a global function that takes one additional callee argument.
RWTFunctorR2GA2Imp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a global function that takes two additional callee arguments.
RWTFunctorR2GImp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a global function that takes no additional callee arguments.
RWTFunctorR2Imp
The abstract base class for functor bodies that are invoked with two caller arguments and return a value.
RWTFunctorR2MA1Imp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a member function that takes one additional callee argument.
RWTFunctorR2MA2Imp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a member function that takes two additional callee arguments.
RWTFunctorR2MImp
The body class for functors that:
  • Take two caller arguments.
  • Return a value.
  • Encapsulate a member function that takes no additional callee arguments.
rwtMakeFunctor0
Creates an instance of RWFunctor0 from a global or member function pointer.
rwtMakeFunctor1
Creates an instance of RWFunctor1<S1> from a global or member function pointer.
rwtMakeFunctor2
Creates an instance of RWFunctor2<S1,S2> from a global or member function pointer.
rwtMakeFunctorR0
Creates an instance of RWFunctorR0<SR> from a global or member function pointer.
rwtMakeFunctorR1
Creates an instance of RWFunctorR1<SR,S1> from a global or member function pointer.
rwtMakeFunctorR2
Creates an instance of RWFunctorR2<SR,S1,S2> from a global or member function pointer.

Table 4 lists the public classes in the Functor List package.

Table 4 -- Index of Functor List classes 

 
Class NameDescription
RWFunctorList0
The functor list class that is invoked with no caller arguments.
RWTFunctorList1
The functor list class that is invoked with one caller argument.
RWTFunctorList2
The functor list class that is invoked with two caller arguments.

Table 5 lists the public classes in the Functor Map package.

Table 5 -- Index of Functor Map classes

 
Class NameDescription
RWTFunctorMap1
The functor map class that takes one argument at invocation, and returns no value.
RWTFunctorMap2
The functor map class that takes two arguments at invocation, and returns no value.
RWTFunctorMapR1
The functor map class that takes one argument at invocation, and returns a value.
RWTFunctorMapR2
The functor map class that takes two arguments at invocation, and returns a value.



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.