1.1 --- a/src/hugo/skeletons/path.h Sun Sep 12 19:32:21 2004 +0000
1.2 +++ b/src/hugo/skeletons/path.h Sun Sep 12 21:46:26 2004 +0000
1.3 @@ -1,12 +1,11 @@
1.4 -#define SKELETON
1.5 // -*- c++ -*- //
1.6
1.7 ///\ingroup skeletons
1.8 ///\file
1.9 ///\brief Classes for representing paths in graphs.
1.10
1.11 -#ifndef HUGO_PATH_H
1.12 -#define HUGO_PATH_H
1.13 +#ifndef HUGO_SKELETON_PATH_H
1.14 +#define HUGO_SKELETON_PATH_H
1.15
1.16 #include <hugo/invalid.h>
1.17
1.18 @@ -14,38 +13,38 @@
1.19 namespace skeleton {
1.20 /// \addtogroup skeletons
1.21 /// @{
1.22 -
1.23 -
1.24 +
1.25 +
1.26 //! \brief A skeletom structure for representing directed paths in a graph.
1.27 //!
1.28 //! A skeleton structure for representing directed paths in a graph.
1.29 //! \param GR The graph type in which the path is.
1.30 - //!
1.31 + //!
1.32 //! In a sense, the path can be treated as a graph, for is has \c NodeIt
1.33 //! and \c EdgeIt with the same usage. These types converts to the \c Node
1.34 //! and \c Edge of the original graph.
1.35 template<typename GR>
1.36 class Path {
1.37 public:
1.38 -
1.39 +
1.40 /// Type of the underlying graph.
1.41 typedef /*typename*/ GR Graph;
1.42 /// Edge type of the underlying graph.
1.43 - typedef typename Graph::Edge GraphEdge;
1.44 + typedef typename Graph::Edge GraphEdge;
1.45 /// Node type of the underlying graph.
1.46 typedef typename Graph::Node GraphNode;
1.47 class NodeIt;
1.48 class EdgeIt;
1.49 -
1.50 +
1.51 /// \param _G The graph in which the path is.
1.52 ///
1.53 Path(const Graph &_G) {}
1.54 -
1.55 +
1.56 /// Length of the path.
1.57 size_t length() const {return 0;}
1.58 /// Returns whether the path is empty.
1.59 - bool empty() const {}
1.60 -
1.61 + bool empty() const { return true;}
1.62 +
1.63 /// Resets the path to an empty path.
1.64 void clear() {}
1.65
1.66 @@ -71,25 +70,25 @@
1.67 ///
1.68 /// Returns node iterator pointing to the head node of the
1.69 /// given edge iterator.
1.70 - NodeIt head(const EdgeIt& e) const {}
1.71 + NodeIt head(const EdgeIt& e) const {return INVALID;}
1.72
1.73 /// \brief The tail of an edge.
1.74 ///
1.75 /// Returns node iterator pointing to the tail node of the
1.76 /// given edge iterator.
1.77 - NodeIt tail(const EdgeIt& e) const {}
1.78 + NodeIt tail(const EdgeIt& e) const {return INVALID;}
1.79
1.80
1.81 /* Iterator classes */
1.82
1.83 /**
1.84 * \brief Iterator class to iterate on the edges of the paths
1.85 - *
1.86 + *
1.87 * \ingroup skeletons
1.88 * This class is used to iterate on the edges of the paths
1.89 *
1.90 * Of course it converts to Graph::Edge
1.91 - *
1.92 + *
1.93 */
1.94 class EdgeIt {
1.95 public:
1.96 @@ -103,7 +102,7 @@
1.97 operator GraphEdge () const {}
1.98
1.99 /// Next edge
1.100 - EdgeIt& operator++() {}
1.101 + EdgeIt& operator++() {return *this;}
1.102
1.103 /// Comparison operator
1.104 bool operator==(const EdgeIt& e) const {return true;}
1.105 @@ -117,12 +116,12 @@
1.106
1.107 /**
1.108 * \brief Iterator class to iterate on the nodes of the paths
1.109 - *
1.110 + *
1.111 * \ingroup skeletons
1.112 * This class is used to iterate on the nodes of the paths
1.113 *
1.114 * Of course it converts to Graph::Node.
1.115 - *
1.116 + *
1.117 */
1.118 class NodeIt {
1.119 public:
1.120 @@ -136,23 +135,23 @@
1.121 ///Conversion to Graph::Node
1.122 operator const GraphNode& () const {}
1.123 /// Next node
1.124 - NodeIt& operator++() {}
1.125 + NodeIt& operator++() {return *this;}
1.126
1.127 /// Comparison operator
1.128 - bool operator==(const NodeIt& e) const {}
1.129 + bool operator==(const NodeIt& e) const {return true;}
1.130 /// Comparison operator
1.131 - bool operator!=(const NodeIt& e) const {}
1.132 + bool operator!=(const NodeIt& e) const {return true;}
1.133 // /// Comparison operator
1.134 // /// \todo It is not clear what is the "natural" ordering.
1.135 // bool operator<(const NodeIt& e) const {}
1.136
1.137 };
1.138
1.139 - friend class Builder;
1.140 + friend class Builder;
1.141
1.142 /**
1.143 * \brief Class to build paths
1.144 - *
1.145 + *
1.146 * \ingroup skeletons
1.147 * This class is used to fill a path with edges.
1.148 *
1.149 @@ -174,7 +173,7 @@
1.150 Builder(Path &_P) : P(_P) {}
1.151
1.152 /// Sets the starting node of the path.
1.153 -
1.154 +
1.155 /// Sets the starting node of the path. Edge added to the path
1.156 /// afterwards have to be incident to this node.
1.157 /// You \em must start building an empry path with this functions.
1.158 @@ -217,7 +216,7 @@
1.159
1.160 ///@}
1.161 }
1.162 -
1.163 +
1.164 } // namespace hugo
1.165
1.166 -#endif // HUGO_PATH_H
1.167 +#endif // HUGO_SKELETON_PATH_H