1
0

module_mgr.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef MODULE_MGR_H
  2. #define MODULE_MGR_H
  3. /**
  4. * @brief 业务模块的管理类,包括:
  5. * 1、初始化(init:注册web回调函数,读数据库初始化事件列表)
  6. * 2、启动线程start:向web发送事件
  7. * 3、结束线程stop
  8. * @author 戴月腾
  9. * @date 2018-08-25
  10. */
  11. #include "module_singleton_base.h"
  12. #include "websocket/wsClientMgr.h"
  13. #include "common.h"
  14. struct config_file;
  15. class module_mgr: public singleton_base<module_mgr>
  16. {
  17. private:
  18. friend class singleton_base<module_mgr>;
  19. module_mgr()
  20. {
  21. }
  22. public:
  23. /**
  24. * @brief 注册web回调函数,读配置文件,启动向web发送线程
  25. */
  26. static void init(config_file& config, std::map<std::string, YA::MSG_HANDLE_FUNC_TYPE>& MsgFuncList);
  27. /**
  28. * @brief 启动线程start:向web发送事件
  29. */
  30. static void start();
  31. /**
  32. * @brief 结束线程stop
  33. */
  34. static void stop();
  35. static void do_status(STATUS_CARD st, uint32_t card_id, int32_t type);
  36. };
  37. #endif // MODULE_MGR_H