-
c_hash( int size = default[137] )
This is the default constructor for c_hash. It takes a single argument:
an integer to set the size of the internal hash table. This value can
be used to tune the performance of the hash object.
-
c_hash( const c_hash<K,V>& that )
Copy constructor for c_hash. The constructed will become a copy of
the object specified by that.
-
~c_hash( void )
Destructor for c_hash. It will deallocate all the nodes, freeing all
allocated memory.
-
virtual int find( K& key ) const
Returns true if key exists in the hash table, otherwise it returns FALSE.
-
virtual int find( const K& key, V& value ) const
Returns true, and sets value equal to the value for key, if key exists in the
hash table, otherwise it returns FALSE, and leaves value unmodified.
-
virtual int find( c_map_pair<K,V>& pair ) const
Returns true, and sets pair.m_value equal to the value for pair.m_key,
if pair.m_key exists in the hash table, otherwise it returns FALSE,
and leaves pair.m_valuevalue unmodified.
-
virtual int exists( c_map_pair<K,V>& pair ) const
Returns true if key exists in the hash table, otherwise it returns FALSE.
-
virtual int add( const K& key )
Adds a new key to the table, leaving the value for the node blank.
-
virtual int add( const K& key V& value )
Adds a new key to the table, setting the value for the node to the
argument given.
-
virtual int add( c_map_pair<K,V>& pair )
Adds a new key to the table, setting the value for the node to pair.m_value.
-
virtual int get_count( void ) const
Returns a count of the number of elements in the hash.
-
virtual int remove_all( void )
Removes all the nodes from the hash table. This frees allocated memory for all the
nodes.
-
virtual int clear_values( void )
Iterates through the entire hash table, setting the value of each node
equal to a default VALUE object.
-
virtual c_collection_iter<c_map_pair<K,V>>* prepare_iter(
const enum collection_sorting_order ord = raw_order ) const
virtaul int first( c_collection_iter<c_map_pair<K,V>>* iter,
c_map_pair<K,V>& pair ) const
virtaul int next( c_collection_iter<c_map_pair<K,V>>* iter,
c_map_pair<K,V>& pair ) const
virtaul int prev( c_collection_iter<c_map_pair<K,V>>* iter,
c_map_pair<K,V>& pair ) const
virtaul int last( c_collection_iter<c_map_pair<K,V>>* iter,
c_map_pair<K,V>& pair ) const
virtaul int complete_iter( c_collection_iter<c_map_pair<K,V>>* iter )
These functions are c_hash's implementation of the c_collection interface.
-
virtual const c_hash<K,V> operator=( const c_hash<K,V>& right )
Assignment operator for c_hash. The lvalue is emptied, all memory freed, and it then
makes itself a copy of the rvalue.
|