- wxHashTableBaseBase(size_t size, const wxHashTableHash& hash,
- const wxHashTableEqual& equal)
- : wxHashTableBaseBaseBase(size, hash, equal)
- { }
-
- void multi_insert(const wxHashKeyValue& key, void* value)
- {
- CreateNodeLast(value_type(key, value));
- }
-};
-
-class WXDLLIMPEXP_BASE wxHashTableBase
-{
-public:
- wxHashTableBase( wxKeyType keyType = wxKEY_INTEGER,
- size_t size = wxHASH_SIZE_DEFAULT )
- : m_map( size, wxHashTableHash( keyType ),
- wxHashTableEqual( keyType ) ),
- m_keyType( keyType ) { }
-
- ~wxHashTableBase() { Clear(); }
-
- size_t GetCount() const { return m_map.size(); }
-
- void Clear()
- {
- if( m_keyType == wxKEY_STRING )
- {
- for( wxHashTableBaseBase::iterator it = m_map.begin(),
- en = m_map.end();
- it != en; )
- {
- wxChar* tmp = it->first.string;
- ++it;
- delete[] tmp; // used in operator++
- }
- }
- m_map.clear();
- }
-protected:
- void DoPut( long key, void* data )
- {
- wxASSERT( m_keyType == wxKEY_INTEGER );
-
- wxHashKeyValue k; k.integer = key;
- m_map.multi_insert(k, data);
- }
-
- void DoPut( const wxChar* key, void* data )
- {
- wxASSERT( m_keyType == wxKEY_STRING );
-
- wxHashKeyValue k;
- k.string = wxStrcpy(new wxChar[wxStrlen(key) + 1], key);
- m_map.multi_insert(k, data);
- }
+ wxHashTableBase_Node( long key, void* value,
+ wxHashTableBase* table );
+ wxHashTableBase_Node( const wxChar* key, void* value,
+ wxHashTableBase* table );
+ ~wxHashTableBase_Node();