26 template<typename GR> |
27 template<typename GR> |
27 class Path { |
28 class Path { |
28 public: |
29 public: |
29 |
30 |
30 /// Type of the underlying graph. |
31 /// Type of the underlying graph. |
31 typedef typename GR Graph; |
32 typedef /*typename*/ GR Graph; |
32 /// Edge type of the underlying graph. |
33 /// Edge type of the underlying graph. |
33 typedef typename Graph::Edge GraphEdge; |
34 typedef typename Graph::Edge GraphEdge; |
34 /// Node type of the underlying graph. |
35 /// Node type of the underlying graph. |
35 typedef typename Graph::Node GraphNode; |
36 typedef typename Graph::Node GraphNode; |
36 class NodeIt; |
37 class NodeIt; |
37 class EdgeIt; |
38 class EdgeIt; |
38 |
39 |
39 /// \param _G The graph in which the path is. |
40 /// \param _G The graph in which the path is. |
40 /// |
41 /// |
41 Path(const Graph &_G) {} |
42 Path(const Graph &_G) {} |
42 |
43 |
43 /// Length of the path. |
44 /// Length of the path. |
44 size_t length() const {} |
45 size_t length() const {return 0;} |
45 /// Returns whether the path is empty. |
46 /// Returns whether the path is empty. |
46 bool empty() const {} |
47 bool empty() const {} |
47 |
48 |
48 /// Resets the path to an empty path. |
49 /// Resets the path to an empty path. |
49 void clear() {} |
50 void clear() {} |
50 |
51 |
51 /// \brief Starting point of the path. |
52 /// \brief Starting point of the path. |
52 /// |
53 /// |
53 /// Starting point of the path. |
54 /// Starting point of the path. |
54 /// Returns INVALID if the path is empty. |
55 /// Returns INVALID if the path is empty. |
55 NodeIt head() const {} |
56 GraphNode/*It*/ head() const {return INVALID;} |
56 /// \brief End point of the path. |
57 /// \brief End point of the path. |
57 /// |
58 /// |
58 /// End point of the path. |
59 /// End point of the path. |
59 /// Returns INVALID if the path is empty. |
60 /// Returns INVALID if the path is empty. |
60 NodeIt tail() const {} |
61 GraphNode/*It*/ tail() const {return INVALID;} |
61 |
62 |
62 /// \brief First NodeIt/EdgeIt. |
63 /// \brief First NodeIt/EdgeIt. |
63 /// |
64 /// |
64 /// Initializes node or edge iterator to point to the first |
65 /// Initializes node or edge iterator to point to the first |
65 /// node or edge. |
66 /// node or edge. |
163 * the underlining Path is in a |
164 * the underlining Path is in a |
164 * "transitional" state (operations on it have undefined result). |
165 * "transitional" state (operations on it have undefined result). |
165 */ |
166 */ |
166 class Builder { |
167 class Builder { |
167 public: |
168 public: |
|
169 |
|
170 Path &P; |
|
171 |
168 ///\param _P the path you want to fill in. |
172 ///\param _P the path you want to fill in. |
169 /// |
173 /// |
170 Builder(Path &_P) : P(_P) {} |
174 Builder(Path &_P) : P(_P) {} |
171 |
175 |
172 /// Sets the starting node of the path. |
176 /// Sets the starting node of the path. |