Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTFunctorMap1


RWTFunctorMap1 RWTFunctor1<Key>

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/RWTFunctorMap1.h>

Description

The RWTFunctorMap1 class represents the functor maps that take only one argument at invocation time. 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 RWFunctor0 functors.

Functor maps allow functors to be grouped together in a key/value table structure. 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

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

Public Operators

RWTFunctorMap1<key_type>& 
operator=(const RWTFunctorMap1<key_type>& second);
void 
operator()(key_type key) const;

Public Member Functions

RWBoolean 
add(key_type key, RWFunctor0 functor);
void 
clear();
RWBoolean 
contains(key_type key) const;
size_t 
entries() const;
RWBoolean 
find(key_type key, RWFunctor0& functor) const;
RWFunctor0 
getDefault() const;
Boolean 
remove(key_type key);
void 
resize(size_t size);
void 
setDefault(RWFunctor0 functor);


Previous fileTop of DocumentContentsIndexNext file

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