src/work/deba/test_graph.h
changeset 571 9632ea8be6ca
parent 378 c3f93631cd24
child 595 e10b5e9419ef
     1.1 --- a/src/work/deba/test_graph.h	Fri May 07 08:02:17 2004 +0000
     1.2 +++ b/src/work/deba/test_graph.h	Fri May 07 08:18:30 2004 +0000
     1.3 @@ -7,7 +7,7 @@
     1.4  
     1.5  #include "invalid.h"
     1.6  
     1.7 -#include "vector_map.h"
     1.8 +#include "vector_map_factory.h"
     1.9  
    1.10  namespace hugo {
    1.11  
    1.12 @@ -38,27 +38,19 @@
    1.13   
    1.14    private:
    1.15  
    1.16 + 
    1.17 +	public:
    1.18 +	
    1.19  		typedef MapRegistry<ListGraph, Node, NodeIt> NodeMapRegistry;
    1.20  		NodeMapRegistry node_maps;
    1.21  		
    1.22 +		
    1.23  		typedef MapRegistry<ListGraph, Edge, EdgeIt> EdgeMapRegistry;
    1.24  		EdgeMapRegistry edge_maps;
    1.25 +
    1.26 +		typedef VectorMapFactory<ListGraph, Edge, EdgeIt> EdgeMapFactory;
    1.27 +		typedef VectorMapFactory<ListGraph, Node, NodeIt> NodeMapFactory;
    1.28   
    1.29 -	public:
    1.30 - 
    1.31 -
    1.32 -    template <typename T>
    1.33 -    class NodeMap : public VectorMap<ListGraph, Node, NodeIt, T> {
    1.34 -		public:
    1.35 -			NodeMap(ListGraph& g) : VectorMap<ListGraph, Node, NodeIt, T>(g.node_maps) {}
    1.36 -		};
    1.37 -		
    1.38 -    template <typename T>
    1.39 -    class EdgeMap : public VectorMap<ListGraph, Edge, EdgeIt, T> {
    1.40 -		public:
    1.41 -			EdgeMap(ListGraph& g) : VectorMap<ListGraph, Edge, EdgeIt, T>(g.edge_maps) {}
    1.42 -		};
    1.43 -
    1.44  
    1.45      int node_id;
    1.46      int edge_id;
    1.47 @@ -215,8 +207,7 @@
    1.48  
    1.49      /* default constructor */
    1.50  
    1.51 -    ListGraph() : node_id(0), edge_id(0), _node_num(0), _edge_num(0), _first_node(0), _last_node(0),
    1.52 -			edge_maps(*this), node_maps(*this) { }
    1.53 +    ListGraph() : node_id(0), edge_id(0), _node_num(0), _edge_num(0), _first_node(0), _last_node(0){ }
    1.54      
    1.55      ~ListGraph() { 
    1.56        while (first<NodeIt>().valid()) erase(first<NodeIt>());