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

RWTFunctorMap1

Module:  Threads   Package:  Functor Map, subpackage of Functor


RWTFunctorMap1 RWTFunctor1<Key>

Local Index

Members

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 Destructor

~RWTFunctorMap1();

Public Operators

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

Public Member Functions

bool 
add(key_type key, RWFunctor0 functor);
void 
clear();
bool 
contains(key_type key) const;
size_t 
entries() const;
bool 
find(key_type key, RWFunctor0& functor) const;
RWFunctor0 
getDefault() const;
bool 
remove(key_type key);
void 
resize(size_t size);
void 
setDefault(RWFunctor0 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.