STL adaptor to make the GeoArray look like a proper STL container.
Name | Description |
---|---|
const T * const_iterator | The simplest possible const_iterator type (a raw pointer). |
const T * const_pointer | STL style typedefs that mark us as being a random access container. |
const T & const_reference | STL style typedefs that mark us as being a random access container. |
T * iterator | The simplest possible iterator type (a raw pointer). |
std::random_access_iterator_tag iterator_category | STL style typedefs that mark us as being a random access container. |
T * pointer | STL style typedefs that mark us as being a random access container. |
T & reference | STL style typedefs that mark us as being a random access container. |
s32 size_type | STL style typedefs that mark us as being a random access container. |
T value_type | STL style typedefs that mark us as being a random access container. |
T ValueType | Alias for our storage type. |
Name | Description |
---|---|
~GeoArray() | Destructor calls destructor on all elements in the array and frees the memory. |
Append(const U *, Geo::s32) | Append the elements in the specified range. |
back() | Forwarding functions with Stl naming convention. |
back() | Forwarding functions with Stl naming convention. |
Back() | Non constant access to final entry. |
Back() | Constant access to final entry. |
begin() | Forwarding functions with Stl naming convention. |
begin() | Forwarding functions with Stl naming convention. |
Begin() | Return iterator similar to vector::begin() |
Begin() | Return iterator similar to vector::begin() |
Clear() | Remove all elements from the array. |
Contains(const T &) | Returns true if the array contains x. |
Emplace(s32, U &&) | Insert an element at the specified index, elements already in the array at that index and above are shuffled up. |
EmplaceBack(U &&) | Add the specified element to the end of the array. |
EmplaceBackFast(U &&) | Fast version of push that doesn't do any checking in release. |
EmplaceFast(s32, U &&) | Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices. |
empty() | Forwarding functions with Stl naming convention. |
end() | Forwarding functions with Stl naming convention. |
end() | Forwarding functions with Stl naming convention. |
End() | Return iterator similar to vector::end() |
End() | Return iterator similar to vector::end() |
front() | Forwarding functions with Stl naming convention. |
front() | Forwarding functions with Stl naming convention. |
Front() | Constant access to final entry. |
Front() | Non constant access to final entry. |
GeoArray(s32) | Construct an empty array with the default capacity. |
GeoArray(const GeoArray &) | Construct a copy of the specified array. |
GeoArray(const GeoArray< CompatT > &) | Construct a copy of the specified array - The compiler must be able to resolve T = CompatT. |
GeoArray(GeoArray &&) | Move constructor. |
GeoArray(s32, const T &) | Construct with the specified value replicated numCopies times. |
GeoArray(const CompatT *, s32) | Construct a copy of the specified array - The compiler must be able to resolve T = CompatT. |
GetArray() | Remove all elements from the array. |
GetArray() | Give access to the internal array. |
GetArrayConst() | Remove all elements from the array. |
GetCapacity() | Returns the number of array entries available at the moment. |
GetMemoryUsage() | Memory used for array storage. |
GetSize() | Return the number of array entries currently in use. |
Init(s32) | Common initialisation code called by all constructors. |
Insert(s32, const T &) | Insert an element at the specified index, elements already in the array at that index and above are shuffled up. |
Insert(s32, T &&) | Insert an element at the specified index, elements already in the array at that index and above are shuffled up. |
InsertFast(s32, T &&) | Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices. |
InsertFast(s32, const T &) | Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices. |
IsEmpty() | Returns true if the array is empty. |
IsFull() | Returns true if the array is full. |
operator[](s32) | Constant array access. |
operator[](s32) | Non constant array access. |
operator=(const GeoArray< CompatT > &) | Assignment operator - The compiler must be able to resolve T = CompatT. |
operator=(const GeoArray &) | Assignment operator. |
operator=(GeoArray &&) | Move assignment operator. |
Pop() | Remove the element with the highest index (if there is one) |
pop_back() | Forwarding functions with Stl naming convention. |
PopFast() | Fast version of pop that doesn't do any checking in release. |
Push(const T &) | Add the specified element to the end of the array. |
Push(T &&) | Add the specified element to the end of the array. |
push_back(const_reference) | Forwarding functions with Stl naming convention. |
PushFast(T &&) | Fast version of push that doesn't do any checking in release. |
PushFast(const T &) | Fast version of push that doesn't do any checking in release. |
Remove(s32) | Remove the element at the specified index, elements at higher indices are shuffled down. |
RemoveFast(s32) | Moves the end of the array into the element to be removed, thus not preserving order or existing indices. |
Resize(s32) | Resize the array. |
Resize(s32, const T &) | Resize the array. |
ResizeCapacity(s32) | Ensure sufficient capacity for Resize operations. |
SetCapacity(s32) | Change the array's capacity, reallocating memory if the new capacity is different to the current capacity. |
Swap(GeoArray &) | Swap the contents of two arrays. |
Name | Description |
---|---|
ValueType * m_Data | Pointer to start of array memory. |
ValueType * m_DataEnd | Pointer to 1 after end of array memory. |
ValueType * m_End | Pointer to next free slot. |
public: ~GeoArray()
Destructor calls destructor on all elements in the array and frees the memory.
public: void Append
(
const U * p,
Geo::s32 count
)
Append the elements in the specified range.
public: reference back()
Forwarding functions with Stl naming convention.
public: const_reference back() const
Forwarding functions with Stl naming convention.
public: ValueType & Back()
Non constant access to final entry.
public: const ValueType & Back() const
Constant access to final entry.
public: pointer begin()
Forwarding functions with Stl naming convention.
public: const_pointer begin() const
Forwarding functions with Stl naming convention.
public: ValueType * Begin()
Return iterator similar to vector::begin()
public: const ValueType * Begin() const
Return iterator similar to vector::begin()
public: void Clear()
Remove all elements from the array.
The capacity of the array remains unchanged, which means that no memory is deallocated.
public: bool Contains
(
const T & x
) const
Returns true if the array contains x.
public: void Emplace
(
s32 index,
U && elem
)
Insert an element at the specified index, elements already in the array at that index and above are shuffled up.
public: bool EmplaceBack
(
U && elem
)
Add the specified element to the end of the array.
protected: void EmplaceBackFast
(
U && elem
)
Fast version of push that doesn't do any checking in release.
public: void EmplaceFast
(
s32 index,
U && elem
)
Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices.
public: bool empty() const
Forwarding functions with Stl naming convention.
public: const_pointer end() const
Forwarding functions with Stl naming convention.
public: pointer end()
Forwarding functions with Stl naming convention.
public: const ValueType * End() const
Return iterator similar to vector::end()
public: ValueType * End()
Return iterator similar to vector::end()
public: const_reference front() const
Forwarding functions with Stl naming convention.
public: reference front()
Forwarding functions with Stl naming convention.
public: const ValueType & Front() const
Constant access to final entry.
public: ValueType & Front()
Non constant access to final entry.
public: GeoArray
(
s32 initCapacity
)
Construct an empty array with the default capacity.
public: GeoArray
(
const GeoArray & srcArray
)
Construct a copy of the specified array.
public: GeoArray
(
const GeoArray< CompatT > & srcArray
)
Construct a copy of the specified array - The compiler must be able to resolve T = CompatT.
public: GeoArray
(
GeoArray && srcArray
)
Move constructor.
public: GeoArray
(
s32 numCopies,
const T & value
)
Construct with the specified value replicated numCopies times.
public: GeoArray
(
const CompatT * srcArray,
s32 length
)
Construct a copy of the specified array - The compiler must be able to resolve T = CompatT.
public: const ValueType * GetArray() const
Remove all elements from the array.
The capacity of the array remains unchanged, which means that no memory is deallocated.
public: ValueType * GetArray()
Give access to the internal array.
public: const ValueType * GetArrayConst() const
Remove all elements from the array.
The capacity of the array remains unchanged, which means that no memory is deallocated.
public: s32 GetCapacity() const
Returns the number of array entries available at the moment.
public: s32 GetMemoryUsage() const
Memory used for array storage.
public: s32 GetSize() const
Return the number of array entries currently in use.
protected: bool Init
(
s32 initCapacity
)
Common initialisation code called by all constructors.
public: void Insert
(
s32 index,
const T & elem
)
Insert an element at the specified index, elements already in the array at that index and above are shuffled up.
public: void Insert
(
s32 index,
T && elem
)
Insert an element at the specified index, elements already in the array at that index and above are shuffled up.
public: void InsertFast
(
s32 index,
T && elem
)
Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices.
public: void InsertFast
(
s32 index,
const T & elem
)
Inserts elem at index, and moves whatever is currently at the index to the end of the array, thus not preserving order or existing indices.
public: bool IsEmpty() const
Returns true if the array is empty.
public: bool IsFull() const
Returns true if the array is full.
public: const ValueType & operator[]
(
s32 i
) const
Constant array access.
public: ValueType & operator[]
(
s32 i
)
Non constant array access.
public: GeoArray & operator=
(
const GeoArray< CompatT > & srcArray
)
Assignment operator - The compiler must be able to resolve T = CompatT.
public: GeoArray & operator=
(
const GeoArray & srcArray
)
Assignment operator.
public: GeoArray & operator=
(
GeoArray && srcArray
)
Move assignment operator.
public: bool Pop()
Remove the element with the highest index (if there is one)
public: void pop_back()
Forwarding functions with Stl naming convention.
protected: void PopFast()
Fast version of pop that doesn't do any checking in release.
public: bool Push
(
const T & elem
)
Add the specified element to the end of the array.
public: bool Push
(
T && elem
)
Add the specified element to the end of the array.
public: bool push_back
(
const_reference v
)
Forwarding functions with Stl naming convention.
protected: void PushFast
(
T && elem
)
Fast version of push that doesn't do any checking in release.
protected: void PushFast
(
const T & elem
)
Fast version of push that doesn't do any checking in release.
public: void Remove
(
s32 index
)
Remove the element at the specified index, elements at higher indices are shuffled down.
public: void RemoveFast
(
s32 index
)
Moves the end of the array into the element to be removed, thus not preserving order or existing indices.
public: bool Resize
(
s32 newSize
)
Resize the array.
If the new size is larger than the current size then new elements are default constructed. If the new size is smaller than the current size then the elements closest to the end of the array are deleted until the current size is equal to the new size. The storage for the array is reallocated if the new size is larger than the current capacity. In the reallocation it is tried to grow the capacity by 50%, or if the new size is larger than that then the new capacity is set to the new size.
[in] | newSize | The new size of the array. |
false | If newSize is smaller than zero, or if additional memory could not be allocated. |
public: bool Resize
(
s32 newSize,
const T & elem
)
Resize the array.
If the new size is larger than the current size than new elements of value 'elem' are added. If the new size is smaller than the current size then the elements closest to the end of the array are deleted until the current size is equal to the new size. The storage for the array is reallocated if the new size is larger than the current capacity. In the reallocation it is tried to grow the capacity by 50%, or if the new size is larger than that then the new capacity is set to the new size.
[in] | newSize | The new size of the array. |
[in] | elem | Value for elements that get added if newSize is larger than the current size. |
false | If newSize is smaller than zero, or if additional memory could not be allocated. |
protected: bool ResizeCapacity
(
s32 newSize
)
Ensure sufficient capacity for Resize operations.
public: bool SetCapacity
(
s32 newCapacity
)
Change the array's capacity, reallocating memory if the new capacity is different to the current capacity.
[in] | newCapacity | The new capacity of the array. May not be less than the current size. |
false | If newCapacity is smaller than the current size, or if newCapacity is larger than MAX_CAPACITY, or if additional memory could not be allocated. |
public: void Swap
(
GeoArray & other
)
Swap the contents of two arrays.
This function does not re-allocate any memory. If A = {0, 1, 2} and B = {3, 4} then A.Swap(B) results in A = {3, 4} and B = {0, 1, 2}.
[in] | other | Other array that the contents of this array will be swapped with. |