src/work/deba/node_map_base.h
author athos
Mon, 05 Apr 2004 14:56:32 +0000
changeset 299 54e8905344ba
child 336 8ff3b3e05478
permissions -rw-r--r--
Renaming Suurballe to minlengthpaths
deba@262
     1
#ifndef NODE_MAP_BASE_H
deba@262
     2
#define NODE_MAP_BASE_H
deba@262
     3
deba@262
     4
template <class G, class K>
deba@262
     5
class NodeMapBase {
deba@262
     6
public:
deba@262
     7
	typedef G Graph;
deba@262
     8
deba@262
     9
	typedef K KeyType;
deba@262
    10
	
deba@262
    11
deba@262
    12
	MapBase() : graph(0) {}
deba@262
    13
	MapBase(Graph& g) : graph(&g) {graph.node_maps.add(*this);}
deba@262
    14
deba@262
    15
	virtual ~MapBase() {graph.node_maps.erase(*this);}	
deba@262
    16
deba@262
    17
protected:
deba@262
    18
	
deba@262
    19
	Graph* graph;
deba@262
    20
deba@262
    21
	int graph_index;
deba@262
    22
	
deba@262
    23
	
deba@262
    24
	virtual void add(const KeyType&) = 0;
deba@262
    25
	virtual void erase(const KeyType&) = 0;
deba@262
    26
deba@262
    27
	friend class Graph;
deba@262
    28
};
deba@262
    29
deba@262
    30
#endif