From 95d1452eefadffaf1ec75dd0a8336bc2c387eb17 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 01 2月 2020 02:48:51 +0800 Subject: [PATCH] rename enums and further developments --- src/library/os/cpu_info.hpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/library/os/cpu_info.hpp b/src/library/os/cpu_info.hpp index 716ca40..04da89b 100644 --- a/src/library/os/cpu_info.hpp +++ b/src/library/os/cpu_info.hpp @@ -10,10 +10,15 @@ #include <string> namespace license { +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; + public: CpuInfo(); virtual ~CpuInfo(); @@ -22,8 +27,9 @@ * @return true if the cpu is detected to be a virtual cpu */ bool cpu_virtual() const; - uint32_t model(); + uint32_t model() const; std::string vendor() const; + VIRTUALIZATION_DETAIL getVirtualizationDetail() const; }; } /* namespace license */ -- Gitblit v1.9.1