Index: pjproject/main/pjlib/include/pj++/hash.hpp
===================================================================
--- pjproject/main/pjlib/include/pj++/hash.hpp	(revision 29)
+++ pjproject/main/pjlib/include/pj++/hash.hpp	(revision 36)
@@ -1,4 +1,3 @@
 /* $Id$
- *
  */
 #ifndef __PJPP_HASH_H__
@@ -6,18 +5,43 @@
 
 #include <pj++/types.hpp>
+#include <pj++/pool.hpp>
 #include <pj/hash.h>
 
-class PJ_Hash_Table
+//
+// Hash table.
+//
+class Pj_Hash_Table : public Pj_Object
 {
 public:
+    //
+    // Hash table iterator.
+    //
     class iterator
     {
     public:
-	iterator() {}
-	explicit iterator(pj_hash_table_t *h, pj_hash_iterator_t *i) : ht_(h), it_(i) {}
-	iterator(const iterator &rhs) : ht_(rhs.ht_), it_(rhs.it_) {}
-	void operator++() { it_ = pj_hash_next(ht_, it_); }
-	bool operator==(const iterator &rhs) { return ht_ == rhs.ht_ && it_ == rhs.it_; }
-	iterator & operator=(const iterator &rhs) { ht_=rhs.ht_; it_=rhs.it_; return *this; }
+	iterator() 
+        {
+        }
+	explicit iterator(pj_hash_table_t *h, pj_hash_iterator_t *i) 
+        : ht_(h), it_(i) 
+        {
+        }
+	iterator(const iterator &rhs) 
+        : ht_(rhs.ht_), it_(rhs.it_) 
+        {
+        }
+	void operator++() 
+        { 
+            it_ = pj_hash_next(ht_, it_); 
+        }
+	bool operator==(const iterator &rhs) 
+        { 
+            return ht_ == rhs.ht_ && it_ == rhs.it_; 
+        }
+	iterator & operator=(const iterator &rhs) 
+        { 
+            ht_=rhs.ht_; it_=rhs.it_; 
+            return *this; 
+        }
     private:
 	pj_hash_table_t *ht_;
@@ -25,49 +49,91 @@
 	pj_hash_iterator_t *it_;
 
-	friend class PJ_Hash_Table;
+	friend class Pj_Hash_Table;
     };
 
-    static PJ_Hash_Table *create(PJ_Pool *pool, unsigned size)
+    //
+    // Construct hash table.
+    //
+    Pj_Hash_Table(Pj_Pool *pool, unsigned size)
     {
-	return (PJ_Hash_Table*) pj_hash_create(pool->pool_(), size);
+	table_ = pj_hash_create(pool->pool_(), size);
     }
 
-    static pj_uint32_t calc(pj_uint32_t initial_hval, const void *key, unsigned keylen)
+    //
+    // Destroy hash table.
+    //
+    ~Pj_Hash_Table()
+    {
+    }
+
+    //
+    // Calculate hash value.
+    //
+    static pj_uint32_t calc( pj_uint32_t initial_hval, 
+                             const void *key, 
+                             unsigned keylen = PJ_HASH_KEY_STRING)
     {
 	return pj_hash_calc(initial_hval, key, keylen);
     }
 
-    pj_hash_table_t *hash_table_()
+    //
+    // Return pjlib compatible hash table object.
+    //
+    pj_hash_table_t *pj_hash_table_t_()
     {
-	return (pj_hash_table_t*)this;
+	return table_;
     }
 
-    void *get(const void *key, unsigned keylen)
+    //
+    // Get the value associated with the specified key.
+    //
+    void *get(const void *key, unsigned keylen = PJ_HASH_KEY_STRING)
     {
-	return pj_hash_get(this->hash_table_(), key, keylen);
+	return pj_hash_get(table_, key, keylen);
     }
 
-    void set(PJ_Pool *pool, const void *key, unsigned keylen, void *value)
+    //
+    // Associate a value with a key.
+    // Set the value to NULL to delete the key from the hash table.
+    //
+    void set(Pj_Pool *pool, 
+             const void *key, 
+             void *value,
+             unsigned keylen = PJ_HASH_KEY_STRING)
     {
-	pj_hash_set(pool->pool_(), this->hash_table_(), key, keylen, value);
+	pj_hash_set(pool->pool_(), table_, key, keylen, value);
     }
 
+    //
+    // Get number of items in the hash table.
+    //
     unsigned count()
     {
-	return pj_hash_count(this->hash_table_());
+	return pj_hash_count(table_);
     }
 
+    //
+    // Iterate hash table.
+    //
     iterator begin()
     {
-	iterator it(this->hash_table_(), NULL);
-	it.it_ = pj_hash_first(this->hash_table_(), &it.it_val_);
+	iterator it(table_, NULL);
+	it.it_ = pj_hash_first(table_, &it.it_val_);
 	return it;
     }
 
+    //
+    // End of items.
+    //
     iterator end()
     {
-	return iterator(this->hash_table_(), NULL);
+	return iterator(table_, NULL);
     }
+
+private:
+    pj_hash_table_t *table_;
 };
 
+
 #endif	/* __PJPP_HASH_H__ */
+
