2026-05-25 08:25:48 +00:00
|
|
|
|
#ifndef BATTLEFIELD_APP_HPP
|
|
|
|
|
|
#define BATTLEFIELD_APP_HPP
|
|
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include "core/event.hpp"
|
|
|
|
|
|
#include "core/task.hpp"
|
|
|
|
|
|
#include "core/template.hpp"
|
|
|
|
|
|
#include "core/plan.hpp"
|
|
|
|
|
|
#include "core/dispatch.hpp"
|
2026-05-26 05:33:17 +00:00
|
|
|
|
#include "core/message_bus.hpp"
|
2026-05-25 08:25:48 +00:00
|
|
|
|
|
|
|
|
|
|
namespace battlefield {
|
|
|
|
|
|
|
2026-05-26 05:33:17 +00:00
|
|
|
|
/// @brief 战场任务规划系统顶层应用门面(设计文档4.1:CSCI部件编排)
|
|
|
|
|
|
/// 组合所有核心模块,通过消息总线解耦,提供统一的全流程编排入口。
|
2026-05-25 08:25:48 +00:00
|
|
|
|
class App {
|
|
|
|
|
|
public:
|
2026-05-26 05:33:17 +00:00
|
|
|
|
/// @brief 构造函数,初始化各模块并连接消息总线
|
2026-05-25 08:25:48 +00:00
|
|
|
|
App();
|
|
|
|
|
|
|
|
|
|
|
|
/// @brief 运行完整的演示流程
|
|
|
|
|
|
/// 模拟:事件接收 → 任务生成 → 模板选择 → 方案制定 → 分发监控
|
|
|
|
|
|
void Run();
|
|
|
|
|
|
|
2026-05-26 05:33:17 +00:00
|
|
|
|
/// @brief 从事件文件目录运行完整流程(使用 events.ndjson)
|
|
|
|
|
|
/// @param eventFilePath 事件文件路径
|
|
|
|
|
|
/// @param templateDir 模板目录
|
|
|
|
|
|
void RunFromFiles(const std::string& eventFilePath,
|
|
|
|
|
|
const std::string& templateDir);
|
|
|
|
|
|
|
2026-05-25 08:25:48 +00:00
|
|
|
|
/// @brief 获取事件处理器引用
|
|
|
|
|
|
EventProcessor& GetEventProcessor() { return eventProcessor_; }
|
|
|
|
|
|
/// @brief 获取任务生成器引用
|
|
|
|
|
|
TaskGenerator& GetTaskGenerator() { return taskGenerator_; }
|
|
|
|
|
|
/// @brief 获取模板管理器引用
|
|
|
|
|
|
TemplateManager& GetTemplateManager() { return templateManager_; }
|
|
|
|
|
|
/// @brief 获取方案管理器引用
|
|
|
|
|
|
PlanManager& GetPlanManager() { return planManager_; }
|
|
|
|
|
|
/// @brief 获取分发监控器引用
|
|
|
|
|
|
DispatchMonitor& GetDispatchMonitor() { return dispatchMonitor_; }
|
2026-05-26 05:33:17 +00:00
|
|
|
|
/// @brief 获取消息总线引用
|
|
|
|
|
|
MessageBus& GetMessageBus() { return MessageBus::Instance(); }
|
2026-05-25 08:25:48 +00:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
EventProcessor eventProcessor_;
|
|
|
|
|
|
TaskGenerator taskGenerator_;
|
|
|
|
|
|
TemplateManager templateManager_;
|
|
|
|
|
|
PlanManager planManager_;
|
|
|
|
|
|
DispatchMonitor dispatchMonitor_;
|
2026-05-26 05:33:17 +00:00
|
|
|
|
|
|
|
|
|
|
/// @brief 初始化消息总线订阅(连接各模块)
|
|
|
|
|
|
void SetupMessageBus();
|
2026-05-25 08:25:48 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace battlefield
|
|
|
|
|
|
|
|
|
|
|
|
#endif // BATTLEFIELD_APP_HPP
|