diff -r 4acba8684811 -r b255f25ad394 src/work/alpar/emptygraph.h --- a/src/work/alpar/emptygraph.h Wed Mar 24 09:36:21 2004 +0000 +++ b/src/work/alpar/emptygraph.h Wed Mar 24 13:06:06 2004 +0000 @@ -2,6 +2,9 @@ #ifndef HUGO_EMPTYGRAPH_H #define HUGO_EMPTYGRAPH_H +///\file +///\brief Declaration of GraphSkeleton. + #include /// The namespace of HugoLib @@ -12,9 +15,6 @@ /// An empty graph class. - /// When you read this for the first time, - /// please send an e-mail to alpar\@cs.elte.hu. - /// /// This class provides all the common features of a graph structure, /// however completely without implementations and real data structures /// behind the interface. @@ -102,9 +102,9 @@ bool operator<(Edge n) const { return true; } }; - /// This iterator goes trought the outgoing edges of a node. + /// This iterator goes trough the outgoing edges of a node. - /// This iterator goes trought the \e outgoing edges of a certain node + /// This iterator goes trough the \e outgoing edges of a certain node /// of a graph. /// Its usage is quite simple, for example you can count the number /// of outgoing edges of a node \c n @@ -130,9 +130,9 @@ OutEdgeIt(const GraphSkeleton & G, Node n) {} }; - /// This iterator goes trought the incoming edges of a node. + /// This iterator goes trough the incoming edges of a node. - /// This iterator goes trought the \e incoming edges of a certain node + /// This iterator goes trough the \e incoming edges of a certain node /// of a graph. /// Its usage is quite simple, for example you can count the number /// of outgoing edges of a node \c n @@ -178,9 +178,9 @@ /// NodeIt &first(NodeIt &i) const { return i;} + /// The first incoming edge. + InEdgeIt &first(InEdgeIt &i, Node n) const { return i;} /// The first outgoing edge. - InEdgeIt &first(InEdgeIt &i, Node n) const { return i;} - /// The first incoming edge. OutEdgeIt &first(OutEdgeIt &i, Node n) const { return i;} // SymEdgeIt &first(SymEdgeIt &, Node) const { return i;} /// The first edge of the Graph. @@ -228,12 +228,12 @@ ///Gives back the \e id of a node. - ///\warning Not all graph structure provide this feature. + ///\warning Not all graph structures provide this feature. /// int id(const Node) const { return 0;} ///Gives back the \e id of an edge. - ///\warning Not all graph structure provide this feature. + ///\warning Not all graph structures provide this feature. /// int id(const Edge) const { return 0;} @@ -252,18 +252,7 @@ ///\return the new edge. Edge addEdge(Node tail, Node head) { return INVALID;} - /// Deletes a node. - - ///\warning Not all graph structure provide this feature. - /// - void erase(Node n) {} - /// Deletes an edge. - - ///\warning Not all graph structure provide this feature. - /// - void erase(Edge e) {} - - /// Reset the graph. + /// Resets the graph. /// This function deletes all edges and nodes of the graph. /// It also frees the memory allocated to store them. @@ -271,11 +260,13 @@ int nodeNum() const { return 0;} int edgeNum() const { return 0;} - + + /// Defalult constructor. GraphSkeleton() {} + ///Copy consructor. GraphSkeleton(const GraphSkeleton &G) {} - + ///Read/write/reference map of the nodes to type \c T. @@ -343,6 +334,40 @@ }; }; + /// An empty eraseable graph class. + + /// This class provides all the common features of an \e eraseable graph + /// structure, + /// however completely without implementations and real data structures + /// behind the interface. + /// All graph algorithms should compile with this class, but it will not + /// run properly, of course. + /// + /// \todo This blabla could be replaced by a sepatate description about + /// Skeletons. + /// + /// It can be used for checking the interface compatibility, + /// or it can serve as a skeleton of a new graph structure. + /// + /// Also, you will find here the full documentation of a certain graph + /// feature, the documentation of a real graph imlementation + /// like @ref ListGraph or + /// @ref SmartGraph will just refer to this structure. + class EraseableGraphSkeleton : public GraphSkeleton + { + public: + /// Deletes a node. + void erase(Node n) {} + /// Deletes an edge. + void erase(Edge e) {} + + /// Defalult constructor. + GraphSkeleton() {} + ///Copy consructor. + GraphSkeleton(const GraphSkeleton &G) {} + }; + + // @} } //namespace hugo