src/work/deba/test_graph.h
changeset 377 33fe0ee01dc5
parent 340 a2ce3c4780b7
child 378 c3f93631cd24
     1.1 --- a/src/work/deba/test_graph.h	Thu Apr 22 16:07:17 2004 +0000
     1.2 +++ b/src/work/deba/test_graph.h	Thu Apr 22 16:36:57 2004 +0000
     1.3 @@ -5,13 +5,13 @@
     1.4  #include <iostream>
     1.5  #include <vector>
     1.6  
     1.7 -#include <invalid.h>
     1.8 +#include "invalid.h"
     1.9  
    1.10 -#include "vector_map.h"
    1.11  #include "edge_map_registry.h"
    1.12  #include "node_map_registry.h"
    1.13  #include "edge_map_base.h"
    1.14  #include "node_map_base.h"
    1.15 +#include "vector_map.h"
    1.16  
    1.17  namespace hugo {
    1.18  
    1.19 @@ -40,15 +40,24 @@
    1.20  //    template <typename T> friend class NodeMap;
    1.21   //   template <typename T> friend class EdgeMap;
    1.22   
    1.23 -		NodeMapRegistry<ListGraph, Node> node_maps;
    1.24 +  private:
    1.25 +
    1.26 +		NodeMapRegistry<ListGraph, Node> node_maps(*this);
    1.27 +		EdgeMapRegistry<ListGraph, Edge> edge_maps(*this);
    1.28 + 
    1.29 +	public:
    1.30 + 
    1.31  
    1.32      template <typename T>
    1.33 -    class NodeMap : public VectorMap<ListGraph, Edge, T, EdgeMapBase> {};
    1.34 +    class NodeMap : public VectorMap<ListGraph, Node, T, NodeMapBase> {
    1.35 +		public:
    1.36 +			NodeMap(ListGraph& g) : VectorMap<ListGraph, Node, T, NodeMapBase>(g) {}
    1.37 +		};
    1.38  		
    1.39  		EdgeMapRegistry<ListGraph, Edge> edge_maps;
    1.40  
    1.41      template <typename T>
    1.42 -    class EdgeMap : public VectorMap<Graph, Node, T, NodeMapBase> {};
    1.43 +    class EdgeMap : public VectorMap<ListGraph, Edge, T, EdgeMapBase> {};
    1.44  
    1.45  
    1.46      int node_id;
    1.47 @@ -310,7 +319,7 @@
    1.48      }
    1.49  
    1.50      void erase(Node i) { 
    1.51 -			node_map.erase(i);
    1.52 +			node_maps.erase(i);
    1.53        while (first<OutEdgeIt>(i).valid()) erase(first<OutEdgeIt>(i));
    1.54        while (first<InEdgeIt>(i).valid()) erase(first<InEdgeIt>(i));
    1.55        _delete_node(i.node);