From 78c4103171732369725487b5f0e43816e1ea1256 Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: 周三, 28 5月 2025 16:58:22 +0800 Subject: [PATCH] 修复了缺少头文件编译报错的问题 --- src/library/os/cpu_info.hpp | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/library/os/cpu_info.hpp b/src/library/os/cpu_info.hpp index e0ec59f..edbe3c6 100644 --- a/src/library/os/cpu_info.hpp +++ b/src/library/os/cpu_info.hpp @@ -7,18 +7,18 @@ #ifndef SRC_LIBRARY_OS_CPU_INFO_H_ #define SRC_LIBRARY_OS_CPU_INFO_H_ +#include <cstdint> #include <string> namespace license { namespace os { -typedef enum { BARE_TO_METAL, VMWARE, VIRTUALBOX, V_XEN, KVM, HV, V_OTHER } VIRTUALIZATION_DETAIL; /** * Cpu informations */ class CpuInfo { private: - bool is_hypervisor_set() const; - + const std::string m_vendor; + const std::string m_brand; public: CpuInfo(); virtual ~CpuInfo(); @@ -26,11 +26,10 @@ * Detect Virtual machine using hypervisor bit or the cpu vendor name. * @return true if the cpu is detected to be a virtual cpu */ - bool cpu_virtual() const; uint32_t model() const; - std::string vendor() const; - // std::string brand() const; - VIRTUALIZATION_DETAIL getVirtualizationDetail() const; + bool is_hypervisor_set() const; + const std::string& vendor() const { return m_vendor; } + const std::string& brand() const { return m_brand; } }; } // namespace os -- Gitblit v1.9.1