Plasma Engine  2.0
Loading...
Searching...
No Matches
plIdTable< IdType, ValueType, AllocatorWrapper > Class Template Reference

#include <IdTable.h>

Inheritance diagram for plIdTable< IdType, ValueType, AllocatorWrapper >:

Public Member Functions

 plIdTable (plAllocator *pAllocator)
 
 plIdTable (const plIdTable< IdType, ValueType, AllocatorWrapper > &other)
 
 plIdTable (const plIdTableBase< IdType, ValueType > &other)
 
void operator= (const plIdTable< IdType, ValueType, AllocatorWrapper > &rhs)
 
void operator= (const plIdTableBase< IdType, ValueType > &rhs)
 
- Public Member Functions inherited from plIdTableBase< IdType, ValueType >
void Reserve (IndexType capacity)
 Expands the table so it can at least store the given capacity.
 
IndexType GetCount () const
 Returns the number of active entries in the table.
 
bool IsEmpty () const
 Returns true, if the table does not contain any elements.
 
void Clear ()
 Clears the table.
 
IdType Insert (const ValueType &value)
 Inserts the value into the table and returns the corresponding id.
 
IdType Insert (ValueType &&value)
 Inserts the temporary value into the table and returns the corresponding id.
 
bool Remove (const IdType id, ValueType *out_pOldValue=nullptr)
 Removes the entry with the given id. Returns if an entry was removed and optionally writes out the old value to out_oldValue.
 
bool TryGetValue (const IdType id, ValueType &out_value) const
 Returns if an entry with the given id was found and if found writes out the corresponding value to out_value.
 
bool TryGetValue (const IdType id, ValueType *&out_pValue) const
 Returns if an entry with the given id was found and if found writes out the pointer to the corresponding value to out_pValue.
 
const ValueType & operator[] (const IdType id) const
 Returns the value to the given id. Does bounds checks in debug builds.
 
ValueType & operator[] (const IdType id)
 Returns the value to the given id. Does bounds checks in debug builds.
 
const ValueType & GetValueUnchecked (const IndexType index) const
 Returns the value at the given index. Does bounds checks in debug builds but does not check for stale access.
 
ValueType & GetValueUnchecked (const IndexType index)
 Returns the value at the given index. Does bounds checks in debug builds but does not check for stale access.
 
bool Contains (const IdType id) const
 Returns if the table contains an entry corresponding to the given id.
 
Iterator GetIterator ()
 Returns an Iterator to the very first element.
 
ConstIterator GetIterator () const
 Returns a constant Iterator to the very first element.
 
plAllocatorGetAllocator () const
 Returns the allocator that is used by this instance.
 
bool IsFreelistValid () const
 Returns whether the internal free-list is valid. For testing purpose only.
 

Additional Inherited Members

- Public Types inherited from plIdTableBase< IdType, ValueType >
using IndexType = typename IdType::StorageType
 
using TypeOfId = IdType
 
- Protected Member Functions inherited from plIdTableBase< IdType, ValueType >
 plIdTableBase (plAllocator *pAllocator)
 Creates an empty id-table. Does not allocate any data yet.
 
 plIdTableBase (const plIdTableBase< IdType, ValueType > &rhs, plAllocator *pAllocator)
 Creates a copy of the given id-table.
 
 ~plIdTableBase ()
 Destructor.
 
void operator= (const plIdTableBase< IdType, ValueType > &rhs)
 Copies the data from another table into this one.
 

Detailed Description

template<typename IdType, typename ValueType, typename AllocatorWrapper = plDefaultAllocatorWrapper>
class plIdTable< IdType, ValueType, AllocatorWrapper >
See also
plIdTableBase

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