Go to the documentation of this file.
18 #ifndef __LIBSTD_VECTOR_H
19 #define __LIBSTD_VECTOR_H
36 #define VECTOR_DEFAULT_SIZE 64
153 virtual const T &
at(
Size position)
const
228 T *arr =
new T[
size];
virtual const T * get(Size position) const
Returns the item at the given position.
Vector(Size size=VECTOR_DEFAULT_SIZE)
Constructor.
virtual const T & at(Size position) const
Return item at the given position as a reference.
Vector(const Vector< T > &a)
Copy constructor.
Size m_size
The maximum size of the array.
virtual ~Vector()
Destructor.
virtual const T * vector() const
Get Vector data pointer.
Sequences are containers that provide indexed based storage of items.
virtual Size count() const
Returns the number of items inside the Vector.
unsigned int Size
Any sane size indicator cannot go negative.
virtual int insert(const T &item)
Adds the given item to the Vector, if possible.
virtual Size size() const
Returns the maximum size of this Vector.
virtual bool insert(Size position, const T &item)
Inserts the given item at the given position.
virtual bool resize(Size size)
Resize the Vector.
#define assert(exp)
Insert program diagnostics.
T * m_array
The actual array where the data is stored.
virtual void clear()
Remove all items from the vector.
virtual bool removeAt(Size position)
Removes the item at the given position.
Vectors are dynamically resizeable Arrays.
Size m_count
Number of used items in the array.
#define VECTOR_DEFAULT_SIZE
Default size of an Vector.