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.

79 lines
2.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: rmstate.hxx
  7. //
  8. // Contents: CResManager state tracking
  9. //
  10. // Classes: CResManState
  11. //
  12. // History: 1-24-97 SrikantS Created
  13. // 07-05-97 SitaramR Changed to use disable/enable updates logic
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. enum EState
  18. {
  19. eSteady, // No scan is needed (or same as the state where
  20. // client has been notified that updates are enabled)
  21. eUpdatesToBeDisabled, // Client needs to be notified that updates are
  22. // to be disabled. eUpdateType specifies
  23. // whether this will need an incremental or a full
  24. // update
  25. eUpdatesDisabled, // Client has been notified that updates have
  26. // been disabled
  27. eUpdatesToBeEnabled, // Client needs to be notified that updates have
  28. // to be enabled
  29. };
  30. enum EUpdateType // Type of update that needs to be done when updates
  31. { // are disabled and then subsequently enabled
  32. eIncremental,
  33. eFull
  34. };
  35. //+---------------------------------------------------------------------------
  36. //
  37. // Class: CResManState
  38. //
  39. // Purpose: Tracks the state of ContentIndex in CResManager (in-memory).
  40. // Updates to be enabled/disabled events are kept track in this.
  41. //
  42. // History: 2-10-97 SrikantS Created
  43. // 07-05-97 SitaramR Usns
  44. //
  45. //----------------------------------------------------------------------------
  46. class CResManState
  47. {
  48. public:
  49. CResManState()
  50. : _eState( eSteady ),
  51. _eUpdateType( eIncremental ),
  52. _fCorruptionNotified(FALSE)
  53. {
  54. }
  55. void LokSetState( EState eState ) { _eState = eState; }
  56. EState LokGetState() const { return _eState; }
  57. void LokSetUpdateType( EUpdateType eType ) { _eUpdateType = eType; }
  58. EUpdateType LokGetUpdateType() const { return _eUpdateType; }
  59. void LokSetCorruptionNotified() { _fCorruptionNotified = TRUE; }
  60. BOOL FLokCorruptionNotified() const { return _fCorruptionNotified; }
  61. private:
  62. EState _eState; // State of updates
  63. EUpdateType _eUpdateType; // Update type
  64. BOOL _fCorruptionNotified; // Has corruption been notified to client ?
  65. };