跳转至

base/include/system/cpu/cfcpu.h

Declares the basic CPU information query interface. More...

Namespaces

Name
cf

Classes

Name
struct cf::CPUInfoView
Read-only view of basic CPU information.

Detailed Description

Declares the basic CPU information query interface.

Author: Charliechen114514

Version: 0.1

Since: 0.1

Date: 2026-02-21

Provides cross-platform access to CPU model name, architecture, and manufacturer information.

Source code

#pragma once
#include "base/expected/expected.hpp"
#include <string_view>

namespace cf {

enum class CPUInfoErrorType {
    CPU_QUERY_NOERROR,       
    CPU_QUERY_GENERAL_FAILED 
};

struct CPUInfoView {
    std::string_view model;        
    std::string_view arch;         
    std::string_view manufacturer; 
};

expected<CPUInfoView, CPUInfoErrorType> getCPUInfo(bool force_refresh = false);

} // namespace cf

Updated on 2026-03-09 at 10:14:01 +0000