From 1d1082fe695366da3498f528b953203a90fe7385 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <contini.mailing@gmail.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