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

RWTFunctor1<S1>

Module:  Threads   Package:  Functor


RWTFunctor1<S1> RWHandleBase

Local Index

Members

Header File

#include <rw/functor/functor1.h>

Description

RWTFunctor1<S1> represents the group of functors that are invoked with one argument, 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 RWTFunctor1 act as handles to functor implementations or bodies. Such implementations are created by using either the rwtMakeFunctor1() 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 one argument, 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, see the RWTFunctorR2 group of classes.

Example

Public Typedefs

typedef S1 S1Type;
typedef void (*CallerSignature)(S1);

Public Constructors

RWTFunctor1();
RWTFunctor1(RWStaticCtor);
RWTFunctor1(RWTFunctor1Imp<S1>* functorInp);
RWTFunctor1(const RWTFunctor1<S1>& second);

Public Destructor

~RWTFunctor1();

Public Member Operators

RWTFunctor1<S1>& 
operator=(const RWTFunctor1<S1>& second);
void 
operator()(S1 s1) const;

Protected Member Function

RWTFunctor1Imp<S1>&
body() const;

See Also

rwtMakeFunctor1()



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.