Some more docs.
authoralpar
Tue, 27 Apr 2004 08:31:00 +0000
changeset 4341ce1b4cd8dd5
parent 433 d9fac1497298
child 435 8f1dece01cc4
Some more docs.
DirPath::Builder::setFist() added. (It is empty.)
doc/Doxyfile
src/work/klao/path.h
     1.1 --- a/doc/Doxyfile	Tue Apr 27 08:19:39 2004 +0000
     1.2 +++ b/doc/Doxyfile	Tue Apr 27 08:31:00 2004 +0000
     1.3 @@ -404,6 +404,7 @@
     1.4                           ../src/include/xy.h \
     1.5                           ../src/work/alpar/list_graph.h \
     1.6                           ../src/work/athos/minlengthpaths.h \
     1.7 +                         ../src/work/klao/path.h \
     1.8  			 ../src/work/marci/graph_wrapper.h	
     1.9                           
    1.10  
     2.1 --- a/src/work/klao/path.h	Tue Apr 27 08:19:39 2004 +0000
     2.2 +++ b/src/work/klao/path.h	Tue Apr 27 08:31:00 2004 +0000
     2.3 @@ -1,10 +1,8 @@
     2.4  // -*- c++ -*- //
     2.5  
     2.6 -/**
     2.7 - *
     2.8 - * Class for representing paths in graphs.
     2.9 - *
    2.10 - */
    2.11 +///ingroup datas
    2.12 +///\file
    2.13 +///\brief Class for representing paths in graphs.
    2.14  
    2.15  #ifndef HUGO_PATH_H
    2.16  #define HUGO_PATH_H
    2.17 @@ -17,6 +15,18 @@
    2.18  
    2.19  namespace hugo {
    2.20  
    2.21 +  /// \addtogroup datas
    2.22 +  /// @{
    2.23 +
    2.24 +  ///A container for directed paths
    2.25 +
    2.26 +  ///\param Graph The graph type in which the path is.
    2.27 +  ///
    2.28 +  ///In a sense, the path can be treated as a graph, for is has \c NodeIt
    2.29 +  ///and \c EdgeIt with the same usage. These types converts to the \c Node
    2.30 +  ///and \c Edge of the original graph.
    2.31 +  ///\todo How to clear a path?
    2.32 +  ///\todo Clarify the consistency checks to do.
    2.33    template<typename Graph>
    2.34    class DirPath {
    2.35    public:
    2.36 @@ -32,13 +42,17 @@
    2.37  
    2.38    public:
    2.39  
    2.40 +    /// Constructor
    2.41 +    
    2.42 +    /// \param _G The graph in which the path is.
    2.43 +    ///
    2.44      DirPath(const Graph &_G) : gr(&_G) {}
    2.45  
    2.46      /// Subpath defined by two nodes.
    2.47 -    /// It is an error if the two edges are not in order!
    2.48 +    /// \warning It is an error if the two edges are not in order!
    2.49      DirPath(const DirPath &P, const NodeIt &a, const NodeIt &b);
    2.50      /// Subpath defined by two edges. Contains edges in [a,b)
    2.51 -    /// It is an error if the two edges are not in order!
    2.52 +    /// \warning It is an error if the two edges are not in order!
    2.53      DirPath(const DirPath &P, const EdgeIt &a, const EdgeIt &b);
    2.54  
    2.55      size_t length() const { return edges.size(); }
    2.56 @@ -128,13 +142,36 @@
    2.57      };
    2.58  
    2.59      friend class Builder;    
    2.60 +
    2.61 +    ///Class to build paths
    2.62 +
    2.63 +    ///\ingroup datas
    2.64 +    ///This class is used to build new paths.
    2.65 +    ///You can push new edges to the front and to the back of the path in
    2.66 +    ///arbitrary order the you can commit these changes to the graph.
    2.67 +    ///\todo We must clarify when the path will be in "transitional" state.
    2.68      class Builder {
    2.69        DirPath &P;
    2.70        Container d;
    2.71  
    2.72      public:
    2.73 +      ///Constructor
    2.74 +
    2.75 +      ///\param _P the path you want to build.
    2.76 +      ///
    2.77        Builder(DirPath &_P) : P(_P) {}
    2.78  
    2.79 +      ///Set the first node of the path.
    2.80 +      
    2.81 +      ///Set the first node of the path.
    2.82 +      ///If the path is empty, this must be call before any call of
    2.83 +      ///\ref pushFront() or \ref pushBack()
    2.84 +      void setFirst(const GraphNode &) { }
    2.85 +      
    2.86 +      ///Push a new edge to the front of the path
    2.87 +
    2.88 +      ///Push a new edge to the front of the path.
    2.89 +      ///\sa setFirst()
    2.90        bool pushFront(const GraphEdge& e) {
    2.91  	if( empty() || P.gr->head(e)==from() ) {
    2.92  	  d.push_back(e);
    2.93 @@ -142,6 +179,10 @@
    2.94  	}
    2.95  	return false;
    2.96        }
    2.97 +      ///Push a new edge to the back of the path
    2.98 +
    2.99 +      ///Push a new edge to the back of the path.
   2.100 +      ///\sa setFirst()
   2.101        bool pushBack(const GraphEdge& e) {
   2.102  	if( empty() || P.gr->tail(e)==to() ) {
   2.103  	  P.edges.push_back(e);
   2.104 @@ -150,6 +191,7 @@
   2.105  	return false;
   2.106        }
   2.107  
   2.108 +      ///Commit the changes to the path.
   2.109        void commit() {
   2.110  	if( !d.empty() ) {
   2.111  	  P.edges.insert(P.edges.begin(), d.rbegin(), d.rend());
   2.112 @@ -157,6 +199,11 @@
   2.113  	}
   2.114        }
   2.115  
   2.116 +      ///Desctuctor
   2.117 +
   2.118 +      ///The desctuctor.
   2.119 +      ///It commit also commit the changes.
   2.120 +      ///\todo Is this what we want?
   2.121        ~Builder() { commit(); }
   2.122  
   2.123        // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
   2.124 @@ -199,7 +246,6 @@
   2.125  
   2.126  
   2.127  
   2.128 -
   2.129    /**********************************************************************/
   2.130  
   2.131  
   2.132 @@ -612,6 +658,7 @@
   2.133      _last = P.graphNode(b);
   2.134    }
   2.135  
   2.136 +  ///@}
   2.137  
   2.138  } // namespace hugo
   2.139