Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

suif_hash_map Class Reference

a map function based on a hash table. More...

#include <common/suif_hash_map.h>

Inheritance diagram for suif_hash_map:

suif_hash_map_inner List of all members.

Public Types

typedef literator iterator
typedef const literator const_iterator
typedef pair value_type
typedef domain key_type
typedef range data_type

Public Methods

pairenter_value (domain x,range y)
 Enter a value into the table with key x and value y.

iterator find (const domain &x) const
 Find an entry by key. More...

range lookup (const domain &x)
 Similar to find() except returning the associated value. More...

iterator begin ()
 Get an iterator to iterate over the values. More...

const_iterator begin () const
iterator end ()
const_iterator end () const
void erase (iterator &iter)
 Remove item from table.

 suif_hash_map (int size = 32)
 Create hash table. More...

 ~suif_hash_map ()
iterator insert (iterator &x,const pair &p)
 Insert a value. More...

unsigned size () const
 Return number of entries in table.

void clear ()
 Clear the table.


Detailed Description

template<class domain, class range> class suif_hash_map

a map function based on a hash table.

See also:
suif_map


Member Typedef Documentation

template<class domain, class range>
typedef const literator suif_hash_map<domain, range>::const_iterator

template<class domain, class range>
typedef range suif_hash_map<domain, range>::data_type

template<class domain, class range>
typedef literator suif_hash_map<domain, range>::iterator

template<class domain, class range>
typedef domain suif_hash_map<domain, range>::key_type

template<class domain, class range>
typedef pair suif_hash_map<domain, range>::value_type


Constructor & Destructor Documentation

template<class domain, class range>
suif_hash_map<domain, range>::suif_hash_map<domain, range> (
int size = 32)

Create hash table.

Parameters:
size   the size of the hash table to use. This will be rounded up to a power of 2

template<class domain, class range>
suif_hash_map<domain, range>::~suif_hash_map<domain, range> () [inline]


Member Function Documentation

template<class domain, class range>
const_iterator suif_hash_map<domain, range>::begin () const [inline]

Reimplemented from suif_hash_map_inner.

template<class domain, class range>
iterator suif_hash_map<domain, range>::begin () [inline]

Get an iterator to iterate over the values.

Warning:
{The order is not specified. In particular it cannot be expected that it will be the order in which the values were entered}

template<class domain, class range>
void suif_hash_map<domain, range>::clear (
void) [inline]

Clear the table.

Reimplemented from suif_hash_map_inner.

template<class domain, class range>
const_iterator suif_hash_map<domain, range>::end () const [inline]

Reimplemented from suif_hash_map_inner.

template<class domain, class range>
iterator suif_hash_map<domain, range>::end () [inline]

template<class domain, class range>
pair & suif_hash_map<domain, range>::enter_value (
domain x,
range y) [inline]

Enter a value into the table with key x and value y.

template<class domain, class range>
void suif_hash_map<domain, range>::erase (
iterator & iter) [inline]

Remove item from table.

template<class domain, class range>
iterator suif_hash_map<domain, range>::find (
const domain & x) const [inline]

Find an entry by key.

Returns end() if not found

template<class domain, class range>
iterator suif_hash_map<domain, range>::insert (
iterator & x,
const pair & p) [inline]

Insert a value.

The iterator value is ignored.

template<class domain, class range>
range suif_hash_map<domain, range>::lookup (
const domain & x) [inline]

Similar to find() except returning the associated value.

assert if no value associated with the key in ths map.

template<class domain, class range>
unsigned suif_hash_map<domain, range>::size () const [inline]

Return number of entries in table.

Reimplemented from suif_hash_map_inner.


The documentation for this class was generated from the following file:
Generated at Mon Jul 31 13:44:37 2000 for NCI SUIF by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000