Plasma Engine  2.0
Loading...
Searching...
No Matches
plHashSet< KeyType, Hasher, AllocatorWrapper > Class Template Reference

#include <HashSet.h>

Inheritance diagram for plHashSet< KeyType, Hasher, AllocatorWrapper >:

Public Member Functions

 plHashSet (plAllocator *pAllocator)
 
 plHashSet (const plHashSet< KeyType, Hasher, AllocatorWrapper > &other)
 
 plHashSet (const plHashSetBase< KeyType, Hasher > &other)
 
 plHashSet (plHashSet< KeyType, Hasher, AllocatorWrapper > &&other)
 
 plHashSet (plHashSetBase< KeyType, Hasher > &&other)
 
void operator= (const plHashSet< KeyType, Hasher, AllocatorWrapper > &rhs)
 
void operator= (const plHashSetBase< KeyType, Hasher > &rhs)
 
void operator= (plHashSet< KeyType, Hasher, AllocatorWrapper > &&rhs)
 
void operator= (plHashSetBase< KeyType, Hasher > &&rhs)
 
- Public Member Functions inherited from plHashSetBase< KeyType, Hasher >
bool operator== (const plHashSetBase< KeyType, Hasher > &rhs) const
 Compares this table to another table.
 
 PL_ADD_DEFAULT_OPERATOR_NOTEQUAL (const plHashSetBase< KeyType, Hasher > &)
 
void Reserve (plUInt32 uiCapacity)
 Expands the hashset by over-allocating the internal storage so that the load factor is lower or equal to 60% when inserting the given number of entries.
 
void Compact ()
 Tries to compact the hashset to avoid wasting memory.
 
plUInt32 GetCount () const
 Returns the number of active entries in the table.
 
bool IsEmpty () const
 Returns true, if the hashset does not contain any elements.
 
void Clear ()
 Clears the table.
 
template<typename CompatibleKeyType >
bool Insert (CompatibleKeyType &&key)
 Inserts the key. Returns whether the key was already existing.
 
template<typename CompatibleKeyType >
bool Remove (const CompatibleKeyType &key)
 Removes the entry with the given key. Returns if an entry was removed.
 
ConstIterator Remove (const ConstIterator &pos)
 Erases the key at the given Iterator. Returns an iterator to the element after the given iterator.
 
template<typename CompatibleKeyType >
bool Contains (const CompatibleKeyType &key) const
 Returns if an entry with given key exists in the table.
 
bool ContainsSet (const plHashSetBase< KeyType, Hasher > &operand) const
 Checks whether all keys of the given set are in the container.
 
void Union (const plHashSetBase< KeyType, Hasher > &operand)
 Makes this set the union of itself and the operand.
 
void Difference (const plHashSetBase< KeyType, Hasher > &operand)
 Makes this set the difference of itself and the operand, i.e. subtracts operand.
 
void Intersection (const plHashSetBase< KeyType, Hasher > &operand)
 Makes this set the intersection of itself and the operand.
 
ConstIterator GetIterator () const
 Returns a constant Iterator to the very first element.
 
ConstIterator GetEndIterator () const
 Returns a constant Iterator to the first element that is not part of the hashset. Needed to implement range based for loop support.
 
plAllocatorGetAllocator () const
 Returns the allocator that is used by this instance.
 
plUInt64 GetHeapMemoryUsage () const
 Returns the amount of bytes that are currently allocated on the heap.
 
void Swap (plHashSetBase< KeyType, Hasher > &other)
 Swaps this map with the other one.
 
template<typename CompatibleKeyType >
ConstIterator Find (const CompatibleKeyType &key) const
 Searches for key, returns a ConstIterator to it or an invalid iterator, if no such key is found. O(1) operation.
 
template<typename CompatibleKeyType >
PL_FORCE_INLINE bool Contains (const CompatibleKeyType &key) const
 
template<typename CompatibleKeyType >
PL_FORCE_INLINE plHashSetBase< K, H >::ConstIterator Find (const CompatibleKeyType &key) const
 
template<typename CompatibleKeyType >
PL_FORCE_INLINE plUInt32 FindEntry (const CompatibleKeyType &key) const
 

Additional Inherited Members

- Protected Member Functions inherited from plHashSetBase< KeyType, Hasher >
 plHashSetBase (plAllocator *pAllocator)
 Creates an empty hashset. Does not allocate any data yet.
 
 plHashSetBase (const plHashSetBase< KeyType, Hasher > &rhs, plAllocator *pAllocator)
 Creates a copy of the given hashset.
 
 plHashSetBase (plHashSetBase< KeyType, Hasher > &&rhs, plAllocator *pAllocator)
 Moves data from an existing hashtable into this one.
 
 ~plHashSetBase ()
 Destructor.
 
void operator= (const plHashSetBase< KeyType, Hasher > &rhs)
 Copies the data from another hashset into this one.
 
void operator= (plHashSetBase< KeyType, Hasher > &&rhs)
 Moves data from an existing hashset into this one.
 

Detailed Description

template<typename KeyType, typename Hasher = plHashHelper<KeyType>, typename AllocatorWrapper = plDefaultAllocatorWrapper>
class plHashSet< KeyType, Hasher, AllocatorWrapper >
See also
plHashSetBase

The documentation for this class was generated from the following files: