src/work/deba/edge_map_base.h
changeset 271 951cd01495e7
child 336 8ff3b3e05478
equal deleted inserted replaced
-1:000000000000 0:49149eac2fe5
       
     1 #ifndef EDGE_MAP_BASE_H
       
     2 #define EDGE_MAP_BASE_H
       
     3 
       
     4 template <class G, class K>
       
     5 class EdgeMapBase {
       
     6 public:
       
     7 	typedef G Graph;
       
     8 	typedef K KeyType;
       
     9 	
       
    10 
       
    11 	MapBase() : graph(0) {}
       
    12 	MapBase(Graph& g) : graph(&g) {graph.edge_maps.add(*this);}
       
    13 
       
    14 	virtual ~MapBase() {graph.edge_maps.erase(*this);}	
       
    15 
       
    16 protected:
       
    17 	
       
    18 	Graph* graph;
       
    19 
       
    20 	int graph_index;
       
    21 	
       
    22 	
       
    23 	virtual void add(const KeyType&) = 0;
       
    24 	virtual void erase(const KeyType&) = 0;
       
    25 
       
    26 	friend class Graph;
       
    27 };
       
    28 
       
    29 #endif