From 7ca0a3eafd9463dd2f2020dc4613e8aa5f132e17 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Wed, 6 Mar 2013 00:06:26 +0100 Subject: [PATCH] adding iterator skeleton --- graph.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/graph.h b/graph.h index d9b5a05..cf6378a 100644 --- a/graph.h +++ b/graph.h @@ -3,6 +3,7 @@ #include #include +#include // directed, weighted /// @todo weight type as param too? @@ -70,10 +71,47 @@ public: private: + Graph(const Graph& o) { /** @todo impelemnt me */ } + Graph& operator=(const Graph& o) { /** @todo impelemnt me */ } + typename std::vector::const_iterator find(const_reference data) const; typename std::vector::iterator find(const_reference data); std::vector m_vertices; + +public: + + class iterator : public std::iterator + { + public: + typedef iterator self_type; + typedef iterator& reference_self_type; + typedef const iterator& const_reference_self_type; + + iterator() { /** @todo impelemnt me */ } + ~iterator() { /** @todo impelemnt me */ } + iterator(const_reference_self_type o) { /** @todo impelemnt me */ } + reference_self_type operator=(const_reference_self_type o) { /** @todo impelemnt me */ } + + reference operator*() { /** @todo impelemnt me */ } + pointer operator->() { /** @todo impelemnt me */ } + + self_type &operator++() { /** @todo impelemnt me */ } + self_type operator++(int) { /** @todo impelemnt me */ } + self_type operator+(difference_type n) { /** @todo impelemnt me */ } + self_type &operator+=(difference_type n) { /** @todo impelemnt me */ } + bool operator==(const_reference_self_type o) { /** @todo impelemnt me */ return false; } + bool operator!=(const_reference_self_type o) { return !(*this == o); } + }; + + iterator begin() { /** @todo impelemnt me */ } + iterator end() { /** @todo impelemnt me */ } + + /// @todo const iterator and cbegin and cend };