Source code of Windows XP (NT5)
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.

66 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) Microsoft Corporation, 1991 - 1998
  4. //
  5. // File: pershash.hxx
  6. //
  7. // Contents: Abstract class for persistent hash table
  8. //
  9. // History: 07-May-97 SitaramR Created from strings.hxx
  10. //
  11. //----------------------------------------------------------------------------
  12. #pragma once
  13. #include <prpstmgr.hxx>
  14. #include <dynstrm.hxx>
  15. #include "chash.hxx"
  16. //+-------------------------------------------------------------------------
  17. //
  18. // Class: CPersHash
  19. //
  20. // Purpose: Abstract class for persistent hash table
  21. //
  22. // History: 07-May-97 SitaramR Created
  23. // 23-Feb-98 KitmanH Added a protected member,
  24. // _fIsReadOnly
  25. //
  26. //--------------------------------------------------------------------------
  27. class CPersHash
  28. {
  29. public:
  30. CPersHash( CPropStoreManager & PropStoreMgr, BOOL fAggressiveGrowth );
  31. virtual ~CPersHash();
  32. virtual BOOL FastInit ( CiStorage * pStorage, ULONG version, BOOL fIsFileIdMap );
  33. virtual void LongInit ( ULONG version, BOOL fDirtyShutdown );
  34. virtual void Empty();
  35. virtual void LokFlush();
  36. void Shutdown ();
  37. protected:
  38. void GrowHashTable();
  39. void GrowToSize( unsigned cElements );
  40. //
  41. // Error recovery.
  42. //
  43. virtual BOOL ReInit( ULONG version );
  44. virtual void HashAll() = 0;
  45. CPropStoreManager & _PropStoreMgr;// Property store manager
  46. CDynStream * _pStreamHash; // Persistent hash stream
  47. CWidHashTable _hTable; // Map fileids to wids (using hash stream)
  48. BOOL _fIsOpen; // If TRUE, successfully opened
  49. BOOL _fAbort; // To abort long operations
  50. BOOL _fFullInit; // Set to TRUE if fully initialized.
  51. BOOL _fIsReadOnly; // TRUE if the catalog is for read only
  52. };