+ // not implemented yet
+ DECLARE_NO_COPY_CLASS(wxHashTableLong)
+};
+
+// ----------------------------------------------------------------------------
+// wxStringHashTable: a hash table which indexes strings with longs
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxStringHashTable : public wxObject
+{
+public:
+ wxStringHashTable(size_t sizeTable = wxHASH_SIZE_DEFAULT);
+ virtual ~wxStringHashTable();
+
+ // add a string associated with this key to the table
+ void Put(long key, const wxString& value);
+
+ // get the string from the key: if not found, an empty string is returned
+ // and the wasFound is set to FALSE if not NULL
+ wxString Get(long key, bool *wasFound = NULL) const;
+
+ // remove the item, returning TRUE if the item was found and deleted
+ bool Delete(long key) const;
+
+ // clean up
+ void Destroy();
+
+private:
+ wxArrayLong **m_keys;
+ wxArrayString **m_values;
+
+ // the size of array above
+ size_t m_hashSize;
+
+ DECLARE_NO_COPY_CLASS(wxStringHashTable)
+};
+
+#endif // WXWIN_COMPATIBILITY_2_4
+
+#endif // !wxUSE_STL
+
+// ----------------------------------------------------------------------------
+// for compatibility only
+// ----------------------------------------------------------------------------
+
+#if wxUSE_STL
+
+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 );
+
+ const wxHashTable& operator=( const wxHashTable& );
+
+ void Destroy() { Clear(); }
+
+ // key and value are the same
+ void Put(long value, wxObject *object)
+ { DoPut( value, value, object ); }
+ void Put(long hash, long value, wxObject *object)
+ { DoPut( value, hash, object ); }
+ void Put(const wxChar *value, wxObject *object)
+ { DoPut( value, MakeKey( value ), object ); }
+ void Put(long hash, const wxChar *value, wxObject *object)
+ { DoPut( value, hash, object ); }
+
+ // key and value are the same
+ wxObject *Get(long value) const
+ { return (wxObject*)DoGet( value, value ); }
+ wxObject *Get(long hash, long value) const
+ { return (wxObject*)DoGet( value, hash ); }
+ wxObject *Get(const wxChar *value) const
+ { return (wxObject*)DoGet( value, MakeKey( value ) ); }
+ wxObject *Get(long hash, const wxChar *value) const
+ { return (wxObject*)DoGet( value, hash ); }
+
+ // Deletes entry and returns data if found
+ wxObject *Delete(long key)
+ { return (wxObject*)DoDelete( key, key ); }
+ wxObject *Delete(long hash, long key)
+ { return (wxObject*)DoDelete( key, hash ); }
+ wxObject *Delete(const wxChar *key)
+ { return (wxObject*)DoDelete( key, MakeKey( key ) ); }
+ wxObject *Delete(long hash, const wxChar *key)
+ { return (wxObject*)DoDelete( key, hash ); }
+
+ // 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 );