Base Module  VST 3.6.5
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Types | Public Member Functions
THashSet< T > Class Template Reference

A hash set is a collection of items, without any particular order and without repetitions stored in a hash table. More...

#include <thashset.h>

+ Inheritance diagram for THashSet< 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

 THashSet (int32=10)
 Default constructor, size = number of buckets. More...
 
 THashSet (THashFunc, int32=10)
 Constructor with hash function, size = number of buckets. More...
 
 THashSet (const THashSet< T > &)
 Copy constructor - uses copy, copy used add. More...
 
 THashSet (THashFunc, const TContainer< T > &)
 Container with hash function and container to copy. More...
 
 ~THashSet ()
 Destructor. More...
 
THashSet< T > & operator= (const THashTable< T > &)
 Assignment operator, uses copy. More...
 
THashSet< T > operator- (const THashSet< T > &) const
 Difference operator. More...
 
THashSet< T > operator& (const THashSet< T > &) const
 Intersection operator. More...
 
THashSet< T > operator| (const THashSet< T > &) const
 Union operator. More...
 
bool add (const T &)
 Add item to set if not already contained. 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 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 >
errorObject
 Object used as return value when methods returning a T& fail. More...
 
int32 _size
 Container size. More...
 

Detailed Description

template<class T>
class Steinberg::THashSet< T >

A hash set is a collection of items, without any particular order and without repetitions stored in a hash table.

A hash table stores its items in hash buckets whose pointers are stored in an array at the index given by the hash function, which is a integer function of the item. The buckets are necessary to hold all items with the same hash index.

See also
THashTable

Member Typedef Documentation

typedef uint32(* THashFunc)(const T &, uint32)

Hash function type.

Constructor & Destructor Documentation

THashSet ( int32  size = 10)

Default constructor, size = number of buckets.

Parameters
[in]sizeNumber of buckets in the new hash set.
THashSet ( THashFunc  func,
int32  size = 10 
)

Constructor with hash function, size = number of buckets.

Parameters
[in]funcHash function the hash set uses.
[in]sizeNumber of buckets in the new hash set
THashSet ( const THashSet< T > &  set)

Copy constructor - uses copy, copy used add.

Parameters
[in]setHash set to copy.
THashSet ( THashFunc  func,
const TContainer< T > &  cont 
)

Container with hash function and container to copy.

Parameters
[in]funcHash function the set uses.
[in]contContainer to construct the table from.
~THashSet ( )
inline

Destructor.

Member Function Documentation

THashSet< T > & operator= ( const THashTable< T > &  table)

Assignment operator, uses copy.

Parameters
[in]tableAssign input set or table to this set.
Returns
Assigned hash set reference.
THashSet< T > operator- ( const THashSet< T > &  set) const

Difference operator.

Parameters
[in]setContains items to be subtracted.
Returns
Hash set containing those items appearing in this set that have no equal in the specified set.
THashSet< T > operator& ( const THashSet< T > &  set) const

Intersection operator.

Parameters
[in]setContains items to be intersected.
Returns
Hash set containing those items appearing in this set and the input set.
THashSet< T > operator| ( const THashSet< T > &  set) const

Union operator.

Parameters
[in]setContains items to be united.
Returns
Hash set containing those items appearing in this set or the input set.
bool add ( const T &  item)
virtual

Add item to set if not already contained.

Parameters
[in]itemItem that will be added if no similar item is already contained by the set.

Reimplemented from THashTable< T >.

Empty

Copyright ©2015 Steinberg Media Technologies GmbH. All Rights Reserved.