src/work/deba/edge_map_base.h
author marci
Thu, 15 Apr 2004 20:19:26 +0000
changeset 333 e0a80761dfd9
child 336 8ff3b3e05478
permissions -rw-r--r--
makroizeles
deba@262
     1
#ifndef EDGE_MAP_BASE_H
deba@262
     2
#define EDGE_MAP_BASE_H
deba@262
     3
deba@262
     4
template <class G, class K>
deba@262
     5
class EdgeMapBase {
deba@262
     6
public:
deba@262
     7
	typedef G Graph;
deba@262
     8
	typedef K KeyType;
deba@262
     9
	
deba@262
    10
deba@262
    11
	MapBase() : graph(0) {}
deba@262
    12
	MapBase(Graph& g) : graph(&g) {graph.edge_maps.add(*this);}
deba@262
    13
deba@262
    14
	virtual ~MapBase() {graph.edge_maps.erase(*this);}	
deba@262
    15
deba@262
    16
protected:
deba@262
    17
	
deba@262
    18
	Graph* graph;
deba@262
    19
deba@262
    20
	int graph_index;
deba@262
    21
	
deba@262
    22
	
deba@262
    23
	virtual void add(const KeyType&) = 0;
deba@262
    24
	virtual void erase(const KeyType&) = 0;
deba@262
    25
deba@262
    26
	friend class Graph;
deba@262
    27
};
deba@262
    28
deba@262
    29
#endif