nancy.liao
2025-05-29 8d405b265285c368df2e9cf1c14acee7532e0ee7
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 {
typedef enum { BARE_TO_METAL, VMWARE, VIRTUALBOX, V_XEN, KVM, HV, V_OTHER } VIRTUALIZATION_DETAIL;
namespace os {
/**
 * 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,12 +26,12 @@
    * 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;
   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 license */
}  // namespace os
}  // namespace license
#endif /* SRC_LIBRARY_OS_CPU_INFO_H_ */