+#if !wxUSE_OLD_HASH_TABLE
+
+class WXDLLIMPEXP_BASE wxHashTable_Node : public wxHashTableBase_Node
+{
+ friend class WXDLLIMPEXP_BASE wxHashTable;
+public:
+ wxHashTable_Node( long key, void* value,
+ wxHashTableBase* table )
+ : wxHashTableBase_Node( key, value, table ) { }
+ wxHashTable_Node( const wxChar* key, void* value,
+ wxHashTableBase* table )
+ : wxHashTableBase_Node( key, value, table ) { }
+
+ wxObject* GetData() const
+ { return (wxObject*)wxHashTableBase_Node::GetData(); }
+ void SetData( wxObject* data )
+ { wxHashTableBase_Node::SetData( data ); }
+
+ wxHashTable_Node* GetNext() const
+ { return (wxHashTable_Node*)wxHashTableBase_Node::GetNext(); }
+};
+
+// should inherit protectedly, but it is public for compatibility in
+// order to publicly inherit from wxObject
+class WXDLLIMPEXP_BASE wxHashTable : public wxHashTableBase
+{
+ typedef wxHashTableBase hash;
+public:
+ typedef wxHashTable_Node Node;
+ typedef wxHashTable_Node* compatibility_iterator;
+public:
+ wxHashTable( wxKeyType keyType = wxKEY_INTEGER,
+ size_t size = wxHASH_SIZE_DEFAULT )
+ : wxHashTableBase() { Create( keyType, size ); BeginFind(); }
+ wxHashTable( const wxHashTable& table );
+
+ virtual ~wxHashTable() { Destroy(); }
+
+ const wxHashTable& operator=( const wxHashTable& );
+
+ // key and value are the same
+ void Put(long value, wxObject *object)
+ { DoPut( value, value, object ); }
+ void Put(long lhash, long value, wxObject *object)
+ { DoPut( value, lhash, object ); }
+ void Put(const wxChar *value, wxObject *object)
+ { DoPut( value, MakeKey( value ), object ); }
+ void Put(long lhash, const wxChar *value, wxObject *object)
+ { DoPut( value, lhash, object ); }
+
+ // key and value are the same
+ wxObject *Get(long value) const
+ { return (wxObject*)DoGet( value, value ); }
+ wxObject *Get(long lhash, long value) const
+ { return (wxObject*)DoGet( value, lhash ); }
+ wxObject *Get(const wxChar *value) const
+ { return (wxObject*)DoGet( value, MakeKey( value ) ); }
+ wxObject *Get(long lhash, const wxChar *value) const
+ { return (wxObject*)DoGet( value, lhash ); }
+
+ // Deletes entry and returns data if found
+ wxObject *Delete(long key)
+ { return (wxObject*)DoDelete( key, key ); }
+ wxObject *Delete(long lhash, long key)
+ { return (wxObject*)DoDelete( key, lhash ); }
+ wxObject *Delete(const wxChar *key)
+ { return (wxObject*)DoDelete( key, MakeKey( key ) ); }
+ wxObject *Delete(long lhash, const wxChar *key)
+ { return (wxObject*)DoDelete( key, lhash ); }
+
+ // Construct your own integer key from a string, e.g. in case
+ // you need to combine it with something
+ long MakeKey(const wxChar *string) const
+ { return wxHashTableBase::MakeKey(string); }
+
+ // Way of iterating through whole hash table (e.g. to delete everything)
+ // Not necessary, of course, if you're only storing pointers to
+ // objects maintained separately
+ void BeginFind() { m_curr = NULL; m_currBucket = 0; }
+ Node* Next();
+
+ void Clear() { wxHashTableBase::Clear(); }
+
+ size_t GetCount() const { return wxHashTableBase::GetCount(); }
+protected:
+ // copy helper
+ void DoCopy( const wxHashTable& copy );
+
+ // searches the next node starting from bucket bucketStart and sets
+ // m_curr to it and m_currBucket to its bucket
+ void GetNextNode( size_t bucketStart );
+private:
+ virtual void DoDeleteContents( wxHashTableBase_Node* node );
+
+ // current node
+ Node* m_curr;
+
+ // bucket the current node belongs to
+ size_t m_currBucket;
+};
+
+#else // if wxUSE_OLD_HASH_TABLE
+
+class WXDLLIMPEXP_BASE wxHashTable : public wxObject