7/include/adapter_interface.hpp

76 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef ODF_MANAGEMENT_ADAPTER_INTERFACE_HPP
#define ODF_MANAGEMENT_ADAPTER_INTERFACE_HPP
#include <string>
#include <cstdint>
/// @brief 光纤连接器接口类型
enum class ConnectorType : uint8_t {
LC = 0, ///< LC 连接器
SC = 1, ///< SC 连接器
MPO = 2 ///< MPO 连接器
};
/// @brief 光纤模式
enum class FiberMode : uint8_t {
SingleMode = 0, ///< 单模
MultiMode = 1 ///< 多模
};
/// @brief 端面类型
enum class PolishType : uint8_t {
UPC = 0, ///< UPC (Ultra Physical Contact)
APC = 1 ///< APC (Angled Physical Contact)
};
/**
* @brief 适配器接口信息
*
* 描述 ODF 单元上安装的光纤适配器的技术参数,
* 包括接口类型、光纤模式、端面类型、插拔寿命及安装密度。
*/
struct AdapterInterface {
ConnectorType connector; ///< 连接器类型
FiberMode fiberMode; ///< 光纤模式
PolishType polish; ///< 端面类型
uint32_t minInsertions; ///< 最小插拔次数≥500
uint32_t portsPerUnit; ///< 每U高度端口密度端口数/U
/**
* @brief 构造适配器接口
* @param connector 连接器类型
* @param fiberMode 光纤模式
* @param polish 端面类型
* @param minInsertions 最小插拔次数
* @param portsPerUnit 每U高度端口密度
*/
AdapterInterface(ConnectorType connector,
FiberMode fiberMode,
PolishType polish,
uint32_t minInsertions,
uint32_t portsPerUnit);
/// @brief 默认构造函数
AdapterInterface() = default;
/// @brief 连接器类型字符串
[[nodiscard]] std::string connectorString() const;
/// @brief 光纤模式字符串
[[nodiscard]] std::string fiberModeString() const;
/// @brief 端面类型字符串
[[nodiscard]] std::string polishString() const;
/// @brief 返回适配器参数摘要
[[nodiscard]] std::string summary() const;
/**
* @brief 检查连接器与光纤模式是否兼容
* @return true 兼容false 不兼容
*/
[[nodiscard]] bool checkCompatibility() const;
};
#endif // ODF_MANAGEMENT_ADAPTER_INTERFACE_HPP