task_plan/include/app.hpp

70 lines
1.7 KiB
C++
Raw Permalink Normal View History

2026-05-20 08:00:11 +00:00
#ifndef ETMS_APP_HPP
#define ETMS_APP_HPP
#include <string>
2026-05-21 07:09:58 +00:00
#include <memory>
#include "event_manager.hpp"
#include "task_template_manager.hpp"
2026-05-20 08:00:11 +00:00
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief ETMS
2026-05-20 09:17:29 +00:00
*
2026-05-21 07:09:58 +00:00
*
*
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
class App {
2026-05-20 09:17:29 +00:00
public:
/**
2026-05-21 07:09:58 +00:00
* @brief App
* @param appName
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
explicit App(const std::string& appName);
2026-05-20 09:17:29 +00:00
2026-05-21 07:09:58 +00:00
/// @brief 析构函数,释放内部资源
~App();
2026-05-20 09:17:29 +00:00
2026-05-21 07:09:58 +00:00
// 禁止拷贝
App(const App&) = delete;
App& operator=(const App&) = delete;
2026-05-20 09:17:29 +00:00
2026-05-21 07:09:58 +00:00
/// @brief 允许移动
App(App&&) noexcept;
App& operator=(App&&) noexcept;
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief
* @return true false
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
bool initialize();
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
void run();
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief
* @return EventManager&
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
EventManager& getEventManager();
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief
* @return TaskTemplateManager&
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
TaskTemplateManager& getTaskTemplateManager();
2026-05-20 09:17:29 +00:00
/**
2026-05-21 07:09:58 +00:00
* @brief
2026-05-20 09:17:29 +00:00
*/
2026-05-21 07:09:58 +00:00
void printSummary() const;
2026-05-20 09:17:29 +00:00
private:
2026-05-21 07:09:58 +00:00
std::string m_appName; ///< 应用名称
std::unique_ptr<EventManager> m_eventManager; ///< 事件管理器
std::unique_ptr<TaskTemplateManager> m_templateManager; ///< 任务模板管理器
bool m_initialized = false; ///< 初始化标志
2026-05-20 09:17:29 +00:00
};
2026-05-20 08:00:11 +00:00
#endif // ETMS_APP_HPP