48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
// src/service/video_service_manager.h (重构后)
|
|
#pragma once
|
|
|
|
// [移除] 不再需要包含具体的模块实现
|
|
// #include "algorithm/IntrusionModule.h"
|
|
|
|
// [保留] 只需要知道 IAnalysisModule 接口
|
|
#include "analysis/interfaces/IAnalysisModule.h"
|
|
#include "nlohmann/json.hpp"
|
|
#include "video_service.h" // (假设 video_service.h 在 service/ 目录下)
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class VideoServiceManager {
|
|
public:
|
|
VideoServiceManager() = default;
|
|
~VideoServiceManager();
|
|
|
|
// 禁止拷贝和赋值
|
|
VideoServiceManager(const VideoServiceManager &) = delete;
|
|
VideoServiceManager &operator=(const VideoServiceManager &) = delete;
|
|
|
|
/**
|
|
* @brief 从独立的 video_config.json 加载配置
|
|
* (功能不变)
|
|
*/
|
|
bool load_config(const std::string &config_path);
|
|
|
|
/**
|
|
* @brief 根据已加载的配置启动所有服务
|
|
* (功能不变)
|
|
*/
|
|
void load_and_start();
|
|
|
|
/**
|
|
* @brief 停止并销毁所有正在运行的视频服务
|
|
* (功能不变)
|
|
*/
|
|
void stop_all();
|
|
|
|
private:
|
|
std::vector<std::unique_ptr<VideoService>> services_;
|
|
|
|
// (功能不变)
|
|
bool m_enabled = false;
|
|
nlohmann::json m_stream_configs_json;
|
|
}; |