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

RWTFunctorMapR2

Module:  Threads   Package:  Functor Map, subpackage of Functor


RWTFunctorMapR2 RWTFunctorR2<SR,Key,S1>

Local Index

Members

Header File

#include <rw/functor/map/RWTFunctorMapR2.h>

Description

The RWTFunctorMapR2 class represents the functor maps that take two arguments at invocation time, and return a value. Since one of these arguments is the key into the map, the functors that are held in the map take only one argument; they are RWTFunctorR1 functors.

Functor maps allow functors to be grouped together in a key/value table structure. They add functors to the map with a corresponding key of type key_type, later using it to invoke the desired functor.

Example

Public Typedefs

typedef Key key_type;
typedef unsigned  (*hash_function)(const Key&);

Public Constructors

RWTFunctorMapR2(hash_function hf, 
                size_t size = RW_FUNCTOR_MAP_CAPACITY);
RWTFunctorMapR2(const RWTFunctorMapR2<SR,key_type,S1>& second);

Public Destructor

~RWTFunctorMapR2();

Public Operators

RWTFunctorMapR2<SR,key_type,S1>& 
operator=(const RWTFunctorMapR2<SR,key_type,S1>& second);
SR 
operator()(key_type key, S1 s1) const;

Public Member Functions

bool 
add(key_type key, RWTFunctorR1<SR,S1> functor);
void 
clear();
bool 
contains(key_type key) const; 
size_t 
entries() const;
bool 
find(key_type key, RWTFunctorR1<SR,S1>& functor) const;
RWTFunctorR1<SR,S1> 
getDefault() const;
bool 
remove(key_type key);
void 
resize(size_t size);
void 
setDefault(RWTFunctorR1<SR,S1> functor);


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.