|
Base Module
VST 3.6.5
SDK for developing VST Plug-in
|
Bag template. More...
#include <tbag.h>
Inheritance diagram for TBag< T >:Public Types | |
| typedef uint32(* | THashFunc )(const T &, uint32) |
| Hash function type. More... | |
Public Types inherited from THashTable< T > | |
| typedef uint32(* | THashFunc )(const T &, uint32) |
| Hash function type. More... | |
Public Member Functions | |
| TBag (int32 size=10) | |
| Bag constructor. More... | |
| TBag (THashFunc hashFunction, int32 size=10) | |
| Bag constructor with a specified hash function. More... | |
| TBag (THashTable< T > &hashTable) | |
| Bag copy constructor. More... | |
| TBag (THashFunc hashFunction, const TContainer< T > &container) | |
| Bag constructor with a specified hash function and a container. More... | |
| TBag< T > & | operator= (const THashTable< T > &hashTable) |
| Assignment operator. More... | |
| virtual bool | add (const T &item) |
| Adds a new item to the bag. More... | |
| virtual bool | add (const T &item, int32 numCopies) |
| Adds a number of copies of a new item to the bag. More... | |
| virtual bool | remove (const T &item) |
| Removes the first occurrence of an item from the bag. More... | |
| virtual bool | remove (const T &item, int32 numCopies) |
| Removes a number of copies of an item from the bag. More... | |
| virtual void | removeAll (const T &item) |
| Removes all occurrences of the specific item from the bag. More... | |
| virtual void | removeAll () |
| Removes all items from the bag. More... | |
| int32 | getCount (const T &item) |
| Number of occurrences (cardinality) of the given item. More... | |
| THashSet< T > * | createUniqueSet () |
| Creates a hash set of unique items. More... | |
Public Member Functions inherited from THashTable< T > | |
| 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 | remove (const TIterator< T > &iter) |
| Remove item at current iterator position. More... | |
| virtual bool | removeAt (int32 index) |
| Remove item at given index. 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... | |
Bag template.
A bag is a hash table that adds a few convenient functions to the super class, regarding the handling of identical items
| typedef uint32(* THashFunc)(const T &, uint32) |
Hash function type.
| TBag | ( | int32 | _size = 10 | ) |
Bag constructor.
Before using this bag, a hash function has to be assigned via the THashTable<T>::setHashFunction() method
| [in] | _size | - initial size of the container |
Bag constructor with a specified hash function.
| [in] | hashFunction | - hash function |
| [in] | _size | - initial size of the container |
| TBag | ( | THashTable< T > & | hashTable | ) |
Bag copy constructor.
| [in] | hashTable | - hashTable to copy (including the hash function) |
| TBag | ( | THashFunc | hashFunction, |
| const TContainer< T > & | container | ||
| ) |
Bag constructor with a specified hash function and a container.
| [in] | hashFunction | - hash function |
| [in] | container | - container, which will be used to construct the bag |
| TBag< T > & operator= | ( | const THashTable< T > & | hashTable | ) |
Assignment operator.
| [in] | hashTable | - hashTable to copy (including the hash function) |
|
virtual |
Adds a new item to the bag.
| [in] | item | - item to add |
Reimplemented from THashTable< T >.
|
virtual |
Adds a number of copies of a new item to the bag.
| [in] | item | - item to add |
| [in] | numCopies | - number of copies |
|
virtual |
Removes the first occurrence of an item from the bag.
| [in] | item | - item to remove |
Reimplemented from THashTable< T >.
|
virtual |
Removes a number of copies of an item from the bag.
| [in] | item | - item to remove |
| [in] | numCopies | - number of copies |
|
virtual |
Removes all occurrences of the specific item from the bag.
| [in] | item | - item to remove |
|
virtual |
Removes all items from the bag.
Reimplemented from THashTable< T >.
| int32 getCount | ( | const T & | item | ) |
Number of occurrences (cardinality) of the given item.
| [in] | item | - item to count |
| THashSet< T > * createUniqueSet | ( | ) |
Creates a hash set of unique items.
The hash set contains exactly one copy of each item in the bag