Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTFunctorMapR1


RWTFunctorMapR1 RWTFunctorR1

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/RWTFunctorMapR1.h";

Description

The RWTFunctorMapR1 class represents the functor maps that take only one argument at invocation time, and return a value. Since this one argument is the key into the map, the functors that are held in the map do not take any arguments at all; they are RWTFunctorR0s.

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

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

Public Operators

RWTFunctorMapR1<SR,key_type>& 
operator=(const RWTFunctorMapR1<SR,key_type>& second);
SR 
operator()(key_type key) const;

Public Member Functions

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


Previous fileTop of DocumentContentsIndexNext file

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