7/include/odf_unit.hpp

66 lines
1.9 KiB
C++
Raw Permalink Normal View History

2026-06-09 02:34:04 +00:00
#ifndef ODF_MANAGEMENT_ODF_UNIT_HPP
#define ODF_MANAGEMENT_ODF_UNIT_HPP
#include <string>
#include <cstdint>
/// @brief ODF 单元类型枚举
enum class OdfUnitType : uint8_t {
Splicing = 0, ///< 熔接型
Patching = 1, ///< 配线型
Hybrid = 2 ///< 混合型
};
/// @brief 安装方式枚举
enum class MountType : uint8_t {
Rack19Inch = 0, ///< 19英寸机架式
WallMounted = 1 ///< 壁挂式
};
/**
* @brief ODF 线
*
* ODF
*/
struct OdfUnit {
std::string id; ///< 编号(按命名规则生成)
OdfUnitType type; ///< 单元类型
uint32_t maxPorts; ///< 最大端口数(容量)
uint32_t heightMm; ///< 高度mm
uint32_t widthMm; ///< 宽度mm
uint32_t depthMm; ///< 深度mm
MountType mountType; ///< 安装方式
/**
* @brief ODF
* @param id
* @param type
* @param maxPorts
* @param heightMm mm
* @param widthMm mm
* @param depthMm mm
* @param mountType
*/
OdfUnit(std::string id,
OdfUnitType type,
uint32_t maxPorts,
uint32_t heightMm,
uint32_t widthMm,
uint32_t depthMm,
MountType mountType);
/// @brief 默认构造函数
OdfUnit() = default;
/// @brief 返回类型字符串表示
[[nodiscard]] std::string typeString() const;
/// @brief 返回安装方式字符串表示
[[nodiscard]] std::string mountString() const;
/// @brief 返回属性摘要
[[nodiscard]] std::string summary() const;
};
#endif // ODF_MANAGEMENT_ODF_UNIT_HPP