#pragma once
#include "../domain/domain.h"

typedef void* TElem;

typedef struct 
{
    TElem* elems;
    int lenght;
    int capacity; 
} Vector;

/*
    Constructor for the Vector
    Input: capacity - the initial capacity of the vector
    Output: a pointer to the newly created vector
*/
Vector* _Vector_Constructor(int capacity);

/*
    Destructor for the Vector
    Input: vector - Vector*
    Output: -
*/
void _Vector_Destructor(Vector* vector);

/*
    Adds an element to the vector
    Input: vector - Vector*
           t - TElem - the element to be added
    Output: 1 - if the element was added
            0 - if the element was not added
*/
int _Vector_add(Vector* vector, TElem t);

/*
    Deletes an element from the vector
    Input: vector - Vector*
           index - int - the index of the element to be deleted
    Output: 1 - if the element was deleted
            0 - if the element was not deleted
*/
int _Vector_delete(Vector* vector,int index);

/*
    Gets an element from the vector
    Input: vector - Vector*
           index - int - the index of the element to be returned
    Output: TElem - the element at the given index
            NULL - if the element was not found
*/
TElem _Vector_getItem(Vector* vector,int index);

/*
    Resizes the vector, doubling its capacity
    Input: vector - Vector*
    Output: -
*/
void _Vector_resize(Vector* vector);

/*
    Gets the length of the vector
    Input: vector - Vector*
    Output: int - the length of the vector
*/
int _Vector_getLength(Vector* vector);

/*
    Gets the capacity of the vector
    Input: vector - Vector*
    Output: int - the capacity of the vector
*/
int _Vector_getCapacity(Vector* vector);


