7/include/config_template.hpp

54 lines
2.0 KiB
C++
Raw Permalink Normal View History

2026-06-09 02:34:04 +00:00
#ifndef ODF_MANAGEMENT_CONFIG_TEMPLATE_HPP
#define ODF_MANAGEMENT_CONFIG_TEMPLATE_HPP
#include <string>
#include <vector>
#include <cstdint>
/**
* @brief
*
* LC
*
*
*/
struct ConfigTemplate {
std::string scenarioName; ///< 场景名称
std::vector<std::string> components; ///< 使用组件列表(适配器、跳线、收发器等)
std::string topologyRef; ///< 连接拓扑图引用
uint32_t portsPerCabinet; ///< 单柜端口密度
double spareRatio; ///< 备用余量比例(如 0.15 表示 15%
/**
* @brief
* @param scenarioName
* @param components
* @param topologyRef
* @param portsPerCabinet
* @param spareRatio
*/
ConfigTemplate(std::string scenarioName,
std::vector<std::string> components,
std::string topologyRef,
uint32_t portsPerCabinet,
double spareRatio);
/// @brief 默认构造函数
ConfigTemplate() = default;
/**
* @brief BOM
* @param cabinetCount
* @return
*/
[[nodiscard]] std::string generateBomSummary(uint32_t cabinetCount) const;
/// @brief 返回模板基本信息
[[nodiscard]] std::string summary() const;
/// @brief 获取预定义的内置模板列表
[[nodiscard]] static std::vector<ConfigTemplate> builtInTemplates();
};
#endif // ODF_MANAGEMENT_CONFIG_TEMPLATE_HPP