Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTFunctorMapR2


RWTFunctorMapR2 RWTFunctorR2<SR,Key,S1>

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

Data Types

Member Functions

Package

Functor Map, subpackage of Functor

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 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

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


Previous fileTop of DocumentContentsIndexNext file

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