1#ifndef NEFORCE_CORE_SYSTEM_SYSINFO_HPP__
2#define NEFORCE_CORE_SYSTEM_SYSINFO_HPP__
14NEFORCE_BEGIN_NAMESPACE__
35class NEFORCE_API sysinfo {
144 system_info system_info_{};
145 memory_info memory_info_{};
146 CPU_info cpu_info_{};
147 os_version_info os_version_info_{};
148 architecture architecture_{architecture::UNKNOWN};
149 atomic<bool> initialized_{
false};
159 ~sysinfo() = default;
241NEFORCE_END_NAMESPACE__
static sysinfo & instance() noexcept
获取单例实例
const CPU_info & get_CPU_info() const noexcept
获取CPU信息
architecture get_architecture() const noexcept
获取系统架构
const os_version_info & get_os_version_info() const noexcept
获取操作系统版本信息
const system_info & get_system_info() const noexcept
获取系统底层信息
const memory_info & get_memory_info() const noexcept
获取内存信息
static float64_t cpu_usage()
获取当前CPU使用率
static uint32_t process_count()
获取当前运行的进程数量
bool is_initialized() const noexcept
检查是否已初始化
unsigned int uint32_t
32位无符号整数类型
double float64_t
64位双精度浮点数类型
unsigned short uint16_t
16位无符号整数类型
unsigned long long uint64_t
64位无符号整数类型
constexpr auto memory_order_acquire
获取内存顺序常量
bool hyperthreading() const noexcept
检查是否支持超线程
uint32_t logical_processors
逻辑处理器数
uint64_t total_physical
物理内存总量
uint64_t available_virtual
可用虚拟内存
uint64_t available_physical
可用物理内存
uint64_t available_page_file
可用页面文件
float64_t physical_memory_usage() const noexcept
计算物理内存使用率
size_t available_memory() const noexcept
获取总可用内存
uint64_t total_page_file
页面文件总量
uint64_t total_virtual
虚拟内存总量
string version() const
获取版本字符串
uint32_t allocation_granularity
内存分配粒度
uintptr_t max_app_address
应用程序最大地址
uintptr_t min_app_address
应用程序最小地址
uint16_t processor_level
处理器级别
uint16_t processor_revision
处理器修订版本
uint32_t processor_numbers
处理器数量
uintptr_t active_processor_mask
活动处理器掩码