1.1 --- a/src/lemon/concept/graph.h Thu Nov 04 21:28:55 2004 +0000
1.2 +++ b/src/lemon/concept/graph.h Thu Nov 04 22:04:51 2004 +0000
1.3 @@ -765,26 +765,6 @@
1.4 /************* New GraphBase stuff **************/
1.5
1.6
1.7 - /// \bug The nodes and edges are not allowed to inherit from the
1.8 - /// same baseclass.
1.9 -
1.10 - class BaseGraphItem {
1.11 - public:
1.12 - BaseGraphItem() {}
1.13 - BaseGraphItem(Invalid) {}
1.14 -
1.15 - // We explicitely list these:
1.16 - BaseGraphItem(BaseGraphItem const&) {}
1.17 - BaseGraphItem& operator=(BaseGraphItem const&) { return *this; }
1.18 -
1.19 - bool operator==(BaseGraphItem) const { return false; }
1.20 - bool operator!=(BaseGraphItem) const { return false; }
1.21 -
1.22 - // Technical requirement. Do we really need this?
1.23 - bool operator<(BaseGraphItem) const { return false; }
1.24 - };
1.25 -
1.26 -
1.27 /// A minimal GraphBase concept
1.28
1.29 /// This class describes a minimal concept which can be extended to a
1.30 @@ -794,11 +774,14 @@
1.31
1.32 GraphBase() {}
1.33
1.34 + /// \bug Should we demand that Node and Edge be subclasses of the
1.35 + /// Graph class???
1.36
1.37 - /// \bug Nodes and Edges are comparable each other
1.38 -
1.39 - class Node : public BaseGraphItem {};
1.40 - class Edge : public BaseGraphItem {};
1.41 + typedef GraphItem<'n'> Node;
1.42 + typedef GraphItem<'e'> Edge;
1.43 +
1.44 +// class Node : public BaseGraphItem<'n'> {};
1.45 +// class Edge : public BaseGraphItem<'e'> {};
1.46
1.47 // Graph operation
1.48 void firstNode(Node &n) const { }
1.49 @@ -840,27 +823,13 @@
1.50
1.51
1.52
1.53 - /**************** Concept checking classes ****************/
1.54
1.55 - template<typename BGI>
1.56 - struct BaseGraphItemConcept {
1.57 - void constraints() {
1.58 - BGI i1;
1.59 - BGI i2 = i1;
1.60 - BGI i3 = INVALID;
1.61 -
1.62 - i1 = i3;
1.63 - if( i1 == i3 ) {
1.64 - if ( i2 != i3 && i3 < i2 )
1.65 - return;
1.66 - }
1.67 - }
1.68 - };
1.69 + /**************** The full-featured graph concepts ****************/
1.70
1.71
1.72 -
1.73 class StaticGraph
1.74 - : virtual public BaseGraphComponent, public IterableGraphComponent, public MappableGraphComponent {
1.75 + : virtual public BaseGraphComponent,
1.76 + public IterableGraphComponent, public MappableGraphComponent {
1.77 public:
1.78 typedef BaseGraphComponent::Node Node;
1.79 typedef BaseGraphComponent::Edge Edge;
1.80 @@ -869,15 +838,14 @@
1.81 template <typename Graph>
1.82 struct StaticGraphConcept {
1.83 void constraints() {
1.84 - function_requires<BaseGraphComponentConcept<Graph> >();
1.85 function_requires<IterableGraphComponentConcept<Graph> >();
1.86 function_requires<MappableGraphComponentConcept<Graph> >();
1.87 }
1.88 - Graph& graph;
1.89 };
1.90
1.91 class ExtendableGraph
1.92 - : virtual public BaseGraphComponent, public StaticGraph, public ExtendableGraphComponent, public ClearableGraphComponent {
1.93 + : virtual public BaseGraphComponent, public StaticGraph,
1.94 + public ExtendableGraphComponent, public ClearableGraphComponent {
1.95 public:
1.96 typedef BaseGraphComponent::Node Node;
1.97 typedef BaseGraphComponent::Edge Edge;
1.98 @@ -890,11 +858,11 @@
1.99 function_requires<ExtendableGraphComponentConcept<Graph> >();
1.100 function_requires<ClearableGraphComponentConcept<Graph> >();
1.101 }
1.102 - Graph& graph;
1.103 };
1.104
1.105 class ErasableGraph
1.106 - : virtual public BaseGraphComponent, public ExtendableGraph, public ErasableGraphComponent {
1.107 + : virtual public BaseGraphComponent, public ExtendableGraph,
1.108 + public ErasableGraphComponent {
1.109 public:
1.110 typedef BaseGraphComponent::Node Node;
1.111 typedef BaseGraphComponent::Edge Edge;
1.112 @@ -906,7 +874,6 @@
1.113 function_requires<ExtendableGraphConcept<Graph> >();
1.114 function_requires<ErasableGraphComponentConcept<Graph> >();
1.115 }
1.116 - Graph& graph;
1.117 };
1.118
1.119 // @}