nis-util  1.0.D108
Data Structures | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
symtab Class Reference

#include <symtab.h>

Data Structures

struct  row_ty
struct  walk_t

Public Types

typedef std::vector< rcstringkey_list_t

Public Member Functions

virtual ~symtab ()
 symtab ()
void * query (const rcstring &name) const
void assign (const rcstring &name, void *value)
void remove (const rcstring &name)
void dump (const char *caption) const
void walk (walk_t &)
key_list_t keys () const
void set_reaper (void(*)(void *))

Private Types

typedef rcstring::hash_ty hash_ty

Private Member Functions

 symtab (const symtab &)
symtaboperator= (const symtab &)
void split (void)

Private Attributes

void(* reap )(void *)
row_ty ** hash_table
hash_ty hash_modulus
hash_ty hash_cutover
hash_ty hash_cutover_mask
hash_ty hash_cutover_split_mask
hash_ty hash_split
hash_ty hash_load

Detailed Description

The symtab class is used to represent a symbol table. The indexes are strings, the data may be arbitrary pointers. Access times are O(1).

Definition at line 29 of file symtab.h.


Member Typedef Documentation

Definition at line 64 of file symtab.h.

typedef std::vector<rcstring> symtab::key_list_t

Definition at line 106 of file symtab.h.


Constructor & Destructor Documentation

symtab::~symtab ( ) [virtual]

The destructor.

Definition at line 27 of file symtab.cc.

The default constructor.

Definition at line 45 of file symtab.cc.

symtab::symtab ( const symtab ) [private]

The copy constructor. Do not use.


Member Function Documentation

void symtab::assign ( const rcstring name,
void *  value 
)

The assign method is used to assign a value to a given variable.

Definition at line 143 of file symtab.cc.

void symtab::dump ( const char *  caption) const

The dump method is used to dump the contents of the symbol table. The caption will be used to indicate why the symbol table was dumped.

Definition at line 199 of file symtab.cc.

The keys method is used to get a list of the keys in the symbol table. This in turn may be used to iterate across all of the values in the symbol table.

Definition at line 229 of file symtab.cc.

symtab& symtab::operator= ( const symtab ) [private]

The assignment operator. Do not use.

void * symtab::query ( const rcstring name) const

The query method is used to reference a variable.

Returns:
If the variable has been defined, the function returns a non-zero value and the value is returned through the 'value' pointer. If the variable has not been defined, it returns zero, and 'value' is unaltered.

Definition at line 127 of file symtab.cc.

void symtab::remove ( const rcstring name)

Definition at line 172 of file symtab.cc.

void symtab::set_reaper ( void(*)(void *)  fp)

The set_reaper method is used to set the reaper function to be used when destroying data. The default is to do nothing.

Definition at line 241 of file symtab.cc.

void symtab::split ( void  ) [private]

The split method is used to split symbols in the bucket indicated by the split point. The symbols are split between that bucket and the one after the current end of the table.

Definition at line 65 of file symtab.cc.

void symtab::walk ( walk_t arg)

Definition at line 220 of file symtab.cc.


Field Documentation

Definition at line 66 of file symtab.h.

Definition at line 67 of file symtab.h.

Definition at line 68 of file symtab.h.

Definition at line 70 of file symtab.h.

Definition at line 65 of file symtab.h.

Definition at line 69 of file symtab.h.

Definition at line 63 of file symtab.h.

void(* symtab::reap)(void *) [private]

Definition at line 62 of file symtab.h.


The documentation for this class was generated from the following files: