// DllIterator.h doubly linked list iterator class for Encoder // an iterator of this type operates on the Encoder dll #ifndef DLL_ITERATOR #define DLL_ITERATOR #include #include "TNode.h" template // doubly linked list const iterator class DllIterator { private: TNode *curr; // points to current node public: // initializes curr to currIn DllIterator(TNode *currIn = NULL); // returns a pointer to an element of type T const TNode * operator->() const; // dereference curr, returns element of type T const T &operator*() const; // pre-increment operator // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator &operator++(); // post-increment operator // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator++(int); // pre-decrement operator // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator &operator--(); // post-decrement operator // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator--(int); // for iterator math // for example it = it + 4; // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator+(const int &); // for iterator math // for example it = it - 4; // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator-(const int &); // for iterator math // for example it -= 4; // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator-=(const int &); // for iterator math // for example it += 4; // THROWS OutOfBounds EXCEPTION if you walk off the dll DllIterator operator+=(const int &); // equality operator bool operator==(const DllIterator &other); // inequality operator bool operator!=(const DllIterator &other); private: // you may put any private member functions here }; #endif // DLL_ITERATOR