From 6dd7902d6f148a4ac78e5478edb3a2ca8624f74c Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周日, 15 3月 2020 16:07:14 +0800
Subject: [PATCH] cpu brand

---
 src/library/os/cpu_info.hpp |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/library/os/cpu_info.hpp b/src/library/os/cpu_info.hpp
index 04da89b..a35de10 100644
--- a/src/library/os/cpu_info.hpp
+++ b/src/library/os/cpu_info.hpp
@@ -9,7 +9,7 @@
 #define SRC_LIBRARY_OS_CPU_INFO_H_
 #include <string>
 namespace license {
-
+namespace os {
 typedef enum { BARE_TO_METAL, VMWARE, VIRTUALBOX, V_XEN, KVM, HV, V_OTHER } VIRTUALIZATION_DETAIL;
 
 /**
@@ -18,7 +18,8 @@
 class CpuInfo {
 private:
 	bool is_hypervisor_set() const;
-
+	const std::string m_vendor;
+	const std::string m_brand;
 public:
 	CpuInfo();
 	virtual ~CpuInfo();
@@ -28,10 +29,11 @@
 	 */
 	bool cpu_virtual() const;
 	uint32_t model() const;
-	std::string vendor() const;
-	VIRTUALIZATION_DETAIL getVirtualizationDetail() const;
+	const std::string& vendor() const { return m_vendor; }
+	const std::string& brand() const { return m_brand; }
+	VIRTUALIZATION_DETAIL virtualization_details() const;
 };
 
-} /* namespace license */
-
+}  // namespace os
+}  // namespace license
 #endif /* SRC_LIBRARY_OS_CPU_INFO_H_ */

--
Gitblit v1.9.1