hwc_state_manager.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: hwc_state_manager.h
  5. *
  6. * Description: HwcStateManager class definition.
  7. *
  8. * Version: 1.0
  9. * Created: 13/01/2021
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: chenyujie, chenyujie28@jd.com@jd.com
  14. * Company: JD.com, Inc.
  15. *
  16. * =====================================================================================
  17. */
  18. #ifndef HWC_STATE_MANAGER_H_
  19. #define HWC_STATE_MANAGER_H_
  20. #include <utility>
  21. #include <assert.h>
  22. // local
  23. #include "hwc_common.h"
  24. class HwcStateBase;
  25. class DbConfig;
  26. class HwcStateManager
  27. {
  28. public:
  29. HwcStateManager();
  30. ~HwcStateManager();
  31. public:
  32. void Start();
  33. void ChangeState(int iNewState);
  34. public:
  35. void BindDBConfigParser(const DbConfig* const p_parser)
  36. { p_db_config_ = p_parser;}
  37. DbConfig* const GetDBConfigParser()
  38. { return p_db_config_; }
  39. int GetCurrentState() { return i_current_state_;}
  40. int GetNextState() { return i_next_state_;}
  41. int GetPreState() { return i_pre_state_;}
  42. private:
  43. int i_pre_state_;
  44. int i_current_state_;
  45. int i_next_state_;
  46. HwcStateBase* p_current_state_;
  47. DbConfig* p_db_config_;
  48. HwcStateMap o_hwc_state_map_;
  49. };
  50. #endif