Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

8.2 Functor Class Hierarchy

The Functor package consists of a sizable family of template classes designed to accommodate global, static, and member function calls with varying numbers of arguments, as shown in Figure 50 and Figure 51. Like many other Threads Module 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 50: Hierarchy of functor classes for functions whose return values are ignored

Figure 51: Hierarchy of functor classes for functions with return values

8.2.1 Class Naming Conventions

The base name for functor classes is RWTFunctor, for templatized classes, or RWFunctor, for the few non-templatized classes. Body class names end in Imp. Both handle and body class names are constructed by adding characters that encode information about the functor to the base name. These codes will make more sense as you go through the rest of the chapter.

Body class names also include additional characters that encode and identify the function type and number of additional arguments accepted by the function. This sequence consists of the following elements:

8.2.2 Template Parameter Naming Conventions

The classes in the hierarchies include formal template parameters that represent argument types and return types. These parameters include:

DR — The declared return type of the encapsulated function.

D1 — The declared type of the encapsulated function's first argument.

D2 — The declared type of the encapsulated function's second argument.

SR — The return type of the functor.

S1 — The type of the functor's first argument.

S2 — The type of the functor's second argument.

Callee — The type of object on which the encapsulated function is invoked, if it is a member function.

A1 — The type of the first callee argument added to the function invocation by the functor.

A2 — The type of the second callee argument added to the function invocation by the functor.

A3 — The type of the third callee argument added to the function invocation by the functor, only available for functors with no caller arguments.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.