18#ifndef __LIB_LIBSTD_INDEX_H
19#define __LIB_LIBSTD_INDEX_H
36template <
class T, const Size N>
class Index
46 for (
Size i = 0; i < N; i++)
68 else if (item ==
ZERO)
74 for (
Size i = 0; i < N; i++)
100 return insert(ignored, item);
121 else if (item ==
ZERO)
168 for (
Size i = 0; i < N; i++)
203 for (
Size i = 0; i < N; i++)
Index is a N-sized array of pointers to items of type T.
T * operator[](const Size i)
Returns the item at the given position in the Index.
virtual Size count() const
Item count in the Index.
virtual bool contains(const T *item) const
Check if the given item is stored in this Sequence.
virtual T * get(const Size position) const
Returns the item at the given position.
void deleteAll()
Removes and delete()'s all items.
T * m_array[N]
Array of pointers to items.
virtual bool insertAt(const Size position, T *item)
Inserts the given item at the given position.
virtual bool insert(Size &position, T *item)
Adds the given item, if possible.
Size m_count
Amount of valid pointers in the array.
virtual Size size() const
Size of the Index.
virtual bool insert(T *item)
Adds the given item, if possible.
virtual bool remove(const Size position)
Removes the item at the given position.
#define assert(exp)
Insert program diagnostics.
unsigned int Size
Any sane size indicator cannot go negative.