diff -r 53e7969a92eb -r c8a41699e613 src/lemon/concept/graph_component.h --- a/src/lemon/concept/graph_component.h Fri Dec 03 12:19:26 2004 +0000 +++ b/src/lemon/concept/graph_component.h Mon Dec 06 00:30:44 2004 +0000 @@ -14,7 +14,7 @@ * */ -///\ingroup concept +///\ingroup graph_concepts ///\file ///\brief The graph components. @@ -28,22 +28,32 @@ namespace lemon { namespace concept { + /// \addtogroup graph_concepts + /// @{ /**************** Graph iterator concepts ****************/ - /// Skeleton class for graph Node and Edge + /// Skeleton class for graph Node and Edge types - /// \note Because Node and Edge are forbidden to inherit from the same - /// base class, this is a template. For Node you should instantiate it - /// with character 'n' and for Edge with 'e'. + /// This class describes the interface of Node and Edge (and UndirEdge + /// in undirected graphs) subtypes of graph types. + /// + /// \note This class is a template class so that we can use it to + /// create graph skeleton classes. The reason for this is than Node + /// and Edge types should \em not derive from the same base class. + /// For Node you should instantiate it with character 'n' and for Edge + /// with 'e'. - template +#ifndef DOXYGEN + template +#endif class GraphItem { public: /// Default constructor. - /// @warning The default constructor sets the item - /// to an undefined value. + /// \warning The default constructor is not required to set + /// the item to some well-defined value. So you should consider it + /// as uninitialized. GraphItem() {} /// Copy constructor. @@ -71,9 +81,17 @@ /// bool operator!=(GraphItem) const { return false; } - // Technical requirement. Do we really need this? - // bool operator<(GraphItem) const { return false; } + /// Artificial ordering operator. + /// To allow the use of graph descriptors as key type in std::map or + /// similar associative container we require this. + /// + /// \note This operator only have to define some strict ordering of + /// the items; this order has nothing to do with the iteration + /// ordering of the items. + /// + /// \bug This is a technical requirement. Do we really need this? + bool operator<(GraphItem) const { return false; } template struct Constraints { @@ -88,6 +106,7 @@ // b = (ia == ib) && (ia != ib) && (ia < ib); b = (ia == ib) && (ia != ib); b = (ia == INVALID) && (ib != INVALID); + b = (ia < ib); } const _GraphItem &ia; @@ -95,6 +114,21 @@ }; }; + /// A type describing the concept of graph node + + /// This is an instantiation of \ref GraphItem which can be used as a + /// Node subtype in graph skeleton definitions + typedef GraphItem<'n'> GraphNode; + + /// A type describing the concept of graph edge + + /// This is an instantiation of \ref GraphItem which can be used as a + /// Edge subtype in graph skeleton definitions + typedef GraphItem<'e'> GraphEdge; + + + /**************** Basic features of graphs ****************/ + /// An empty base graph class. /// This class provides the minimal set of features needed for a graph @@ -629,6 +663,11 @@ }; + /// Class describing the concept of graph maps + + /// This class describes the common interface of the graph maps + /// (NodeMap, EdgeMap), that is \ref maps "maps" which can be used to + /// associate data to graph descriptors (nodes or edges). template class GraphMap : public ReadWriteMap { protected: @@ -804,6 +843,8 @@ }; }; + /// @} + } }