diff -r 908a1a6f0752 -r 289d80c33f04 src/lemon/concept/graph.h --- a/src/lemon/concept/graph.h Thu Nov 04 21:28:55 2004 +0000 +++ b/src/lemon/concept/graph.h Thu Nov 04 22:04:51 2004 +0000 @@ -765,26 +765,6 @@ /************* New GraphBase stuff **************/ - /// \bug The nodes and edges are not allowed to inherit from the - /// same baseclass. - - class BaseGraphItem { - public: - BaseGraphItem() {} - BaseGraphItem(Invalid) {} - - // We explicitely list these: - BaseGraphItem(BaseGraphItem const&) {} - BaseGraphItem& operator=(BaseGraphItem const&) { return *this; } - - bool operator==(BaseGraphItem) const { return false; } - bool operator!=(BaseGraphItem) const { return false; } - - // Technical requirement. Do we really need this? - bool operator<(BaseGraphItem) const { return false; } - }; - - /// A minimal GraphBase concept /// This class describes a minimal concept which can be extended to a @@ -794,11 +774,14 @@ GraphBase() {} + /// \bug Should we demand that Node and Edge be subclasses of the + /// Graph class??? - /// \bug Nodes and Edges are comparable each other - - class Node : public BaseGraphItem {}; - class Edge : public BaseGraphItem {}; + typedef GraphItem<'n'> Node; + typedef GraphItem<'e'> Edge; + +// class Node : public BaseGraphItem<'n'> {}; +// class Edge : public BaseGraphItem<'e'> {}; // Graph operation void firstNode(Node &n) const { } @@ -840,27 +823,13 @@ - /**************** Concept checking classes ****************/ - template - struct BaseGraphItemConcept { - void constraints() { - BGI i1; - BGI i2 = i1; - BGI i3 = INVALID; - - i1 = i3; - if( i1 == i3 ) { - if ( i2 != i3 && i3 < i2 ) - return; - } - } - }; + /**************** The full-featured graph concepts ****************/ - class StaticGraph - : virtual public BaseGraphComponent, public IterableGraphComponent, public MappableGraphComponent { + : virtual public BaseGraphComponent, + public IterableGraphComponent, public MappableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; @@ -869,15 +838,14 @@ template struct StaticGraphConcept { void constraints() { - function_requires >(); function_requires >(); function_requires >(); } - Graph& graph; }; class ExtendableGraph - : virtual public BaseGraphComponent, public StaticGraph, public ExtendableGraphComponent, public ClearableGraphComponent { + : virtual public BaseGraphComponent, public StaticGraph, + public ExtendableGraphComponent, public ClearableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; @@ -890,11 +858,11 @@ function_requires >(); function_requires >(); } - Graph& graph; }; class ErasableGraph - : virtual public BaseGraphComponent, public ExtendableGraph, public ErasableGraphComponent { + : virtual public BaseGraphComponent, public ExtendableGraph, + public ErasableGraphComponent { public: typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; @@ -906,7 +874,6 @@ function_requires >(); function_requires >(); } - Graph& graph; }; // @}