29 #ifndef SfiVectorLite_INCLUDED
30 #define SfiVectorLite_INCLUDED
void resize(size_t size)
Resizes the vector storage and adds/removes the elements appropriately.
void reserve(size_t size)
Resizes the underlying vector, but does not change the perceived size.
SfiVectorLite(int size=0)
Initializes the vector to the given size.
int length() const
Returns the size of the vector.
SfiVectorLite< T > & operator=(const SfiVectorLite< T > &vec)
Copies the contents of vec into the vector.
SfiVectorLite(const SfiVectorLite< T > &vec)
Copy constructor.
int capacity() const
Returns the vector's storage capacity.
void pack()
Resizes the vector to the current number of elements.
const T & operator[](int i) const
Returns the i-th element of the vector.
int size() const
Returns the size of the vector.
void clear()
Sets the number of elements to zero without releasing the memory. Use pack() to also release the memo...
void push_back(const T &t)
Appends t to the end of the vector.
vector< T > m_data
The storage for internal data.
T & operator[](int i)
Returns the i-th element of the vector. Can be used as an l-value.
A light version of std::vector that allows push_back and clear without unnecessary memory operations...
size_t m_count
The number of elements in the vector.