+ 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:
+ virtual void DoDeleteContents( wxHashTableBase_Node* node );
+
+ // 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:
+ // 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
+{
+public:
+ typedef wxNode Node;
+ typedef wxNode* compatibility_iterator;
+