(file) Return to HashTable.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HashTable.h between version 1.26.4.1 and 1.26.4.2

version 1.26.4.1, 2008/04/24 18:41:36 version 1.26.4.2, 2008/04/25 22:23:40
Line 269 
Line 269 
  
     V& getValue() { return _value; }     V& getValue() { return _value; }
  
     void putValue(const V& value) {_value = value;}  
   
 private: private:
  
     K _key;     K _key;
Line 465 
Line 463 
 public: public:
  
     typedef _HashTableIterator<K, V, E> Iterator;     typedef _HashTableIterator<K, V, E> Iterator;
     typedef _Bucket<K, V, E> Bucket;  
  
     /* By default, we create this many chains initially */     /* By default, we create this many chains initially */
     enum { DEFAULT_NUM_CHAINS = 32 };     enum { DEFAULT_NUM_CHAINS = 32 };
Line 528 
Line 525 
     */     */
     Boolean lookup(const K& key, V& value) const;     Boolean lookup(const K& key, V& value) const;
  
       /** Looks up the entry with the given key and returns a pointer to the
           value.  Note that this pointer may become invalid when the HashTable
           is updated.
           @param key key of entry to be located.
           @param value Output pointer to the value.
           @return true if found; false otherwise.
       */
       Boolean lookupReference(const K& key, V*& value);
   
     /** Removes the entry with the given key.     /** Removes the entry with the given key.
         @param key key of entry to be removed.         @param key key of entry to be removed.
         @return true on success; false otherwise.         @return true on success; false otherwise.
Line 544 
Line 550 
             _rep.getChains(), _rep.getChains() + _rep.getNumChains());             _rep.getChains(), _rep.getChains() + _rep.getNumChains());
     }     }
  
     /** Gets the entry pointer with the given key.  
         @param key          key of entry to be located.  
         @param bucket       output - pointer to entry with that key  
         @return true if entry found; false otherwise.  
     */  
     Boolean getBucket(const K& key, _Bucket<K, V, E>*& bucket) const;  
   
 private: private:
  
     _HashTableRep _rep;     _HashTableRep _rep;
Line 572 
Line 571 
 } }
  
 template<class K, class V, class E, class H> template<class K, class V, class E, class H>
 inline Boolean HashTable<K, V, E, H>::getBucket(  inline Boolean HashTable<K, V, E, H>::lookupReference(const K& key, V*& value)
     const K& key, _Bucket<K, V, E>*& bucket) const  
 { {
     bucket = (_Bucket<K, V, E>*)_rep.lookup(H::hash(key), &key);      _Bucket<K, V, E>* bucket =
           (_Bucket<K, V, E>*)_rep.lookup(H::hash(key), &key);
  
     if (bucket)     if (bucket)
     {     {
           value = &bucket->getValue();
         return true;         return true;
     }     }
  
     return false;     return false;
 } }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_HashTable_h */ #endif /* Pegasus_HashTable_h */


Legend:
Removed from v.1.26.4.1  
changed lines
  Added in v.1.26.4.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2