src/hugo/array_map_factory.h
changeset 786 d7b3b13b9df6
parent 785 a9b0863c2265
child 799 3393abe30678
     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  	};