In file ../include/EST_THash.h:

template<class V> class EST_TStringHash

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

Inheritance:


Public Methods

[more] EST_TStringHash (int size)
Create a string hash table of <parameter>size</parameter> buckets

Public

[more]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


Inherited from EST_THash:

Public Classes

Pair Iteration

[more]struct IPointer_s
A position in the table is given by a bucket number and a pointer into the bucket
[more]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<K, V> & points_at(const IPointer &ip)
Return the contents of this entry
[more]typedef EST_Hash_Pair<K, V> Entry
An entry returned by the iterator is a key value pair
[more]typedef EST_TStructIterator< EST_THash<K, V>, IPointer, EST_Hash_Pair<K, V> > Entries
Give the iterator a sensible name

Key Iteration

[more]struct IPointer_k_s
A position in the table is given by a bucket number and a pointer into the bucket
[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]K& points_at(const IPointer_k &ip)
Return the key of this entry
[more]typedef K KeyEntry
An entry returned by this iterator is just a key
[more]typedef EST_TIterator< EST_THash<K, V>, IPointer_k, K > KeyEntries
Give the iterator a sensible name

Public Methods

ovoid clear(void)
ounsigned int num_entries(void) const
oint present(const K &key) const
oV& val(const K &key, int &found) const
oV& val(const K &key) const
ovoid copy(const EST_THash<K, V> &from)
ovoid map(void (*func)(K&, V&))
oint add_item(const K &key, const V &value, int no_search = 0)
oint remove_item(const K &rkey, int quiet = 0)
oEST_THash<K,V> & operator = (const EST_THash<K, V> &from)
ovoid dump(ostream &stream, int all=0)


Inherited from EST_HashFunctions:

Public Methods

ostatic unsigned int DefaultHash(const void* data, size_t size, unsigned int n)
ostatic unsigned int StringHash(const EST_String &key, unsigned int size)


Documentation

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

This is just a version of <classname>EST_THash</classname> which has a different default hash function.

o EST_TStringHash(int size)
Create a string hash table of <parameter>size</parameter> buckets

otypedef EST_Hash_Pair<EST_String, V> Entry
An entry returned by the iterator is a key value pair

otypedef EST_TStructIterator< EST_THash<EST_String, V>, IPointer, EST_Hash_Pair<EST_String, V> > Entries
Give the iterator a sensible name


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk