20 #ifndef KERNEL_UTILITIES_VECTOR_H 21 #define KERNEL_UTILITIES_VECTOR_H 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/utility.h" 75 typename pedigree_std::remove_pointer<T_>::type operator*()
const 82 return value == other.value;
92 explicit Vector(
size_t size);
105 T &operator[](
size_t index)
const;
112 size_t count()
const;
115 void pushBack(
const T &value);
121 void pushFront(
const T &value);
126 void setAt(
size_t idx,
const T &value);
128 void swap(Iterator a, Iterator b);
131 void insert(
size_t index,
const T &value);
138 void clear(
bool freeMem=
false);
140 void erase(
size_t index);
142 Iterator erase(Iterator iter);
144 ReverseIterator erase(ReverseIterator iter);
150 return m_Data + m_Start;
156 return m_Data + m_Start;
162 return m_Data + m_Start + m_Count;
168 return m_Data + m_Start + m_Count;
171 ReverseIterator rbegin()
173 return ReverseIterator{.value = m_Data + m_Start + m_Count - 1};
175 ConstReverseIterator rbegin()
const 177 return ConstReverseIterator{.value = m_Data + m_Start + m_Count - 1};
179 ReverseIterator rend()
181 return ReverseIterator{.value = m_Data + m_Start - 1};
183 ConstReverseIterator rend()
const 185 return ConstReverseIterator{.value = m_Data + m_Start - 1};
189 void assign(
const Vector &x);
193 void reserve(
size_t size,
bool copy);
200 void reserve(
size_t size,
bool copy,
bool free);
213 static const int m_ReserveFactor = 2;
251 static T outofbounds = T();
295 const T *oldData =
m_Data;
362 pedigree_std::copy(base + index, base + index + 1,
m_Count - index - 1);
412 if ((copy ==
true) &&
m_Size)
void pushBack(const T &value)
A vector / dynamic array.
Vector & operator=(const Vector &x)
void assign(const Vector &x)
T operator++(T &x, int)
Global postincrement operator for types with overloaded preincrement operator.
void setAt(size_t idx, const T &value)
static const int m_ReserveFactor
void insert(size_t index, const T &value)
ConstIterator begin() const
ConstIterator end() const
An iterator applicable for many data structures.
void pushFront(const T &value)
void reserve(size_t size, bool copy)
T operator--(T &x, int)
Global postdecrement operator for types with overloaded predecrement operator.
bool operator==(const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T1 > &x1, const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T2 > &x2)
T & operator[](size_t index) const
void swap(Iterator a, Iterator b)
void clear(bool freeMem=false)