[Lemon-commits] [lemon_svn] alpar: r582 - in hugo/trunk: doc src/work/klao

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:40:22 CET 2006


Author: alpar
Date: Tue Apr 27 10:31:00 2004
New Revision: 582

Modified:
   hugo/trunk/doc/Doxyfile
   hugo/trunk/src/work/klao/path.h

Log:
Some more docs.
DirPath::Builder::setFist() added. (It is empty.)


Modified: hugo/trunk/doc/Doxyfile
==============================================================================
--- hugo/trunk/doc/Doxyfile	(original)
+++ hugo/trunk/doc/Doxyfile	Tue Apr 27 10:31:00 2004
@@ -404,6 +404,7 @@
                          ../src/include/xy.h \
                          ../src/work/alpar/list_graph.h \
                          ../src/work/athos/minlengthpaths.h \
+                         ../src/work/klao/path.h \
 			 ../src/work/marci/graph_wrapper.h	
                          
 

Modified: hugo/trunk/src/work/klao/path.h
==============================================================================
--- hugo/trunk/src/work/klao/path.h	(original)
+++ hugo/trunk/src/work/klao/path.h	Tue Apr 27 10:31:00 2004
@@ -1,10 +1,8 @@
 // -*- c++ -*- //
 
-/**
- *
- * Class for representing paths in graphs.
- *
- */
+///ingroup datas
+///\file
+///\brief Class for representing paths in graphs.
 
 #ifndef HUGO_PATH_H
 #define HUGO_PATH_H
@@ -17,6 +15,18 @@
 
 namespace hugo {
 
+  /// \addtogroup datas
+  /// @{
+
+  ///A container for directed paths
+
+  ///\param Graph The graph type in which the path is.
+  ///
+  ///In a sense, the path can be treated as a graph, for is has \c NodeIt
+  ///and \c EdgeIt with the same usage. These types converts to the \c Node
+  ///and \c Edge of the original graph.
+  ///\todo How to clear a path?
+  ///\todo Clarify the consistency checks to do.
   template<typename Graph>
   class DirPath {
   public:
@@ -32,13 +42,17 @@
 
   public:
 
+    /// Constructor
+    
+    /// \param _G The graph in which the path is.
+    ///
     DirPath(const Graph &_G) : gr(&_G) {}
 
     /// Subpath defined by two nodes.
-    /// It is an error if the two edges are not in order!
+    /// \warning It is an error if the two edges are not in order!
     DirPath(const DirPath &P, const NodeIt &a, const NodeIt &b);
     /// Subpath defined by two edges. Contains edges in [a,b)
-    /// It is an error if the two edges are not in order!
+    /// \warning It is an error if the two edges are not in order!
     DirPath(const DirPath &P, const EdgeIt &a, const EdgeIt &b);
 
     size_t length() const { return edges.size(); }
@@ -128,13 +142,36 @@
     };
 
     friend class Builder;    
+
+    ///Class to build paths
+
+    ///\ingroup datas
+    ///This class is used to build new paths.
+    ///You can push new edges to the front and to the back of the path in
+    ///arbitrary order the you can commit these changes to the graph.
+    ///\todo We must clarify when the path will be in "transitional" state.
     class Builder {
       DirPath &P;
       Container d;
 
     public:
+      ///Constructor
+
+      ///\param _P the path you want to build.
+      ///
       Builder(DirPath &_P) : P(_P) {}
 
+      ///Set the first node of the path.
+      
+      ///Set the first node of the path.
+      ///If the path is empty, this must be call before any call of
+      ///\ref pushFront() or \ref pushBack()
+      void setFirst(const GraphNode &) { }
+      
+      ///Push a new edge to the front of the path
+
+      ///Push a new edge to the front of the path.
+      ///\sa setFirst()
       bool pushFront(const GraphEdge& e) {
 	if( empty() || P.gr->head(e)==from() ) {
 	  d.push_back(e);
@@ -142,6 +179,10 @@
 	}
 	return false;
       }
+      ///Push a new edge to the back of the path
+
+      ///Push a new edge to the back of the path.
+      ///\sa setFirst()
       bool pushBack(const GraphEdge& e) {
 	if( empty() || P.gr->tail(e)==to() ) {
 	  P.edges.push_back(e);
@@ -150,6 +191,7 @@
 	return false;
       }
 
+      ///Commit the changes to the path.
       void commit() {
 	if( !d.empty() ) {
 	  P.edges.insert(P.edges.begin(), d.rbegin(), d.rend());
@@ -157,6 +199,11 @@
 	}
       }
 
+      ///Desctuctor
+
+      ///The desctuctor.
+      ///It commit also commit the changes.
+      ///\todo Is this what we want?
       ~Builder() { commit(); }
 
       // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
@@ -199,7 +246,6 @@
 
 
 
-
   /**********************************************************************/
 
 
@@ -612,6 +658,7 @@
     _last = P.graphNode(b);
   }
 
+  ///@}
 
 } // namespace hugo
 



More information about the Lemon-commits mailing list