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

RWTFunctorMapR1

Module:  Threads   Package:  Functor Map, subpackage of Functor


RWTFunctorMapR1 RWTFunctorR1

Local Index

Members

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 Destructor

~RWTFunctorMapR1();

Public Operators

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

Public Member Functions

bool 
add(key_type key, RWTFunctorR0<SR> functor);
bool 
contains(key_type key) const;
bool 
find(key_type key, RWTFunctorR0<SR>& functor) const;
bool 
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 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.