Edinburgh Speech Tools  2.1-release
EST_TStringHash< V > Class Template Reference

A specialised hash table for when the key is an EST_String. More...

#include <include/EST_THash.h>

Inheritance diagram for EST_TStringHash< V >:
Collaboration diagram for EST_TStringHash< V >:

Public Types

typedef EST_Hash_Pair< EST_String, V > Entry
 An entry returned by the iterator is a key value pair. More...
 
typedef EST_THash< EST_String, V >::IPointer TN_IPointer
 
typedef EST_TStructIterator< EST_THash< EST_String, V >, typename EST_THash< EST_String, V >::IPointer, EST_Hash_Pair< EST_String, V > > Entries
 Give the iterator a sensible name. More...
 
typedef EST_TRwStructIterator< EST_THash< EST_String, V >, typename EST_THash< EST_String, V >::IPointer, EST_Hash_Pair< EST_String, V > > RwEntries
 
typedef EST_String KeyEntry
 
typedef EST_THash< EST_String, V >::IPointer_k TN_IPointer_k
 Give the iterator a sensible name. More...
 
typedef EST_TIterator< EST_THash< EST_String, V >, typename EST_THash< EST_String, V >::IPointer_k, EST_StringKeyEntries
 
typedef EST_TRwIterator< EST_THash< EST_String, V >, typename EST_THash< EST_String, V >::IPointer_k, EST_StringKeyRwEntries
 
- Public Types inherited from EST_THash< EST_String, V >
typedef EST_Hash_Pair< EST_String, V > Entry
 An entry returned by the iterator is a key value pair. More...
 
typedef EST_TStructIterator< EST_THash< EST_String, V >, IPointer, EST_Hash_Pair< EST_String, V > > Entries
 Give the iterator a sensible name. More...
 
typedef EST_TRwStructIterator< EST_THash< EST_String, V >, IPointer, EST_Hash_Pair< EST_String, V > > RwEntries
 
typedef EST_String KeyEntry
 An entry returned by this iterator is just a key. More...
 
typedef EST_TIterator< EST_THash< EST_String, V >, IPointer_k, EST_StringKeyEntries
 Give the iterator a sensible name. More...
 
typedef EST_TRwIterator< EST_THash< EST_String, V >, IPointer_k, EST_StringKeyRwEntries
 

Public Member Functions

 EST_TStringHash (int size)
 Create a string hash table of size buckets. More...
 
- Public Member Functions inherited from EST_THash< EST_String, V >
 EST_THash (int size, unsigned int(*hash_function)(const EST_String &key, unsigned int size)=NULL)
 
 EST_THash (const EST_THash< EST_String, V > &from)
 Create a copy. More...
 
 ~EST_THash (void)
 Destroy the table. More...
 
void clear (void)
 Empty the table. More...
 
unsigned int num_entries (void) const
 Return the total number of entries in the table. More...
 
int present (const EST_String &key) const
 Does the key have an entry? More...
 
V & val (const EST_String &key, int &found) const
 
V & val (const EST_String &key) const
 Return the value associated with the key. More...
 
const EST_Stringkey (const V &val, int &found) const
 
const EST_Stringkey (const V &val) const
 
void copy (const EST_THash< EST_String, V > &from)
 Copy all entries. More...
 
void map (void(*func)(EST_String &, V &))
 Apply func to each entry in the table. More...
 
int add_item (const EST_String &key, const V &value, int no_search=0)
 Add an entry to the table. More...
 
int remove_item (const EST_String &rkey, int quiet=0)
 Remove an entry from the table. More...
 
EST_THash< EST_String, V > & operator= (const EST_THash< EST_String, V > &from)
 Assignment is a copy operation. More...
 
void dump (ostream &stream, int all=0)
 Print the table to stream in a human readable format. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EST_THash< EST_String, V >
void skip_blank (IPointer &ip) const
 Shift to point at something. More...
 
void point_to_first (IPointer &ip) const
 Go to start of the table. More...
 
void move_pointer_forwards (IPointer &ip) const
 Move pointer forwards, at the end of the bucket, move down. More...
 
bool points_to_something (const IPointer &ip) const
 We are at the end if the pointer ever becomes NULL. More...
 
EST_Hash_Pair< EST_String, V > & points_at (const IPointer &ip)
 Return the contents of this entry. More...
 
void skip_blank (IPointer_k &ip) const
 Shift to point at something. More...
 
void point_to_first (IPointer_k &ip) const
 Go to start of the table. More...
 
void move_pointer_forwards (IPointer_k &ip) const
 Move pointer forwards, at the end of the bucket, move down. More...
 
bool points_to_something (const IPointer_k &ip) const
 We are at the end if the pointer ever becomes NULL. More...
 
EST_Stringpoints_at (const IPointer_k &ip)
 Return the key of this entry. More...
 
- Static Protected Member Functions inherited from EST_HashFunctions
static unsigned int DefaultHash (const void *data, ssize_t size, unsigned int n)
 A generally useful hash function. More...
 
static unsigned int StringHash (const EST_String &key, unsigned int size)
 A hash function for strings. More...
 

Detailed Description

template<class V>
class EST_TStringHash< V >

A specialised hash table for when the key is an EST_String.

This is just a version of EST_THash which has a different default hash function.

Definition at line 304 of file EST_THash.h.

Member Typedef Documentation

template<class V>
typedef EST_Hash_Pair<EST_String, V> EST_TStringHash< V >::Entry

An entry returned by the iterator is a key value pair.

Definition at line 308 of file EST_THash.h.

template<class V>
typedef EST_THash<EST_String, V>::IPointer EST_TStringHash< V >::TN_IPointer

Definition at line 317 of file EST_THash.h.

template<class V>
typedef EST_TStructIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer, EST_Hash_Pair<EST_String, V> > EST_TStringHash< V >::Entries

Give the iterator a sensible name.

Definition at line 321 of file EST_THash.h.

template<class V>
typedef EST_TRwStructIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer, EST_Hash_Pair<EST_String, V> > EST_TStringHash< V >::RwEntries

Definition at line 324 of file EST_THash.h.

template<class V>
typedef EST_String EST_TStringHash< V >::KeyEntry

Definition at line 326 of file EST_THash.h.

template<class V>
typedef EST_THash<EST_String, V>::IPointer_k EST_TStringHash< V >::TN_IPointer_k

Give the iterator a sensible name.

Definition at line 334 of file EST_THash.h.

template<class V>
typedef EST_TIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer_k, EST_String > EST_TStringHash< V >::KeyEntries

Definition at line 337 of file EST_THash.h.

template<class V>
typedef EST_TRwIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer_k, EST_String > EST_TStringHash< V >::KeyRwEntries

Definition at line 339 of file EST_THash.h.

Constructor & Destructor Documentation

template<class V>
EST_TStringHash< V >::EST_TStringHash ( int  size)
inline

Create a string hash table of size buckets.

Definition at line 308 of file EST_THash.h.


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