|
User Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
This is a SMALL object !
Though this inherits from HashT which is a big-object, this function's
effectively random use of Resize, means handle to this table may
be damages without warning.
For a reference counted version of this class see RCHashARC
HashARC should inherit HashC privately, but because of
bugs in g++ this stops the iterator working (the iterator
should really be a friend.) I'll fix this hopefully with the
next release of gcc.
Parent Classes:
Variables:
Methods:
- HashARC()
-
Default constructor.
- HashARC(istream & in)
-
Stream constructor.
- HashARC(UIndex nBins)
-
Create table with nBins.
Bin size must be at least 1.
- HashARC(const HashARC<K,T> & Oth)
-
Copy table.
- HashARC(Tuple2C<K,T> * data)
-
Initalise from simple array.
NB. Array must be terminated by a duplicate of
the first key. (i.e. == must return true between them)
- HashARC<K,T> Copy() const
-
Make a copy.
- const T * Lookup(const K & Key) const
-
Find data matching key.
Ptr == NULL, if matching key not found.
- T * Lookup(const K & Key)
-
Find data matching key.
Ptr == NULL, if matching key not found.
- BooleanT Lookup(const K & key,T & data)
-
Lookup data for key.
Returns true if data is found, copy is place in 'data'.
- BooleanT Update(const K & Key,const T & Data)
-
Update member of HashCable, will create new one if it doesn't
exist.
Returns: True=Member existed already. False=New one was added.
- T & Update(const K & Key)
-
Get value, add default if its not there. Return refrence anyway.
- BooleanT Insert(const K & Key,const T & Data)
-
Standard insert function, as Update(K,T).
Returns: True=Member existed already. False=New one was added.
- T & Access(const K & key,const T & def = T())
-
Access key, if it does exists create a new bin with value 'def'
Retuns a refrence to the new entry.
- T & operator[](const K & Key)
-
Associative array style of access.
- const T & operator[](const K & Key) const
-
Associative array style of access.
- BooleanT Del(const K & Key)
-
Delete member from table.
Returns TRUE if Key was in hash table.
- BooleanT DelNoResize(const K & Key)
-
Delete member from table, without resizing.
- T Get(const K & Key)
-
Get data element from table, and remove it.
- BooleanT IsElm(const K & Key) const
-
Is key used in the table.
- void Empty(void)
-
Remove all items from table.
- BooleanT IsEmpty(void) const
-
Is table empty ?
- UIntT Size(void) const
-
Number of elements in table.
- void Move(HashARC<K,T> & oth)
-
Move contents of another table into this one.
leave other empty. The previous contents of this table are removed.
- void AddFrom(HashARC<K,T> & oth,BooleanT replace = true)
-
Add contents of another table into this one.
leave other empty. if replace is true the old table
- void Add(const HashARC<K,T> & oth)
-
Add contents of another table into this one.
- const HashARC<K,T> & operator=(const HashARC<K,T> & oth)
-
- bool operator==(const HashARC<K,T> & oth) const
-
Is this hash table the same as another ?
- bool operator!=(const HashARC<K,T> & oth) const
-
Is this hash table different from another ?
- UIntT Hash() const
-
Get a hash value for the hash table.
- SArray1dC<HashElemLst> & GetTable_Internal() const
-
Don't use this function, it's a bug work around,
and I'll remove it as soon as gcc is fixed.
- HashC<K,T> Copy() const
-
Make a copy of the table.
- const T * Lookup(const K & Key) const
-
Find data matching key.
Ptr == NULL, if matching key not found.
- T * Lookup(const K & Key)
-
Find data matching key.
Ptr == NULL, if matching key not found.
- BooleanT Lookup(const K & Key,T & data)
-
Lookup data for key.
Returns true if data is found, copy is place in 'data'.
- BooleanT Update(const K & Key,const T & Data)
-
Update member of HashTable, will create new one if it doesn't
exist.
Require's a default constructor & a working assigment operator !!
Returns: True=Member existed already. False=New one was added.
- T & Update(const K & Key)
-
Get value, add default if its not there. Return refrence anyway.
- T & operator[](const K & Key)
-
Associative array style interface.
- const T & operator[](const K & Key) const
-
Associative array style of access.
- BooleanT Insert(const K & Key,const T & Data)
-
Default insertion operation, same as Update(K,T);
- T & Access(const K & key,const T & def = T())
-
Access key, if it does exists create a new bin with value 'def'
Retuns a refrence to the new entry.
- BooleanT Del(const K & Key)
-
Delete member from table.
- T Get(const K & Key)
-
Get data element from table, and remove it.
- BooleanT IsElm(const K & Key) const
-
Is key used in the table ?
- void Empty(void)
-
Remove all items from table.
- UIntT Size(void) const
-
Count number of elements in table.
- BooleanT IsEmpty(void) const
-
Is the table empty ?
- UIndex Bins(void) const
-
Number of bins in the HashTable.
- void Resize(USize NewSize)
-
Resize HashCable.
WARNING: this empties the old table & creates a new one,
so it will leave other handles pointing to an empty hash
table.
- const HashC<K,T> & operator=(const HashC<K,T> & Oth)
-
Assign from another hash table.
- BooleanT IsSameTable(const HashC<K,T> & oth) const
-
- SArray1dC<HashElemLst> & GetTable_Internal() const
-
Don't use this function, it's a bug work around,
and I'll remove it as soon as gcc is fixed.
|
Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001
|