Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

HASH Class Reference

#include <hash.H>

Collaboration diagram for HASH:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HASH (int size)
 HASH (const HASH &hash_table)
 ~HASH ()
void clear ()
int add (long key, void *data)
int add (const char *key, void *data)
int add (const char *key, void *data, char *&loc, int create_new=1)
int add (const char *key, char *&loc)
int del (long key)
void * find (long key) const
void * find (char *key) const
void ** find_addr (long key) const
int bfind (long key, void *&data) const
void get_items (ARRAY< long > &keys, ARRAY< void * > &data) const
double load_factor () const

Private Member Functions

hash_node ** table () const
int hash (const long key) const
long hash (const char *) const
int next_seq (long &key, void *&data, hash_node *&seq_elt, int &seq_val) const

Private Attributes

int _size
hash_node ** _table
int _mask
int _seq_val
int _lastval

Detailed Description

Definition at line 29 of file hash.H.


Constructor & Destructor Documentation

HASH::HASH int  size  ) 
 

Definition at line 27 of file hash.C.

References _lastval, _mask, _size, _table, and RIGHT_BITS_TO_DROP.

HASH::HASH const HASH hash_table  ) 
 

Definition at line 59 of file hash.C.

References _size, _table, and table().

HASH::~HASH  ) 
 

Definition at line 81 of file hash.C.

References _table, and clear().


Member Function Documentation

int HASH::add const char *  key,
char *&  loc
[inline]
 

Definition at line 51 of file hash.H.

References _lastval, and add().

int HASH::add const char *  key,
void *  data,
char *&  loc,
int  create_new = 1
 

Definition at line 220 of file hash.C.

References hash_node::data(), hash(), hash_node::key(), hash_node::next(), and table().

int HASH::add const char *  key,
void *  data
[inline]
 

Definition at line 49 of file hash.H.

References add().

int HASH::add long  key,
void *  data
 

Definition at line 102 of file hash.C.

References hash_node::data(), hash(), hash_node::key(), hash_node::next(), and table().

Referenced by hashdist::add(), add(), VIEWint_list::add(), DATA_ITEM::add_decoder(), BMESHobs::bmesh_obs_list(), DISPobs::disp_obs_list(), TexMemRefImage::lookup(), IDRefImage::lookup(), RefImage2::lookup(), RefImage::lookup(), BufferRefImage::lookup(), BaseVisRefImage::lookup(), AuxRefImage::lookup(), operator>>(), STR::STR(), and XFORMobs::xform_obs_list().

int HASH::bfind long  key,
void *&  data
const
 

Definition at line 191 of file hash.C.

References hash_node::data(), hash(), hash_node::key(), hash_node::next(), and table().

void HASH::clear  ) 
 

Definition at line 333 of file hash.C.

References _size, _table, and hash_node::next().

Referenced by operator>>(), and ~HASH().

int HASH::del long  key  ) 
 

Definition at line 131 of file hash.C.

References hash(), hash_node::key(), hash_node::next(), and table().

Referenced by hashdist::del(), VIEWint_list::del(), and hashdist::del_hash_items().

void * HASH::find char *  key  )  const
 

Definition at line 253 of file hash.C.

References hash_node::data(), hash(), hash_node::key(), hash_node::next(), and table().

void* HASH::find long  key  )  const [inline]
 

Definition at line 53 of file hash.H.

References find_addr().

Referenced by BMESHobs::bmesh_obs_list(), DISPobs::disp_obs_list(), hashdist::find(), VIEWint_list::find(), TexMemRefImage::lookup(), IDRefImage::lookup(), RefImage2::lookup(), RefImage::lookup(), DATA_ITEM::lookup(), BufferRefImage::lookup(), BaseVisRefImage::lookup(), AuxRefImage::lookup(), and XFORMobs::xform_obs_list().

void ** HASH::find_addr long  key  )  const
 

Definition at line 162 of file hash.C.

References hash_node::data_ptr(), hash(), hash_node::key(), hash_node::next(), and table().

Referenced by find().

void HASH::get_items ARRAY< long > &  keys,
ARRAY< void * > &  data
const
 

Definition at line 267 of file hash.C.

References ARRAY< T >::clear(), and next_seq().

Referenced by hashdist::del_hash_items().

long HASH::hash const char *   )  const [private]
 

Definition at line 314 of file hash.C.

References hash().

int HASH::hash const long  key  )  const [inline, private]
 

Definition at line 17 of file hash.C.

References _mask, and RIGHT_BITS_TO_DROP.

Referenced by add(), bfind(), del(), find(), find_addr(), and hash().

double HASH::load_factor  )  const
 

Definition at line 348 of file hash.C.

References _size, _table, and hash_node::next().

Referenced by STR::load_factor().

int HASH::next_seq long &  key,
void *&  data,
hash_node *&  seq_elt,
int &  seq_val
const [private]
 

Definition at line 288 of file hash.C.

References _size, hash_node::data(), hash_node::key(), hash_node::next(), and table().

Referenced by get_items().

hash_node** HASH::table  )  const [inline, private]
 

Definition at line 35 of file hash.H.

References _table.

Referenced by add(), bfind(), del(), find(), find_addr(), HASH(), and next_seq().


Member Data Documentation

int HASH::_lastval [private]
 

Definition at line 36 of file hash.H.

Referenced by add(), and HASH().

int HASH::_mask [private]
 

Definition at line 33 of file hash.H.

Referenced by HASH(), and hash().

int HASH::_seq_val [private]
 

Definition at line 34 of file hash.H.

int HASH::_size [private]
 

Definition at line 31 of file hash.H.

Referenced by clear(), HASH(), load_factor(), and next_seq().

hash_node** HASH::_table [private]
 

Definition at line 32 of file hash.H.

Referenced by clear(), HASH(), load_factor(), table(), and ~HASH().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:45:57 2006 for jot by  doxygen 1.4.4