Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

template<typename T>
class Geo::GeoArray_Stl

    └>Geo::GeoArray< T >

STL adaptor to make the GeoArray look like a proper STL container.

Typedefs

NameDescription
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.

Functions

NameDescription
~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()

Construct an empty array with the default capacity.

GeoArray(s32)

Construct an empty array with the specified capacity.

GeoArray(const GeoArray &)

Construct a copy of the specified array.

GeoArray(const CompatT *, s32)

Construct a copy of the specified array - The compiler must be able to resolve T = CompatT.

GeoArray(s32, const T &)

Construct with the specified value replicated numCopies times.

GeoArray(GeoArray &&)

Move constructor.

GeoArray(const GeoArray< CompatT > &)

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, T &&)

Insert an element at the specified index, elements already in the array at that index and above are shuffled up.

Insert(s32, const 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, const T &)

Resize the array.

Resize(s32)

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.

Friends

NameDescription
friend const ValueType * begin(const GeoArray &a)

Return iterator to support ranged-based for loop.

friend ValueType * begin(GeoArray &a)

Return iterator to support ranged-based for loop.

friend const ValueType * end(const GeoArray &a)

Return iterator to support ranged-based for loop.

friend ValueType * end(GeoArray &a)

Return iterator to support ranged-based for loop.

Variables

NameDescription
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.


Anchor
a12b534958e3f818d7ce19ad0afb6bac6
a12b534958e3f818d7ce19ad0afb6bac6

Geo::GeoArray< T >::~GeoArray

...

public: ~GeoArray()

...

Destructor calls destructor on all elements in the array and frees the memory.


Anchor
a3eb9f8aa5d9471ee88fff1d363dcd48c
a3eb9f8aa5d9471ee88fff1d363dcd48c

void Geo::GeoArray< T >::Append

...

public: void Append
(
    const U * p,
    Geo::s32 count
)

...

Append the elements in the specified range.


Anchor
a525cb46d44ad2288bc62a557bf5a8dbc
a525cb46d44ad2288bc62a557bf5a8dbc

reference Geo::GeoArray_Stl< T >::back

...

public: reference back()

...

Forwarding functions with Stl naming convention.


Anchor
a4e91c547df888d783406072037ea432b
a4e91c547df888d783406072037ea432b

const_reference Geo::GeoArray_Stl< T >::back

...

public: const_reference back() const

...

Forwarding functions with Stl naming convention.


Anchor
a7473003c44b5a69dbea486e9ff399003
a7473003c44b5a69dbea486e9ff399003

ValueType& Geo::GeoArray< T >::Back

...

public: ValueType & Back()

...

Non constant access to final entry.


Anchor
ac2d2634e8cb9629e2eab360f11f38301
ac2d2634e8cb9629e2eab360f11f38301

const ValueType& Geo::GeoArray< T >::Back

...

public: const ValueType & Back() const

...

Constant access to final entry.


Anchor
aeaa917fe4e82ae9ed67cd9841e697677
aeaa917fe4e82ae9ed67cd9841e697677

pointer Geo::GeoArray_Stl< T >::begin

...

public: pointer begin()

...

Forwarding functions with Stl naming convention.


Anchor
a07e00420525b66308b7b7a1135fd283d
a07e00420525b66308b7b7a1135fd283d

const_pointer Geo::GeoArray_Stl< T >::begin

...

public: const_pointer begin() const

...

Forwarding functions with Stl naming convention.


Anchor
a951fbcf52482f48dcff280e40c6432fb
a951fbcf52482f48dcff280e40c6432fb

const ValueType* Geo::GeoArray< T >::Begin

...

public: const ValueType * Begin() const

...

Return iterator similar to vector::begin()


Anchor
af949bacd131f985250a83d1a93bb6c1d
af949bacd131f985250a83d1a93bb6c1d

ValueType* Geo::GeoArray< T >::Begin

...

public: ValueType * Begin()

...

Return iterator similar to vector::begin()


Anchor
af6fe5b614f1edcf526e443bc60dd04f0
af6fe5b614f1edcf526e443bc60dd04f0

void Geo::GeoArray< T >::Clear

...

public: void Clear()

...

Remove all elements from the array.

The capacity of the array remains unchanged, which means that no memory is deallocated.


Anchor
a37e46a5212747ec394dd38a24b5e554c
a37e46a5212747ec394dd38a24b5e554c

bool Geo::GeoArray< T >::Contains

...

public: bool Contains
(
    const T & x
) const

...

Returns true if the array contains x.


Anchor
aa6c6f7e938a06aa11ff0631affdb63e2
aa6c6f7e938a06aa11ff0631affdb63e2

void Geo::GeoArray< T >::Emplace

...

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.


Anchor
a27e04c7c931ed5c72229f3fcc8c8f73e
a27e04c7c931ed5c72229f3fcc8c8f73e

bool Geo::GeoArray< T >::EmplaceBack

...

public: bool EmplaceBack
(
    U && elem
)

...

Add the specified element to the end of the array.


Anchor
a61445516ed93eaa8705cff5305de3b61
a61445516ed93eaa8705cff5305de3b61

void Geo::GeoArray< T >::EmplaceBackFast

...

protected: void EmplaceBackFast
(
    U && elem
)

...

Fast version of push that doesn't do any checking in release.


Anchor
aa99d53958e443bc628ed185579aabe1a
aa99d53958e443bc628ed185579aabe1a

void Geo::GeoArray< T >::EmplaceFast

...

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.


Anchor
a28898d07066ed8d4f0e142e5edf7ec45
a28898d07066ed8d4f0e142e5edf7ec45

bool Geo::GeoArray_Stl< T >::empty

...

public: bool empty() const

...

Forwarding functions with Stl naming convention.


Anchor
a4f37166adf79974719acdb15137fd71f
a4f37166adf79974719acdb15137fd71f

pointer Geo::GeoArray_Stl< T >::end

...

public: pointer end()

...

Forwarding functions with Stl naming convention.


Anchor
aced90f4a5b773d2d3dc93e27e6cbcde3
aced90f4a5b773d2d3dc93e27e6cbcde3

const_pointer Geo::GeoArray_Stl< T >::end

...

public: const_pointer end() const

...

Forwarding functions with Stl naming convention.


Anchor
ab96cf54aa1bb873aa7243c4a138b762c
ab96cf54aa1bb873aa7243c4a138b762c

const ValueType* Geo::GeoArray< T >::End

...

public: const ValueType * End() const

...

Return iterator similar to vector::end()


Anchor
a667f594bd058b67905b1189e8c80378d
a667f594bd058b67905b1189e8c80378d

ValueType* Geo::GeoArray< T >::End

...

public: ValueType * End()

...

Return iterator similar to vector::end()


Anchor
a19fd99b7a3803d532205cb3585fe0d7f
a19fd99b7a3803d532205cb3585fe0d7f

const_reference Geo::GeoArray_Stl< T >::front

...

public: const_reference front() const

...

Forwarding functions with Stl naming convention.


Anchor
a14ec8461e722406a851bc92a64622c9d
a14ec8461e722406a851bc92a64622c9d

reference Geo::GeoArray_Stl< T >::front

...

public: reference front()

...

Forwarding functions with Stl naming convention.


Anchor
aaed61ebc4dbec8784b21a3682860020a
aaed61ebc4dbec8784b21a3682860020a

const ValueType& Geo::GeoArray< T >::Front

...

public: const ValueType & Front() const

...

Constant access to final entry.


Anchor
af62527cd995f2270adebfbc39baf379f
af62527cd995f2270adebfbc39baf379f

ValueType& Geo::GeoArray< T >::Front

...

public: ValueType & Front()

...

Non constant access to final entry.


Anchor
a4ec87e5dfa523dab172020665fea00a0
a4ec87e5dfa523dab172020665fea00a0

Geo::GeoArray< T >::GeoArray

...

public: GeoArray()

...

Construct an empty array with the default capacity.


Anchor
a4e02dbc1ff57542cf94ead08929794d3
a4e02dbc1ff57542cf94ead08929794d3

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    s32 initCapacity
)

...

Construct an empty array with the specified capacity.


Anchor
a4481c14c3387f913430aea26dc9828b5
a4481c14c3387f913430aea26dc9828b5

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    const GeoArray & srcArray
)

...

Construct a copy of the specified array.


Anchor
a9d5b935814f61f82a6fabe144d79593e
a9d5b935814f61f82a6fabe144d79593e

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    const CompatT * srcArray,
    s32 length
)

...

Construct a copy of the specified array - The compiler must be able to resolve T = CompatT.


Anchor
ac86e39694e51dd2521ed77a7ba6b6200
ac86e39694e51dd2521ed77a7ba6b6200

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    s32 numCopies,
    const T & value
)

...

Construct with the specified value replicated numCopies times.


Anchor
ab85e32629f92814ed423017e3a3c7d74
ab85e32629f92814ed423017e3a3c7d74

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    GeoArray && srcArray
)

...

Move constructor.


Anchor
a5fde7a64d308c98700ed6005cd33ca9a
a5fde7a64d308c98700ed6005cd33ca9a

Geo::GeoArray< T >::GeoArray

...

public: GeoArray
(
    const GeoArray< CompatT > & srcArray
)

...

Construct a copy of the specified array - The compiler must be able to resolve T = CompatT.


Anchor
a3f10c9418b0e36a92f57a0764bbeb9cb
a3f10c9418b0e36a92f57a0764bbeb9cb

const ValueType* Geo::GeoArray< T >::GetArray

...

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.


Anchor
ab9ff20d533602ce291b6310b23e5f2d8
ab9ff20d533602ce291b6310b23e5f2d8

ValueType* Geo::GeoArray< T >::GetArray

...

public: ValueType * GetArray()

...

Give access to the internal array.


Anchor
ae4d3326968f7771d430e6d0539341100
ae4d3326968f7771d430e6d0539341100

const ValueType* Geo::GeoArray< T >::GetArrayConst

...

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.


Anchor
af4968de4963bac2d4b131426fad9bd66
af4968de4963bac2d4b131426fad9bd66

s32 Geo::GeoArray< T >::GetCapacity

...

public: s32 GetCapacity() const

...

Returns the number of array entries available at the moment.


Anchor
a1af18b5c5af6d6249da6ea0d10ce0877
a1af18b5c5af6d6249da6ea0d10ce0877

s32 Geo::GeoArray< T >::GetMemoryUsage

...

public: s32 GetMemoryUsage() const

...

Memory used for array storage.


Anchor
aedd1d9dd47bcffcf6825656058b645b4
aedd1d9dd47bcffcf6825656058b645b4

s32 Geo::GeoArray< T >::GetSize

...

public: s32 GetSize() const

...

Return the number of array entries currently in use.


Anchor
af6861d147d94f7de98995861d7dfce1d
af6861d147d94f7de98995861d7dfce1d

bool Geo::GeoArray< T >::Init

...

protected: bool Init
(
    s32 initCapacity
)

...

Common initialisation code called by all constructors.


Anchor
af185f1557c41ff4f1cd56ef8c39511b4
af185f1557c41ff4f1cd56ef8c39511b4

void Geo::GeoArray< T >::Insert

...

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.


Anchor
acac7cb16fa52053f857cf423ed82af4f
acac7cb16fa52053f857cf423ed82af4f

void Geo::GeoArray< T >::Insert

...

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.


Anchor
a3349955a115bfc3ae78f8805a425c67c
a3349955a115bfc3ae78f8805a425c67c

void Geo::GeoArray< T >::InsertFast

...

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.


Anchor
af7a8cbcf7a346395939fb3ae11edd212
af7a8cbcf7a346395939fb3ae11edd212

void Geo::GeoArray< T >::InsertFast

...

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.


Anchor
a69793dfa12fe4fdcd4550bb7b7172fa8
a69793dfa12fe4fdcd4550bb7b7172fa8

bool Geo::GeoArray< T >::IsEmpty

...

public: bool IsEmpty() const

...

Returns true if the array is empty.


Anchor
a0e388d00c562a8411f1fcef27c544e34
a0e388d00c562a8411f1fcef27c544e34

bool Geo::GeoArray< T >::IsFull

...

public: bool IsFull() const

...

Returns true if the array is full.


Anchor
a68a0c5c96e28c0c072d9fef34f7cea03
a68a0c5c96e28c0c072d9fef34f7cea03

const ValueType& Geo::GeoArray< T >::operator[]

...

public: const ValueType & operator[]
(
    s32 i
) const

...

Constant array access.


Anchor
a779c86aeb5097796cc37e61da8760739
a779c86aeb5097796cc37e61da8760739

ValueType& Geo::GeoArray< T >::operator[]

...

public: ValueType & operator[]
(
    s32 i
)

...

Non constant array access.


Anchor
a8170b0a16c35919051d13abd5657ddac
a8170b0a16c35919051d13abd5657ddac

GeoArray& Geo::GeoArray< T >::operator=

...

public: GeoArray & operator=
(
    const GeoArray< CompatT > & srcArray
)

...

Assignment operator - The compiler must be able to resolve T = CompatT.


Anchor
a89216d5841c993f6fbbc6aa5b23d1edc
a89216d5841c993f6fbbc6aa5b23d1edc

GeoArray& Geo::GeoArray< T >::operator=

...

public: GeoArray & operator=
(
    const GeoArray & srcArray
)

...

Assignment operator.


Anchor
aee84f11cbccbe8f55b2799153c547fe8
aee84f11cbccbe8f55b2799153c547fe8

GeoArray& Geo::GeoArray< T >::operator=

...

public: GeoArray & operator=
(
    GeoArray && srcArray
)

...

Move assignment operator.


Anchor
a4e1798637575678b3c3a4ddf1d7dcd2d
a4e1798637575678b3c3a4ddf1d7dcd2d

bool Geo::GeoArray< T >::Pop

...

public: bool Pop()

...

Remove the element with the highest index (if there is one)


Anchor
ad9f1ac6ad1af027e72657679a30d3a53
ad9f1ac6ad1af027e72657679a30d3a53

void Geo::GeoArray_Stl< T >::pop_back

...

public: void pop_back()

...

Forwarding functions with Stl naming convention.


Anchor
a4214bb915b5fe0a8d35427ad5d9e89ee
a4214bb915b5fe0a8d35427ad5d9e89ee

void Geo::GeoArray< T >::PopFast

...

protected: void PopFast()

...

Fast version of pop that doesn't do any checking in release.


Anchor
ae15cefc171d2231e426a3b9fbdefc980
ae15cefc171d2231e426a3b9fbdefc980

bool Geo::GeoArray< T >::Push

...

public: bool Push
(
    const T & elem
)

...

Add the specified element to the end of the array.


Anchor
a2aea71bdd91b1940dce8b333b441b5c6
a2aea71bdd91b1940dce8b333b441b5c6

bool Geo::GeoArray< T >::Push

...

public: bool Push
(
    T && elem
)

...

Add the specified element to the end of the array.


Anchor
a92921ba81632f0b4283accf725b6429d
a92921ba81632f0b4283accf725b6429d

bool Geo::GeoArray_Stl< T >::push_back

...

public: bool push_back
(
    const_reference v
)

...

Forwarding functions with Stl naming convention.


Anchor
aa9095d1899d6d0635135f06546571bda
aa9095d1899d6d0635135f06546571bda

void Geo::GeoArray< T >::PushFast

...

protected: void PushFast
(
    T && elem
)

...

Fast version of push that doesn't do any checking in release.


Anchor
ae676d6b0aa50f1906253a2a261175540
ae676d6b0aa50f1906253a2a261175540

void Geo::GeoArray< T >::PushFast

...

protected: void PushFast
(
    const T & elem
)

...

Fast version of push that doesn't do any checking in release.


Anchor
a7c59ea106c62369bdd19dda5d5b820af
a7c59ea106c62369bdd19dda5d5b820af

void Geo::GeoArray< T >::Remove

...

public: void Remove
(
    s32 index
)

...

Remove the element at the specified index, elements at higher indices are shuffled down.


Anchor
aac0e93bd5c531f10dac8b99503693188
aac0e93bd5c531f10dac8b99503693188

void Geo::GeoArray< T >::RemoveFast

...

public: void RemoveFast
(
    s32 index
)

...

Moves the end of the array into the element to be removed, thus not preserving order or existing indices.


Anchor
a12bbdc3b916abbcce2660dc35006c6a3
a12bbdc3b916abbcce2660dc35006c6a3

bool Geo::GeoArray< T >::Resize

...

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.

Parameters
[in]newSize

The new size of the array.

[in]elem

Value for elements that get added if newSize is larger than the current size.

Return Value
false

If newSize is smaller than zero, or if additional memory could not be allocated.


Anchor
a57c65ba3c427a114b23ed74a32e40272
a57c65ba3c427a114b23ed74a32e40272

bool Geo::GeoArray< T >::Resize

...

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.

Parameters
[in]newSize

The new size of the array.

Return Value
false

If newSize is smaller than zero, or if additional memory could not be allocated.


Anchor
a0aa9d8c974878cf05e5faaefc08544d2
a0aa9d8c974878cf05e5faaefc08544d2

bool Geo::GeoArray< T >::ResizeCapacity

...

protected: bool ResizeCapacity
(
    s32 newSize
)

...

Ensure sufficient capacity for Resize operations.


Anchor
a547cf1f5531737f3ee9c7421534712bf
a547cf1f5531737f3ee9c7421534712bf

bool Geo::GeoArray< T >::SetCapacity

...

public: bool SetCapacity
(
    s32 newCapacity
)

...

Change the array's capacity, reallocating memory if the new capacity is different to the current capacity.

Parameters
[in]newCapacity

The new capacity of the array. May not be less than the current size.

Return Value
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.


Anchor
a1935f10d53ff5798a038d9bbd6a9c638
a1935f10d53ff5798a038d9bbd6a9c638

void Geo::GeoArray< T >::Swap

...

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}.

Parameters
[in]other

Other array that the contents of this array will be swapped with.