diff -r b5fb023cdb7b -r 0f1044b7a3af src/lemon/concept/graph_component.h --- a/src/lemon/concept/graph_component.h Wed Nov 10 21:59:59 2004 +0000 +++ b/src/lemon/concept/graph_component.h Thu Nov 11 09:31:55 2004 +0000 @@ -161,6 +161,10 @@ Node(Invalid) {} + /// Assign operator for nodes. + + /// The nodes are assignable. + /// Node& operator=(const Node&) { return *this;} /// Equality operator. @@ -210,7 +214,10 @@ /// \sa Invalid for more details. Edge(Invalid) {} + /// Assign operator for edges. + /// The edges are assignable. + /// Edge& operator=(const Edge&) { return *this;} /// Equality operator. @@ -429,13 +436,13 @@ /// Gives back an integer greater or equal to the maximum Node id. /// - int maxEdgeId() const { return -1;} + int maxId(Node = INVALID) const { return -1;} /// Gives back an integer greater or equal to the maximum Edge id. /// Gives back an integer greater or equal to the maximum Edge id. /// - int maxNodeId() const { return -1;} + int maxId(Edge = INVALID) const { return -1;} }; /// Concept check structure for MaxIdableBaseGraph. @@ -447,9 +454,9 @@ void constraints() { function_requires< BaseGraphComponentConcept >(); - int nid = graph.maxEdgeId(); + int nid = graph.maxId(typename Graph::Node()); ignore_unused_variable_warning(nid); - int eid = graph.maxNodeId(); + int eid = graph.maxId(typename Graph::Edge()); ignore_unused_variable_warning(eid); } @@ -662,52 +669,6 @@ }; - class IdMappableGraphComponent : virtual public BaseGraphComponent { - - typedef IdMappableGraphComponent Graph; - - public: - - typedef BaseGraphComponent::Node Node; - typedef BaseGraphComponent::Edge Edge; - - class NodeIdMap : public ReadMap { - public: - NodeIdMap(const Graph&) {} - int maxId() const { return -1;} - }; - - class EdgeIdMap : public ReadMap { - public: - EdgeIdMap(const Graph&) {} - int maxId() const { return -1;} - }; - - }; - - template - struct IdMappableGraphComponentConcept { - void constraints() { - function_requires< BaseGraphComponentConcept >(); - { - typedef typename Graph::EdgeIdMap EdgeIdMap; - function_requires >(); - EdgeIdMap edge_map(graph); - int n = edge_map.maxId(); - ignore_unused_variable_warning(n); - } - { - typedef typename Graph::NodeIdMap NodeIdMap; - function_requires >(); - NodeIdMap node_map(graph); - int n = node_map.maxId(); - ignore_unused_variable_warning(n); - } - } - Graph& graph; - }; - - class MappableGraphComponent : virtual public BaseGraphComponent { public: