12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef MODULE_MGR_H
- #define MODULE_MGR_H
- /**
- * @brief 业务模块的管理类,包括:
- * 1、初始化(init:注册web回调函数,读数据库初始化事件列表)
- * 2、启动线程start:向web发送事件
- * 3、结束线程stop
- * @author 戴月腾
- * @date 2018-08-25
- */
- #include"module_web.h"
- #include"module_area.h"
- #include"module_call_help.h"
- class module_mgr: public singleton_base<module_mgr>
- {
- private:
- friend class singleton_base<module_mgr>;
- module_mgr()
- {
- }
- public:
- /**
- * @brief 注册web回调函数,读数据库初始化事件列表
- */
- void init(std::map<std::string, YA::MSG_HANDLE_FUNC_TYPE>& MsgFuncList)
- {
- module_web::instance()->init(MsgFuncList);
- module_area::instance()->init();
- module_call_help::instance()->init();
- }
- /**
- * @brief 启动线程start:向web发送事件
- */
- void start()
- {
- module_area::instance()->start();
- module_call_help::instance()->start();
- }
- /**
- * @brief 结束线程stop
- */
- void stop()
- {
- module_area::instance()->stop();
- module_call_help::instance()->stop();
- }
- };
- #endif // MODULE_MGR_H
|