Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTFunctor2<S1,S2>


RWTFunctor2<S1,S2> RWHandleBase

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Data Types

Member Functions

Package

Functor

Header File

#include <rw/functor/functor2.h>

Description

RWTFunctor2<S1,S2> represents the group of functors that are invoked with two arguments, and whose invocation returns no value.

A function object, or a functor, is an object that encapsulates a call to an associated global or member function. When a functor is invoked, it calls the associated function.

Instances of class RWTFunctor2 act as handles to functor implementations or bodies. Such implementations are created by using either the rwtMakeFunctor2() global functions or macros. Each of these methods creates a new body instance, and returns the handle to that instance. See the example below.

Note that although an instance of this class is invoked with two arguments, and returns no value, the encapsulated function may have more arguments and a return value.

The additional arguments that will be passed to the encapsulated function are provided to the functor at the time of creation. They are stored within the functor object, and are retrieved at the time of invocation.

Any return value that the function may have will be ignored by the functor, and hence not passed back to the user. (If you are interested in the function's return value, you should probably be using the RWTFunctorR1 group of classes.)

Example

Public Constructors

RWTFunctor2(void);
RWTFunctor2(RWStaticCtor);
RWTFunctor2(const RWTFunctor2<S1,S2>& second);

Public Typedefs

typedef S1 S1Type;
typedef S2 S2Type;
typedef void (*CallerSignature)(S1,S2);

Public Operators

RWTFunctor2<S1, S2>& 
operator=(const RWTFunctor2<S1,S2>& second);
void 
operator()(S1 s1, S2 s2) const;

See Also

rwtMakeFunctor2



Previous fileTop of DocumentContentsIndexNext file

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