1.1 --- a/src/work/deba/vector_map.h Fri May 07 08:02:17 2004 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,58 +0,0 @@
1.4 -#ifndef VECTOR_MAP_H
1.5 -#define VECTOR_MAP_H
1.6 -
1.7 -#include <vector>
1.8 -#include <iostream>
1.9 -
1.10 -#include "map_base.h"
1.11 -
1.12 -namespace hugo {
1.13 -
1.14 - template <typename G, typename K, typename KIt, typename V>
1.15 - class VectorMap : public MapBase<G, K, KIt> {
1.16 - public:
1.17 - typedef V ValueType;
1.18 -
1.19 - VectorMap() {}
1.20 - VectorMap(typename MapBase<G, K, KIt>::Registry& r) : MapBase<G, K, KIt>(r) {}
1.21 -
1.22 -
1.23 - ValueType& operator[](const K& key) {
1.24 - int id = registry->getGraph().id(key);
1.25 - return container[id];
1.26 - }
1.27 -
1.28 - const ValueType& operator[](const K& key) const {
1.29 - int id = registry->getGraph().id(key);
1.30 - return container[id];
1.31 - }
1.32 -
1.33 - const ValueType& get(const K& key) const {
1.34 - int id = registry->getGraph().id(key);
1.35 - return container[id];
1.36 - }
1.37 -
1.38 - void set(const K& key, const ValueType& val) {
1.39 - int id = registry->getGraph().id(key);
1.40 - container[id] = val;
1.41 - }
1.42 -
1.43 - void add(const K& key) {
1.44 - int id = registry->getGraph().id(key);
1.45 - std::cerr << id << std::endl;
1.46 - if (id >= container.size()) {
1.47 - container.resize(id + 1);
1.48 - }
1.49 - }
1.50 -
1.51 - void erase(const K& key) {}
1.52 -
1.53 - private:
1.54 - typedef std::vector<ValueType> Container;
1.55 -
1.56 - Container container;
1.57 - };
1.58 -
1.59 -}
1.60 -
1.61 -#endif