author | marci |
Wed, 31 Mar 2004 16:38:38 +0000 | |
changeset 270 | e4811faaaa75 |
permissions | -rw-r--r-- |
1 #ifndef MAPBASE_H
2 #define MAPBASE_H
4 template <class GB, class K>
5 class MapBase {
6 public:
7 typedef GB GraphBase;
8 typedef MappedGraph<GraphBase> Graph;
10 typedef K KeyType;
13 MapBase() : graph(0) {}
14 MapBase(Graph& g) : graph(&g) {graph.add(*this);}
16 virtual ~MapBase() {graph.erase(*this);}
18 protected:
20 Graph* graph;
22 int graph_index;
25 virtual void add(const KeyType&) = 0;
26 virtual void erase(const KeyType&) = 0;
28 friend class Graph;
29 };
31 #endif