Go to the documentation of this file.
18 #ifndef __LIB_LIBSTD_INDEX_H
19 #define __LIB_LIBSTD_INDEX_H
36 template <
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++)
virtual Size count() const
Item count in the Index.
virtual bool insertAt(const Size position, T *item)
Inserts the given item at the given position.
Index is a N-sized array of pointers to items of type T.
T * m_array[N]
Array of pointers to items.
void deleteAll()
Removes and delete()'s all items.
virtual Size size() const
Size of the Index.
unsigned int Size
Any sane size indicator cannot go negative.
virtual T * get(const Size position) const
Returns the item at the given position.
T * operator[](const Size i)
Returns the item at the given position in the Index.
virtual bool insert(T *item)
Adds the given item, if possible.
#define assert(exp)
Insert program diagnostics.
virtual bool remove(const Size position)
Removes the item at the given position.
virtual bool contains(const T *item) const
Check if the given item is stored in this Sequence.
virtual bool insert(Size &position, T *item)
Adds the given item, if possible.
Size m_count
Amount of valid pointers in the array.