Rev | Line | |
---|
[262] | 1 | #ifndef NODE_MAP_BASE_H |
---|
| 2 | #define NODE_MAP_BASE_H |
---|
| 3 | |
---|
| 4 | template <class G, class K> |
---|
| 5 | class NodeMapBase { |
---|
| 6 | public: |
---|
| 7 | typedef G Graph; |
---|
| 8 | |
---|
| 9 | typedef K KeyType; |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | MapBase() : graph(0) {} |
---|
| 13 | MapBase(Graph& g) : graph(&g) {graph.node_maps.add(*this);} |
---|
| 14 | |
---|
| 15 | virtual ~MapBase() {graph.node_maps.erase(*this);} |
---|
| 16 | |
---|
| 17 | protected: |
---|
| 18 | |
---|
| 19 | Graph* graph; |
---|
| 20 | |
---|
| 21 | int graph_index; |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | virtual void add(const KeyType&) = 0; |
---|
| 25 | virtual void erase(const KeyType&) = 0; |
---|
| 26 | |
---|
| 27 | friend class Graph; |
---|
| 28 | }; |
---|
| 29 | |
---|
| 30 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.