template first goes to comment...
1 #ifndef NODE_MAP_REGISTRY_H
2 #define NODE_MAP_REGISTRY_H
6 #include "node_map_base.h"
8 template <typename G, typename E>
9 class NodeMapRegistry {
14 typedef NodeMapBase<Graph, Node> NodeMapBase;
17 typedef std::vector<NodeMapBase*> Container;
21 void add(NodeMapBase& map_base) {
23 map_base.graph->node_maps.erase(map_base);
25 container.push_back(&map_base);
26 map_base.graph = this;
27 map_base.graph_index = container.size()-1;
30 void erase(NodeMapBase& map_base) {
31 if (map_base.graph != this) return;
32 container.back()->graph_index = map_base.graph_index;
33 container[map_base.graph_index] = container.back();
38 void add(Node& node) {
39 typename Container::iterator it;
40 for (it = container.begin(); it != container.end(); ++it) {
45 void erase(Node& node) {
46 typename Container::iterator it;
47 for (it = container.begin(); it != container.end(); ++it) {
52 friend class NodeMapBase;