The new for macros are: h_for, h_for_inc, h_for_glob, h_for_inc_glob.
6 #include "map_registry.h"
10 template <typename MapRegistry>
11 class VectorMapFactory {
14 typedef typename MapRegistry::Graph Graph;
15 typedef typename MapRegistry::Key Key;
16 typedef typename MapRegistry::KeyIt KeyIt;
18 typedef typename MapRegistry::MapBase MapBase;
21 class Map : public MapBase {
27 Map(Graph& g, MapRegistry& r) : MapBase(g, r) {
37 Value& operator[](const Key& key) {
38 int id = graph->id(key);
42 const Value& operator[](const Key& key) const {
43 int id = graph->id(key);
47 const Value& get(const Key& key) const {
48 int id = graph->id(key);
52 void set(const Key& key, const Value& val) {
53 int id = graph->id(key);
57 void add(const Key& key) {
58 int id = graph->id(key);
59 if (id >= container.size()) {
60 container.resize(id + 1);
64 void erase(const Key& key) {}
67 typedef std::vector<Value> Container;