#ifndef PORYGONLANG_NUMERICALKEYITERATOR_HPP
#define PORYGONLANG_NUMERICALKEYITERATOR_HPP


#include "Iterator.hpp"
#include "../EvalValues/NumericalTableEvalValue.hpp"
#include "../EvalValues/NumericEvalValue.hpp"


namespace Porygon::Evaluation{
    class NumericalKeyIterator : public Iterator{
        const shared_ptr<vector<EvalValuePointer>> _vec;
        const size_t _size;
        long _position = 0;
    public:
        explicit NumericalKeyIterator(const NumericalTableEvalValue* table)
                : _vec(table->GetTable()), _size(_vec->size() + 1){}

        inline const EvalValue* GetCurrent() final{
            return new IntegerEvalValue(_position);
        }

        inline bool MoveNext() final{
            _position++;
            return _position != _size;
        }

        inline void Reset() final{
            _position = 0;
        }
    };
}

#endif //PORYGONLANG_NUMERICALKEYITERATOR_HPP
