Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

CNHashStatic Class Reference

The class CNHashStatic provides a hash table with static capacity for storing and retrieving CNCL compatible objects. More...

#include <HashStatic.h>

Inheritance diagram for CNHashStatic::

CNHashTable CNObject CNCL List of all members.

Public Methods

virtual void store_key (CNKey *k)
 Stores a key into the homogenous hash table. More...

virtual void store_key (CNKey &k)
 Stores a key into the homogenous hash table. More...

virtual CNKeyget_key (const CNKey *k) const
 Detects Keys of the same type.

virtual CNKeyget_key (const CNKey &k) const
 Detects Keys of the same type and returns them.

virtual CNObjectget_object (const CNKey *k) const
 Detects Objects of the same type.

virtual CNObjectget_object (const CNKey &k) const
 Detects Objects of the same type and returns them.

virtual bool reset ()
 Resets the hash table to the behinning parameter.

virtual bool reset_absolutely ()
 Deletes all entries of the actual hash table and resets it to its initial state. More...

virtual bool reset_absolutely_w_obj ()
 Deletes all entries of the actual hash table and resets it to its initial state. More...

virtual bool delete_key (const CNKey *k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool delete_key (const CNKey &k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool delete_key_absolutely (const CNKey *k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool delete_key_absolutely (const CNKey &k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool delete_key_absolutely_w_obj (const CNKey *k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool delete_key_absolutely_w_obj (const CNKey &k)
 Deletes the key from the actual hash table which matches the given key. More...

virtual bool is_full () const
 If the actual table's capacityis exhausted, TRUE s returned, otherwise FALSE.

virtual bool is_empty () const
 If the actual table is empty, TRUE is returned, otherwise FALSE.

virtual unsigned long get_capacity () const
 Returns the capacity of the current table.

virtual unsigned long get_num_entries () const
 Returns the number of entries of the actual table.

 CNHashStatic (unsigned long cap=DEFAULT_HASH_TABLE_CAPACITY)
 Default constructor. More...

 CNHashStatic (CNParam *param)
 Initializes CNHashStatic with CNParam.

 ~CNHashStatic ()
 Default Destructor.

virtual CNClassDesc class_desc () const
 Returns the class description (pointer to instance of CNClass) for runtime type information.

virtual bool is_a (CNClassDesc desc) const
 Checks type.

virtual void print (ostream &strm=cout) const
 Print output.

virtual void dump (ostream &strm=cout) const
 Debug output.


Static Public Methods

CNHashStatic * cast_from_object (CNObject *obj)
 Safes type Cast.

CNObjectnew_object (CNParam *param=NIL)
 Creates new Object.


Protected Methods

HashEntry * HashTable () const
 FIXME: Undocumented.


Friends

class CNHashIterator

Detailed Description

The class CNHashStatic provides a hash table with static capacity for storing and retrieving CNCL compatible objects.


Constructor & Destructor Documentation

CNHashStatic::CNHashStatic unsigned long    cap = DEFAULT_HASH_TABLE_CAPACITY
 

Default constructor.

The hash table capacity is set to the value passed to CNHashStatic. The capacity is static, therefore, you cannot change it during the lifetime of an instance of this class.


Member Function Documentation

virtual bool CNHashStatic::delete_key const CNKey   k [inline, virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed, i.e. the positions of all entries within the hash table are recalculated and all entries are stored in a new hash table. This might lead to small time delays when handling large hash tables. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::delete_key const CNKey   k [virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed, i.e. the positions of all entries within the hash table are recalculated and all entries are stored in a new hash table. This might lead to small time delays when handling large hash tables. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::delete_key_absolutely const CNKey   k [inline, virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::delete_key_absolutely const CNKey   k [virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::delete_key_absolutely_w_obj const CNKey   k [inline, virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::delete_key_absolutely_w_obj const CNKey   k [virtual]
 

Deletes the key from the actual hash table which matches the given key.

After having deleted a key from the hash table, the whole table is rehashed. This method does not free the memory allocated for the keys stored in the hash table. If the supplied key does not match any in the table, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::reset_absolutely   [virtual]
 

Deletes all entries of the actual hash table and resets it to its initial state.

This method does not free the memory allocated for the keys stored in the hash table or the objects stored in the keys. If the hash table is already empty, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual bool CNHashStatic::reset_absolutely_w_obj   [virtual]
 

Deletes all entries of the actual hash table and resets it to its initial state.

This method frees the memory allocated for the keys stored in the hash table or the objects stored in the keys. If the hash table is already empty, FALSE is returned, otherwise TRUE.

Reimplemented from CNHashTable.

virtual void CNHashStatic::store_key CNKey   k [inline, virtual]
 

Stores a key into the homogenous hash table.

Only keys of the same type may be stored into the same table. The methods get_key() und get_object() should detect it. If you try to store a key into an already full table, an error message is displayed and the program is terminated.

Reimplemented from CNHashTable.

virtual void CNHashStatic::store_key CNKey   k [virtual]
 

Stores a key into the homogenous hash table.

Only keys of the same type may be stored into the same table. The methods get_key() und get_object() should detect it. If you try to store a key into an already full table, an error message is displayed and the program is terminated.

Reimplemented from CNHashTable.


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 19:55:37 2002 for CNCL by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001