Improve docs.
5 ///\brief Classes for representing paths in graphs.
10 #include <hugo/invalid.h>
14 /// \addtogroup skeletons
18 //! \brief A skeletom structure for representing directed paths in a graph.
20 //! A skeleton structure for representing directed paths in a graph.
21 //! \param GR The graph type in which the path is.
23 //! In a sense, the path can be treated as a graph, for is has \c NodeIt
24 //! and \c EdgeIt with the same usage. These types converts to the \c Node
25 //! and \c Edge of the original graph.
30 /// Type of the underlying graph.
31 typedef typename GR Graph;
32 /// Edge type of the underlying graph.
33 typedef typename Graph::Edge GraphEdge;
34 /// Node type of the underlying graph.
35 typedef typename Graph::Node GraphNode;
39 /// \param _G The graph in which the path is.
41 Path(const Graph &_G) {}
43 /// Length of the path.
44 size_t length() const {}
45 /// Returns whether the path is empty.
48 /// Resets the path to an empty path.
51 /// \brief Starting point of the path.
53 /// Starting point of the path.
54 /// Returns INVALID if the path is empty.
55 NodeIt head() const {}
56 /// \brief End point of the path.
58 /// End point of the path.
59 /// Returns INVALID if the path is empty.
60 NodeIt tail() const {}
62 /// \brief First NodeIt/EdgeIt.
64 /// Initializes node or edge iterator to point to the first
67 It& first(It &i) const { return i=It(*this); }
69 /// \brief The head of an edge.
71 /// Returns node iterator pointing to the head node of the
72 /// given edge iterator.
73 NodeIt head(const EdgeIt& e) const {}
75 /// \brief The tail of an edge.
77 /// Returns node iterator pointing to the tail node of the
78 /// given edge iterator.
79 NodeIt tail(const EdgeIt& e) const {}
82 /* Iterator classes */
85 * \brief Iterator class to iterate on the edges of the paths
88 * This class is used to iterate on the edges of the paths
90 * Of course it converts to Graph::Edge
95 /// Default constructor
97 /// Invalid constructor
99 /// Constructor with starting point
100 EdgeIt(const Path &_p) {}
102 operator GraphEdge () const {}
105 EdgeIt& operator++() {}
107 /// Comparison operator
108 bool operator==(const EdgeIt& e) const {}
109 /// Comparison operator
110 bool operator!=(const EdgeIt& e) const {}
111 // /// Comparison operator
112 // /// \todo It is not clear what is the "natural" ordering.
113 // bool operator<(const EdgeIt& e) const {}
118 * \brief Iterator class to iterate on the nodes of the paths
121 * This class is used to iterate on the nodes of the paths
123 * Of course it converts to Graph::Node.
128 /// Default constructor
130 /// Invalid constructor
132 /// Constructor with starting point
133 NodeIt(const Path &_p) {}
135 ///Conversion to Graph::Node
136 operator const GraphNode& () const {}
138 NodeIt& operator++() {}
140 /// Comparison operator
141 bool operator==(const NodeIt& e) const {}
142 /// Comparison operator
143 bool operator!=(const NodeIt& e) const {}
144 // /// Comparison operator
145 // /// \todo It is not clear what is the "natural" ordering.
146 // bool operator<(const NodeIt& e) const {}
150 friend class Builder;
153 * \brief Class to build paths
156 * This class is used to fill a path with edges.
158 * You can push new edges to the front and to the back of the path in
159 * arbitrary order then you should commit these changes to the graph.
161 * While the builder is active (after the first modifying
162 * operation and until the call of \ref commit())
163 * the underlining Path is in a
164 * "transitional" state (operations on it have undefined result).
168 ///\param _P the path you want to fill in.
170 Builder(Path &_P) : P(_P) {}
172 /// Sets the starting node of the path.
174 /// Sets the starting node of the path. Edge added to the path
175 /// afterwards have to be incident to this node.
176 /// You \em must start building an empry path with this functions.
177 /// (And you \em must \em not use it later).
180 void setStartNode(const GraphNode &) {}
182 ///Push a new edge to the front of the path
184 ///Push a new edge to the front of the path.
185 ///If the path is empty, you \em must call \ref setStartNode() before
186 ///the first use of \ref pushFront().
187 void pushFront(const GraphEdge& e) {}
189 ///Push a new edge to the back of the path
191 ///Push a new edge to the back of the path.
192 ///If the path is empty, you \em must call \ref setStartNode() before
193 ///the first use of \ref pushBack().
194 void pushBack(const GraphEdge& e) {}
196 ///Commit the changes to the path.
199 ///Reserve (front) storage for the builder in advance.
201 ///If you know an reasonable upper bound of the number of the edges
202 ///to add to the front of the path,
203 ///using this function you may speed up the building.
204 void reserveFront(size_t r) {}
205 ///Reserve (back) storage for the builder in advance.
207 ///If you know an reasonable upper bound of the number of the edges
208 ///to add to the back of the path,
209 ///using this function you may speed up the building.
210 void reserveBack(size_t r) {}
219 #endif // HUGO_PATH_H