Change 'Key' to 'KeyType' (possibly temporarily).
1.1 --- a/src/hugo/array_map_factory.h Thu Sep 02 15:13:21 2004 +0000
1.2 +++ b/src/hugo/array_map_factory.h Thu Sep 02 15:21:13 2004 +0000
1.3 @@ -22,7 +22,7 @@
1.4 public:
1.5
1.6 typedef typename MapRegistry::Graph Graph;
1.7 - typedef typename MapRegistry::Key Key;
1.8 + typedef typename MapRegistry::KeyType KeyType;
1.9 typedef typename MapRegistry::KeyIt KeyIt;
1.10
1.11 typedef typename MapRegistry::MapBase MapBase;
1.12 @@ -113,27 +113,27 @@
1.13 }
1.14
1.15
1.16 - Value& operator[](const Key& key) {
1.17 + Value& operator[](const KeyType& key) {
1.18 int id = MapBase::getGraph()->id(key);
1.19 return values[id];
1.20 }
1.21
1.22 - const Value& operator[](const Key& key) const {
1.23 + const Value& operator[](const KeyType& key) const {
1.24 int id = MapBase::getGraph()->id(key);
1.25 return values[id];
1.26 }
1.27
1.28 - const Value& get(const Key& key) const {
1.29 + const Value& get(const KeyType& key) const {
1.30 int id = MapBase::getGraph()->id(key);
1.31 return values[id];
1.32 }
1.33
1.34 - void set(const Key& key, const Value& val) {
1.35 + void set(const KeyType& key, const Value& val) {
1.36 int id = MapBase::getGraph()->id(key);
1.37 values[id] = val;
1.38 }
1.39
1.40 - void add(const Key& key) {
1.41 + void add(const KeyType& key) {
1.42 int id = MapBase::getGraph()->id(key);
1.43 if (id >= capacity) {
1.44 int new_capacity = (capacity == 0 ? 1 : capacity);
1.45 @@ -155,7 +155,7 @@
1.46 allocator.construct(&(values[id]), Value());
1.47 }
1.48
1.49 - void erase(const Key& key) {
1.50 + void erase(const KeyType& key) {
1.51 int id = MapBase::getGraph()->id(key);
1.52 allocator.destroy(&(values[id]));
1.53 }
1.54 @@ -184,7 +184,7 @@
1.55 */
1.56 iterator() {}
1.57
1.58 - typedef extended_pair<const Key&, const Key&,
1.59 + typedef extended_pair<const KeyType&, const KeyType&,
1.60 Value&, Value&> Reference;
1.61
1.62 /** Dereference operator for map.
1.63 @@ -197,7 +197,7 @@
1.64 friend class iterator;
1.65 private:
1.66 Reference data;
1.67 - Pointer(const Key& key, Value& val) : data(key, val) {}
1.68 + Pointer(const KeyType& key, Value& val) : data(key, val) {}
1.69 public:
1.70 Reference* operator->() {return &data;}
1.71 };
1.72 @@ -274,7 +274,7 @@
1.73 */
1.74 const_iterator(iterator p_it) : map(p_it.map), it(p_it.it) {}
1.75
1.76 - typedef extended_pair<const Key&, const Key&,
1.77 + typedef extended_pair<const KeyType&, const KeyType&,
1.78 const Value&, const Value&> Reference;
1.79
1.80 /** Dereference operator for map.
1.81 @@ -288,7 +288,7 @@
1.82 friend class const_iterator;
1.83 private:
1.84 Reference data;
1.85 - Pointer(const Key& key, const Value& val) : data(key, val) {}
1.86 + Pointer(const KeyType& key, const Value& val) : data(key, val) {}
1.87 public:
1.88 Reference* operator->() {return &data;}
1.89 };
2.1 --- a/src/hugo/map_registry.h Thu Sep 02 15:13:21 2004 +0000
2.2 +++ b/src/hugo/map_registry.h Thu Sep 02 15:21:13 2004 +0000
2.3 @@ -25,7 +25,7 @@
2.4 class MapRegistry {
2.5 public:
2.6 typedef G Graph;
2.7 - typedef K Key;
2.8 + typedef K KeyType;
2.9 typedef KIt KeyIt;
2.10
2.11
2.12 @@ -38,7 +38,7 @@
2.13 class MapBase {
2.14 public:
2.15 typedef G Graph;
2.16 - typedef K Key;
2.17 + typedef K KeyType;
2.18 typedef KIt KeyIt;
2.19
2.20 typedef MapRegistry<G, K, KIt> Registry;
2.21 @@ -135,13 +135,13 @@
2.22 \e Add extends the map with the new node.
2.23 */
2.24
2.25 - virtual void add(const Key&) = 0;
2.26 + virtual void add(const KeyType&) = 0;
2.27 /**
2.28 The erase member function should be overloaded in the subclasses.
2.29 \e Erase removes the node from the map.
2.30 */
2.31
2.32 - virtual void erase(const Key&) = 0;
2.33 + virtual void erase(const KeyType&) = 0;
2.34
2.35 /**
2.36 * The clear member function should be overloaded in the subclasses.
2.37 @@ -240,7 +240,7 @@
2.38 /**
2.39 * Notify all the registered maps about a Key added.
2.40 */
2.41 - void add(Key& key) {
2.42 + void add(KeyType& key) {
2.43 typename Container::iterator it;
2.44 for (it = container.begin(); it != container.end(); ++it) {
2.45 (*it)->add(key);
2.46 @@ -250,7 +250,7 @@
2.47 /**
2.48 * Notify all the registered maps about a Key erased.
2.49 */
2.50 - void erase(Key& key) {
2.51 + void erase(KeyType& key) {
2.52 typename Container::iterator it;
2.53 for (it = container.begin(); it != container.end(); ++it) {
2.54 (*it)->erase(key);
3.1 --- a/src/hugo/sym_map_factory.h Thu Sep 02 15:13:21 2004 +0000
3.2 +++ b/src/hugo/sym_map_factory.h Thu Sep 02 15:21:13 2004 +0000
3.3 @@ -35,7 +35,7 @@
3.4 public:
3.5
3.6 typedef typename MapRegistry::Graph Graph;
3.7 - typedef typename MapRegistry::Key Key;
3.8 + typedef typename MapRegistry::KeyType KeyType;
3.9 typedef typename MapRegistry::KeyIt KeyIt;
3.10
3.11 typedef typename MapRegistry::MapBase MapBase;
3.12 @@ -68,33 +68,33 @@
3.13 return *this;
3.14 }
3.15
3.16 - Value& operator[](const Key& key) {
3.17 + Value& operator[](const KeyType& key) {
3.18 int id = MapBase::getGraph()->id(key);
3.19 return MapImpl::operator[](id >> 1);
3.20 }
3.21
3.22 - const Value& operator[](const Key& key) const {
3.23 + const Value& operator[](const KeyType& key) const {
3.24 int id = MapBase::getGraph()->id(key);
3.25 return MapImpl::operator[](id >> 1);
3.26 }
3.27
3.28 - const Value& get(const Key& key) const {
3.29 + const Value& get(const KeyType& key) const {
3.30 int id = MapBase::getGraph()->id(key);
3.31 return MapImpl::operator[](id >> 1);
3.32 }
3.33
3.34 - void set(const Key& key, const Value& val) {
3.35 + void set(const KeyType& key, const Value& val) {
3.36 int id = MapBase::getGraph()->id(key);
3.37 MapImpl::operator[](id >> 1) = val;
3.38 }
3.39
3.40 - void add(const Key& key) {
3.41 + void add(const KeyType& key) {
3.42 int id = MapBase::getGraph()->id(key);
3.43 if (id & 1) return;
3.44 MapImpl::add(key);
3.45 }
3.46
3.47 - void erase(const Key& key) {
3.48 + void erase(const KeyType& key) {
3.49 int id = MapBase::getGraph()->id(key);
3.50 if (id & 1) return;
3.51 MapImpl::add(key);
4.1 --- a/src/hugo/vector_map_factory.h Thu Sep 02 15:13:21 2004 +0000
4.2 +++ b/src/hugo/vector_map_factory.h Thu Sep 02 15:21:13 2004 +0000
4.3 @@ -30,7 +30,7 @@
4.4 /// The graph type of the maps.
4.5 typedef typename MapRegistry::Graph Graph;
4.6 /// The key type of the maps.
4.7 - typedef typename MapRegistry::Key Key;
4.8 + typedef typename MapRegistry::KeyType KeyType;
4.9 /// The iterator to iterate on the keys.
4.10 typedef typename MapRegistry::KeyIt KeyIt;
4.11
4.12 @@ -112,7 +112,7 @@
4.13 * The subscript operator. The map can be subscripted by the
4.14 * actual keys of the graph.
4.15 */
4.16 - typename Container::reference operator[](const Key& key) {
4.17 + typename Container::reference operator[](const KeyType& key) {
4.18 int id = getGraph()->id(key);
4.19 return container[id];
4.20 }
4.21 @@ -121,7 +121,7 @@
4.22 * The const subscript operator. The map can be subscripted by the
4.23 * actual keys of the graph.
4.24 */
4.25 - typename Container::const_reference operator[](const Key& key) const {
4.26 + typename Container::const_reference operator[](const KeyType& key) const {
4.27 int id = getGraph()->id(key);
4.28 return container[id];
4.29 }
4.30 @@ -129,14 +129,14 @@
4.31 /** Setter function of the map. Equivalent with map[key] = val.
4.32 * This is a compatibility feature with the not dereferable maps.
4.33 */
4.34 - void set(const Key& key, const Value& val) {
4.35 + void set(const KeyType& key, const Value& val) {
4.36 int id = getGraph()->id(key);
4.37 container[id] = val;
4.38 }
4.39
4.40 /** Add a new key to the map. It called by the map registry.
4.41 */
4.42 - void add(const Key& key) {
4.43 + void add(const KeyType& key) {
4.44 int id = getGraph()->id(key);
4.45 if (id >= container.size()) {
4.46 container.resize(id + 1);
4.47 @@ -145,7 +145,7 @@
4.48
4.49 /** Erase a key from the map. It called by the map registry.
4.50 */
4.51 - void erase(const Key& key) {}
4.52 + void erase(const KeyType& key) {}
4.53
4.54 /** Clear the data structure.
4.55 */
4.56 @@ -172,7 +172,7 @@
4.57 */
4.58 iterator() {}
4.59
4.60 - typedef extended_pair<const Key&, const Key&,
4.61 + typedef extended_pair<const KeyType&, const KeyType&,
4.62 Value&, Value&> Reference;
4.63
4.64 /** Dereference operator for map.
4.65 @@ -185,7 +185,7 @@
4.66 friend class iterator;
4.67 private:
4.68 Reference data;
4.69 - Pointer(const Key& key, Value& val) : data(key, val) {}
4.70 + Pointer(const KeyType& key, Value& val) : data(key, val) {}
4.71 public:
4.72 Reference* operator->() {return &data;}
4.73 };
4.74 @@ -262,7 +262,7 @@
4.75 */
4.76 const_iterator(iterator p_it) : map(p_it.map), it(p_it.it) {}
4.77
4.78 - typedef extended_pair<const Key&, const Key&,
4.79 + typedef extended_pair<const KeyType&, const KeyType&,
4.80 const Value&, const Value&> Reference;
4.81
4.82 /** Dereference operator for map.
4.83 @@ -276,7 +276,7 @@
4.84 friend class const_iterator;
4.85 private:
4.86 Reference data;
4.87 - Pointer(const Key& key, const Value& val) : data(key, val) {}
4.88 + Pointer(const KeyType& key, const Value& val) : data(key, val) {}
4.89 public:
4.90 Reference* operator->() {return &data;}
4.91 };