29 #define MIN_CAPACITY 2
31 #define MAX_CAPACITY 2048
33 #define RESIZE_COEFFICIENT 2
Declaration of constants used by the modules.
Preprocessor file used for including library for modules.
data_type * data
Contiguous memory segment with in data is stored.
size_t size
Field for determining the amount of elements actually stored in memory.
size_t capacity
Field for determining the amount of possible elements that can be stored in memory without resizing t...
void resize(vector *const vector, const size_t newCapacity)
Resizes the capacity of the vector with the new capacity specified. If vector's data's block allocati...
void freeVector(vector *const vector)
Frees the memory used from the vector structure.
void pushFront(vector *const vector, const data_type element)
Pushes an element at the front of the vector. If necessary, the vector is resized automatically.
char data_type
The type of data wrapped in the vector structure. For convenience char has been choosen so it can wra...
data_type popBack(vector *const vector)
Pops the element at the back of the vector. If necessary, the vector is resized automatically....
data_type at(vector *vector, size_t index)
Access at the element in the given index of the vector. If the index is greater or equal to the vecto...
vector * buildVector()
Builds a vector structure initializing its fields. If vector's allocation or data's block allocation ...
void pushBack(vector *const vector, const data_type element)
Pushes an element at the back of the vector.
data_type popFront(vector *const vector)
Pops the element at the back of the vector. If necessary, the vector is resized automatically....