Template Class Array

Nested Relationships

Class Documentation

template <typename Type, U32 MaxSize>
class Array

Public Functions

Array(Memory::Allocator &alloc)
~Array()
Array(const Array &other)
Array(Array &&other)
Array<Type, MaxSize> &operator=(const Array &other)
Array<Type, MaxSize> &operator=(Array &&other)
void PushBack(const Type &data)

Appends data to the end of the array.

Parameters
  • data: Data to push

Type Pop()

Removes the last element in the array array.

Return
Element that was popped

int FindFirst(const Type &data)

Searches for the data in the Array.

Return
Index if Found, else -1
Parameters
  • data: Data to search for

void Remove(const Type &data)

Searches for the given data in the array and removes it.

Parameters
  • data: Data to Search for and Remove

bool IsEmpty() const

Checks if the container is empty.

Return
true if empty

void InsertAt(U32 idx, const Type &data)

Inserts the supplied data at the index.

Parameters
  • idx: Target Index
  • data: Data to insert

Type &operator[](U32 idx)
Type &operator[](U32 idx) const
Type *Data()
U32 GetSize() const
U32 GetMaxSize() const
Array<Type, MaxSize>::Iterator Begin() const

Returns an Iterator pointing to the beginning of the array. This is similar to begin() of a std::array.

Return
Iterator

Array<Type, MaxSize>::Iterator End() const

Returns an Iterator pointing to the end of the array. This is similar to end() of a std::array.

Return
Iterator

class Iterator

Public Types

template<>
using iterator_category = std::random_access_iterator_tag
template<>
using value_type = Type
template<>
using difference_type = int
template<>
using pointer = Type *
template<>
using reference = Type&

Public Functions

template<>
Iterator()
template<>
~Iterator()
template<>
Iterator(const Iterator &other)
template<>
Iterator &operator=(const Iterator &other)
template<>
Iterator(const Array *ptr, int index)
template<>
Iterator(Iterator &&other)
template<>
Iterator &operator=(Iterator &&other)
template<>
Iterator &operator++()
template<>
Iterator operator++(int)
template<>
Iterator &operator--()
template<>
Iterator operator--(int)
template<>
bool operator==(const Iterator &rhs)
template<>
bool operator!=(const Iterator &rhs)
template<>
bool operator<(const Iterator &rhs)
template<>
bool operator<=(const Iterator &rhs)
template<>
bool operator>(const Iterator &rhs)
template<>
bool operator>=(const Iterator &rhs)
template<>
Iterator operator+(const int &idx)
template<>
Iterator &operator+=(const int &idx)
template<>
Iterator operator-(const int &idx)
template<>
Iterator &operator-=(const int &idx)
template<>
int operator-(const Iterator &rhs)
template<>
Type &operator*()
template<>
Type *operator->()
template<>
Type &operator[](const int &idx)

Friends

int operator-(const Iterator &lhs, const Iterator &rhs)