diff --git a/Map.hpp b/Map.hpp index 448ee01..cc2d08e 100644 --- a/Map.hpp +++ b/Map.hpp @@ -1,6 +1,8 @@ // commenting everything out when I commit so all commits my code technically // compiles #include +#include +#include #include #include #include @@ -24,16 +26,28 @@ public: // TODO: Iterator functionality class Iterator { public: - using underlying = typename std::vector>::iterator; - private: - underlying store_iter; + // in order traversal, deque used as the stack we traverse up after each + // right hand side traversal completes + // + // if a right child exists traverse down to the left most child of that + // child pushing to stack elements that are passed if it doesn't pop from + // the stack + // + std::vector &parent; + std::deque forward_traversal; + std::deque backward_traversal; + std::size_t current; public: Iterator() = delete; - Iterator(underlying iter) : store_iter{iter} {} + Iterator(std::vector &parent, std::size_t current) + : parent{parent}, forward_traversal{}, backward_traversal{}, + current{current} {} ConstIterator to_const() const { return ConstIterator(this); } - Iterator &operator++() { return *this; } + Iterator &operator++() { + // TODO: implement this + } Iterator operator++(int) { Iterator tmp = *this; ++(*this);