author | athos |
Fri, 02 Apr 2004 15:59:17 +0000 | |
changeset 277 | 044f5898b769 |
child 336 | 8ff3b3e05478 |
permissions | -rw-r--r-- |
1 #ifndef NODE_MAP_BASE_H
2 #define NODE_MAP_BASE_H
4 template <class G, class K>
5 class NodeMapBase {
6 public:
7 typedef G Graph;
9 typedef K KeyType;
12 MapBase() : graph(0) {}
13 MapBase(Graph& g) : graph(&g) {graph.node_maps.add(*this);}
15 virtual ~MapBase() {graph.node_maps.erase(*this);}
17 protected:
19 Graph* graph;
21 int graph_index;
24 virtual void add(const KeyType&) = 0;
25 virtual void erase(const KeyType&) = 0;
27 friend class Graph;
28 };
30 #endif