#pragma once

template <class T> class Vector{
    private:
        T* _data;
        int _size;
        int _capacity;

        void _resize();

    public:

        /*
        * Constructor for the Vector class
        * Input: -
        * Output: vector object with default capacity (10)
        */
        Vector();

        /*
        * Constructor for the Vector class
        * Input: capacity - integer
        * Output: vector object with given capacity
        */
        Vector(int capacity);

        /*
        * Destructor for the Vector class
        * Input: -
        * Output: -
        */
        ~Vector();

        /*
        * Copy constructor for the Vector class
        * Input: vector - vector object
        * Output: vector object
        */
        Vector(const Vector<T> &vector);


        /*
        * Overload of the [] operator
        * Input: index - integer
        * Output: element at the given index
        * Throws: VectorException if index is out of bounds
        */
        T& operator[](int index);

        /*
        * Adds an element to the vector
        * Input: elem - element to be added
        * Output: -
        */
        void add(T elem);

        /*
        * Removes an element from the vector
        * Input: elem - element to be removed
        * Output: -
        * Throws: VectorException if element is not found
        */
        void remove(T elem);

        /*
        * Removes an element from the vector
        * Input: index - index of the element to be removed
        * Output: -
        * Throws: VectorException if index is out of bounds
        */
        void remove(int index);

        /*
        * Returns the index of an element
        * Input: elem - element to be searched
        * Output: index of the element. -1 if not found
        */
        int get(T elem);

        /*
        * Returns the size of the vector
        * Input: -
        * Output: size of the vector
        */
        int size();

        /*
        * Returns the capacity of the vector
        * Input: -
        * Output: capacity of the vector
        */
        int capacity();

        /*
        * Returns the begin iterator
        * Input: -
        * Output: pointer to the first element
        */
        T* begin();

        /*
        * Returns the end iterator
        * Input: -
        * Output: pointer to the last element
        */
        T* end();
};
