XII Release 0.1.0
Loading...
Searching...
No Matches
xiiArrayMap< KEY, VALUE, AllocatorWrapper > Class Template Reference

See xiiArrayMapBase for details. More...

#include <ArrayMap.h>

Inheritance diagram for xiiArrayMap< KEY, VALUE, AllocatorWrapper >:
[legend]

Public Member Functions

 xiiArrayMap (xiiAllocator *pAllocator)
 xiiArrayMap (const xiiArrayMap< KEY, VALUE, AllocatorWrapper > &rhs)
 xiiArrayMap (const xiiArrayMapBase< KEY, VALUE > &rhs)
void operator= (const xiiArrayMap< KEY, VALUE, AllocatorWrapper > &rhs)
void operator= (const xiiArrayMapBase< KEY, VALUE > &rhs)
Public Member Functions inherited from xiiArrayMapBase< KEY, VALUE >
 xiiArrayMapBase (xiiAllocator *pAllocator)
 Constructor.
 xiiArrayMapBase (const xiiArrayMapBase &rhs, xiiAllocator *pAllocator)
 Copy-Constructor.
void operator= (const xiiArrayMapBase &rhs)
 Copy assignment operator.
xiiUInt32 GetCount () const
 Returns the number of elements stored in the map.
bool IsEmpty () const
 True if the map contains no elements.
void Clear ()
 Purges all elements from the map.
template<typename CompatibleKeyType, typename CompatibleValueType>
xiiUInt32 Insert (CompatibleKeyType &&key, CompatibleValueType &&value)
void Sort () const
 Ensures the internal data structure is sorted. This is done automatically every time a lookup needs to be made.
template<typename CompatibleKeyType>
xiiUInt32 Find (const CompatibleKeyType &key) const
template<typename CompatibleKeyType>
xiiUInt32 LowerBound (const CompatibleKeyType &key) const
template<typename CompatibleKeyType>
xiiUInt32 UpperBound (const CompatibleKeyType &key) const
const KEY & GetKey (xiiUInt32 uiIndex) const
 Returns the key that is stored at the given index.
const VALUE & GetValue (xiiUInt32 uiIndex) const
 Returns the value that is stored at the given index.
VALUE & GetValue (xiiUInt32 uiIndex)
 Returns the value that is stored at the given index.
xiiDynamicArray< Pair > & GetData ()
 Returns a reference to the map data array.
const xiiDynamicArray< Pair > & GetData () const
 Returns a constant reference to the map data array.
template<typename CompatibleKeyType>
VALUE & FindOrAdd (const CompatibleKeyType &key, bool *out_pExisted=nullptr)
 Returns the value stored at the given key. If none exists, one is created. bExisted indicates whether an element needed to be created.
template<typename CompatibleKeyType>
VALUE & operator[] (const CompatibleKeyType &key)
 Same as FindOrAdd.
const Pair & GetPair (xiiUInt32 uiIndex) const
 Returns the key/value pair at the given index.
void RemoveAtAndCopy (xiiUInt32 uiIndex, bool bKeepSorted=false)
template<typename CompatibleKeyType>
bool RemoveAndCopy (const CompatibleKeyType &key, bool bKeepSorted=false)
template<typename CompatibleKeyType>
bool Contains (const CompatibleKeyType &key) const
 Returns whether an element with the given key exists.
template<typename CompatibleKeyType>
bool Contains (const CompatibleKeyType &key, const VALUE &value) const
 Returns whether an element with the given key and value already exists.
void Reserve (xiiUInt32 uiSize)
 Reserves enough memory to store size elements.
void Compact ()
 Compacts the internal memory to not waste any space.
bool operator== (const xiiArrayMapBase< KEY, VALUE > &rhs) const
 Compares the two containers for equality.
xiiUInt64 GetHeapMemoryUsage () const
 Returns the amount of bytes that are currently allocated on the heap.
template<typename CompatibleKeyType>
XII_ALWAYS_INLINE VALUE & operator[] (const CompatibleKeyType &key)
template<typename CompatibleKeyType>
XII_ALWAYS_INLINE bool Contains (const CompatibleKeyType &key) const

Additional Inherited Members

Public Types inherited from xiiArrayMapBase< KEY, VALUE >
using const_iterator = typename xiiDynamicArray<Pair>::const_iterator
using const_reverse_iterator = typename xiiDynamicArray<Pair>::const_reverse_iterator
using iterator = typename xiiDynamicArray<Pair>::iterator
using reverse_iterator = typename xiiDynamicArray<Pair>::reverse_iterator

Detailed Description

template<typename KEY, typename VALUE, typename AllocatorWrapper = xiiDefaultAllocatorWrapper>
class xiiArrayMap< KEY, VALUE, AllocatorWrapper >

See xiiArrayMapBase for details.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Containers/ArrayMap.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Containers/Implementation/ArrayMap_inl.h