1 #ifndef NODE_MAP_REGISTRY_H
2 #define NODE_MAP_REGISTRY_H
6 template <typename G, typename E>
7 class NodeMapRegistry {
12 typedef NodeMapBase<Graph, Node> NodeMapBase;
15 typedef std::vector<NodeMapBase*> Container;
19 void add(NodeMapBase& map_base) {
21 map_base.graph->node_maps.erase(map_base);
23 container.push_back(&map_base);
24 map_base.graph = this;
25 map_base.graph_index = container.size()-1;
28 void erase(NodeMapBase& map_base) {
29 if (map_base.graph != this) return;
30 container.back()->graph_index = map_base.graph_index;
31 container[map_base.graph_index] = container.back();
36 void addNode(Node& node) {
37 typename Container::iterator it;
38 for (it = container.begin(); it != container.end(); ++it) {
43 void eraseNode(Node& node) {
44 typename Container::iterator it;
45 for (it = container.begin(); it != container.end(); ++it) {
50 friend class NodeMapBase;