- wxHashTableBase( wxKeyType keyType = wxKEY_INTEGER,
- size_t size = wxHASH_SIZE_DEFAULT )
- : m_map( size, wxHashTableHash( keyType ),
- wxHashTableEqual( keyType ) ),
- m_keyType( keyType ) { }
-
- ~wxHashTableBase()
- {
- 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++
- }
- }
- }
-
- size_t GetCount() const { return m_map.size(); }
-protected:
- void DoPut( long key, void* data )
- {
- wxHashKeyValue k; k.integer = key;
- m_map[k] = data;
- }
-
- void DoPut( const wxChar* key, void* data )
- {
- wxHashKeyValue k;
- k.string = new wxChar[wxStrlen(key) + 1];
- wxStrcpy(k.string, key);
- m_map[k] = data;
- }
-
- void* DoGet( long key ) const
- {
- wxHashKeyValue k; k.integer = key;
- wxHashTableBaseBase::const_iterator it = m_map.find( k );
-
- return it != m_map.end() ? it->second : NULL;
- }
+ wxHashTableBase_Node( long key, void* value,
+ wxHashTableBase* table );
+ wxHashTableBase_Node( const wxChar* key, void* value,
+ wxHashTableBase* table );
+ ~wxHashTableBase_Node();