|
Base Module
VST 3.6.5
SDK for developing VST Plug-in
|
Hash Table templateA hash table is a list of buckets. More...
#include <thashtable.h>
Inheritance diagram for THashTable< T >:Public Types | |
| typedef uint32(* | THashFunc )(const T &, uint32) |
| Hash function type. More... | |
Public Member Functions | |
| THashTable (THashFunc, int32=10) | |
| Constructor with hash function. More... | |
| THashTable (const THashTable< T > &) | |
| Copy constructor. More... | |
| THashTable (THashFunc, const TContainer< T > &) | |
| Constructor with container. More... | |
| ~THashTable () | |
| Destructor. More... | |
| THashTable< T > & | operator= (const THashTable< T > &) |
| Assignment operator, uses copy. More... | |
| void | setHashFunction (THashFunc) |
| Set hash function. More... | |
| bool | resize (int32) |
| Resize the table, set number of hash buckets. More... | |
| virtual TContainer< T > * | newInstance () const |
| Create a copy of this container. More... | |
| virtual int32 | total () const |
| Return number of items. More... | |
| virtual bool | isEmpty () const |
| Is container empty? More... | |
| virtual bool | add (const T &item) |
| Add item to container. More... | |
| virtual bool | remove (const T &item) |
| Remove equal item. More... | |
| virtual bool | remove (const TIterator< T > &iter) |
| Remove item at current iterator position. More... | |
| virtual bool | removeAt (int32 index) |
| Remove item at given index. More... | |
| virtual void | removeAll () |
| Remove all items from list. More... | |
| virtual T & | lookup (const T &item) const |
| Searches for the item equal to the specified item in the list and returns the first occurrence. More... | |
| virtual bool | contains (const T &item) const |
| See if container has equal item. More... | |
| virtual int32 | occurrences (const T &item) const |
| Count occurrences of equal items. More... | |
| virtual TIterator< T > * | newIterator () const |
| Create container iterator instance. More... | |
Public Member Functions inherited from TContainer< T > | |
| TContainer () | |
| TContainer (const TContainer< T > &) | |
| virtual | ~TContainer () |
| bool | operator== (const TContainer< T > &) const |
| bool | operator!= (const TContainer< T > &) const |
| T & | operator[] (int32) const |
| "[]" indexing operator returns the item at the specified index. More... | |
| virtual int32 | size () const |
| Returns the container size. More... | |
| virtual T & | at (int32 index) const |
| Get item at index. More... | |
| TContainer< T > * | lookupAll (const T &item) const |
| Allocate and returns a container with all items in this container equal to the specified item. More... | |
| bool | addAllFrom (const TContainer< T > &container) |
| Adds all the items from the specified container to this container. More... | |
| bool | addNewFrom (const TContainer< T > &container) |
| Adds the items from the specified container to this container that are not in this container already. More... | |
| T & | error () const |
| Access error object. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TContainer< T > | |
| void | copy (const TContainer< T > &container) |
| Internal copy method. Copies the contents of the specified container into this container. More... | |
Protected Attributes inherited from TContainer< T > | |
| T | errorObject |
| Object used as return value when methods returning a T& fail. More... | |
| int32 | _size |
| Container size. More... | |
Hash Table template
A hash table is a list of buckets.
It assigns values to items (template) using a hash function and puts them into the bucket, which table index equals the item's calculated value.
| typedef uint32(* THashFunc)(const T &, uint32) |
Hash function type.
| THashTable | ( | THashFunc | func, |
| int32 | size = 10 |
||
| ) |
Constructor with hash function.
| [in] | func | Hash function the table uses. |
| [in] | size | Size (number of buckets) of new table. |
| THashTable | ( | const THashTable< T > & | table | ) |
Copy constructor.
| [in] | table | Hash table to copy. |
| THashTable | ( | THashFunc | func, |
| const TContainer< T > & | cont | ||
| ) |
Constructor with container.
| [in] | func | Hash function the table uses. |
| [in] | cont | Container to construct the table from. |
| ~THashTable | ( | ) |
Destructor.
| THashTable< T > & operator= | ( | const THashTable< T > & | table | ) |
Assignment operator, uses copy.
| [in] | table | Assign left side (this) to table. |
| void setHashFunction | ( | THashFunc | func | ) |
Set hash function.
| [in] | func | New hash function. |
| bool resize | ( | int32 | newsize | ) |
Resize the table, set number of hash buckets.
| [in] | newsize | New number of hash buckets. |
|
virtual |
|
virtual |
Return number of items.
Reimplemented from TContainer< T >.
|
virtual |
|
virtual |
Add item to container.
| [in] | rObj | Item to add. |
Implements TContainer< T >.
Reimplemented in THashSet< T >, and TBag< T >.
|
virtual |
Remove equal item.
| [in] | rObj | Item to remove. |
Implements TContainer< T >.
Reimplemented in TBag< T >.
|
virtual |
Remove item at current iterator position.
| [in] | iter | Points to item to remove. |
Implements TContainer< T >.
|
virtual |
Remove item at given index.
| [in] | idx | Index of item to remove. |
Implements TContainer< T >.
|
virtual |
|
virtual |
Searches for the item equal to the specified item in the list and returns the first occurrence.
| [in] | rObj | Item to look up. |
Reimplemented from TContainer< T >.
|
virtual |
See if container has equal item.
| [in] | rObj | Item to compare. |
Reimplemented from TContainer< T >.
|
virtual |
Count occurrences of equal items.
| [in] | rObj | Item to compare. |
Reimplemented from TContainer< T >.
|
virtual |