37 #ifndef RTPKEYHASHTABLE_H 39 #define RTPKEYHASHTABLE_H 47 template<
class Key,
class Element,
class GetIndex,
int hashsize>
84 int AddElement(
const Key &k,
const Element &elem);
127 template<
class Key,
class Element,
class GetIndex,
int hashsize>
130 for (
int i = 0;
i < hashsize;
i++)
136 template<
class Key,
class Element,
class GetIndex,
int hashsize>
194 template<
class Key,
class Element,
class GetIndex,
int hashsize>
200 index = GetIndex::GetIndex(k);
201 if (index >= hashsize)
218 template<
class Key,
class Element,
class GetIndex,
int hashsize>
225 index = GetIndex::GetIndex(k);
226 if (index >= hashsize)
231 while (!found && tmp != 0)
233 if (tmp->GetKey() == k)
241 template<
class Key,
class Element,
class GetIndex,
int hashsize>
248 template<
class Key,
class Element,
class GetIndex,
int hashsize>
255 template<
class Key,
class Element,
class GetIndex,
int hashsize>
260 for (
int i = 0;
i < hashsize;
i++)
274 template<
class Key,
class Element,
class GetIndex,
int hashsize>
281 index = GetIndex::GetIndex(k);
282 if (index >= hashsize)
287 while (!found && e != 0)
289 if (e->GetKey() == k)
302 table[index] = newelem;
323 template<
class Key,
class Element,
class GetIndex,
int hashsize>
336 #endif // RTPKEYHASHTABLE_H int AddElement(const Key &k, const Element &elem)
int DeleteCurrentElement()
#define ERR_RTP_KEYHASHTABLE_KEYALREADYEXISTS
int DeleteElement(const Key &k)
int GotoElement(const Key &k)
bool HasElement(const Key &k)
HashElement(const Key &k, const Element &e, int index)
#define ERR_RTP_KEYHASHTABLE_FUNCTIONRETURNEDINVALIDHASHINDEX
HashElement * table[hashsize]
HashElement * lasthashelem
HashElement * curhashelem
void GotoPreviousElement()
Element & GetCurrentElement()
#define ERR_RTP_KEYHASHTABLE_KEYNOTFOUND
HashElement * firsthashelem
#define ERR_RTP_KEYHASHTABLE_NOCURRENTELEMENT