Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
767 B

  1. #ifndef _HASHTABLE_H
  2. #define _HASHTABLE_H
  3. #include "Allocator.h"
  4. #include "BasicTree.h"
  5. template <class WmiKey,class WmiElement,ULONG HashSize>
  6. class WmiHashTable
  7. {
  8. private:
  9. WmiBasicTree <WmiKey,WmiElement> *m_Buckets ;
  10. WmiAllocator &m_Allocator ;
  11. public:
  12. WmiHashTable (
  13. WmiAllocator &a_Allocator
  14. ) ;
  15. ~WmiHashTable () ;
  16. WmiStatusCode Initialize () ;
  17. WmiStatusCode UnInitialize () ;
  18. WmiStatusCode Insert (
  19. const WmiKey &a_Key ,
  20. const WmiElement &a_Element
  21. ) ;
  22. WmiStatusCode Delete (
  23. const WmiKey &a_Key
  24. ) ;
  25. WmiStatusCode Find (
  26. const WmiKey &a_Key ,
  27. WmiElement &a_Element
  28. ) ;
  29. ULONG Size () { return m_Root.Size () ; } ;
  30. } ;
  31. #include <HashTable.cpp>
  32. #endif _HASHTABLE_H