1 #ifndef EDGE_MAP_REGISTRY_H
2 #define EDGE_MAP_REGISTRY_H
6 template <typename G, typename K>
9 #include "edge_map_base.h"
11 template <typename G, typename K>
12 class EdgeMapRegistry {
17 typedef EdgeMapBase<Graph, Edge> MapBase;
24 typedef std::vector<MapBase*> Container;
30 EdgeMapRegistry(Graph g) : graph(&g) {}
32 void add(MapBase& map_base) {
34 map_base.graph->edge_maps.erase(map_base);
36 container.push_back(&map_base);
37 map_base.graph = graph;
38 map_base.graph_index = container.size()-1;
41 void erase(MapBase& map_base) {
42 container.back()->graph_index = map_base.graph_index;
43 container[map_base.graph_index] = container.back();
49 void add(Edge& edge) {
50 typename Container::iterator it;
51 for (it = container.begin(); it != container.end(); ++it) {
56 void erase(Edge& edge) {
57 typename Container::iterator it;
58 for (it = container.begin(); it != container.end(); ++it) {