StormByte-System 3.0.0
C++26 process and environment module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::System::Host::CPU Class Reference

Native CPU queries for this machine, not a cached snapshot. More...

#include <StormByte/system/host.hxx>

Public Member Functions

 CPU ()=default
 Construct a stateless query object without probing.
 CPU (const CPU &other)=default
 Copy a query object.
 CPU (CPU &&other) noexcept=default
 Move a query object.
 ~CPU ()=default
 Destroy a query object.
CPU & operator= (const CPU &other)=default
 Copy-assign a query object.
CPU & operator= (CPU &&other) noexcept=default
 Move-assign a query object.
StormByte::Safe::String Model () const
 Processor brand text.
StormByte::Safe::String Manufacturer () const
 Processor vendor identifier, when exposed by the OS.
StormByte::Safe::String Architecture () const
 Native instruction-set name.
unsigned PhysicalCores () const
 Physical core count across processor packages.
unsigned LogicalProcessors () const noexcept
 Logical processor count visible to the OS.
unsigned Bitness () const noexcept
 Pointer width of this process, not CPU capability.

Detailed Description

Native CPU queries for this machine, not a cached snapshot.

Model and Manufacturer describe the first reported processor. Counts cover the processors visible to the OS, not necessarily the calling process's affinity or container quota.

Constructor & Destructor Documentation

◆ CPU() [1/3]

StormByte::System::Host::CPU::CPU ( )
default

Construct a stateless query object without probing.

◆ CPU() [2/3]

StormByte::System::Host::CPU::CPU ( const CPU & other)
default

Copy a query object.

Parameters
otherSource query object.

◆ CPU() [3/3]

StormByte::System::Host::CPU::CPU ( CPU && other)
defaultnoexcept

Move a query object.

Parameters
otherSource query object.

◆ ~CPU()

StormByte::System::Host::CPU::~CPU ( )
default

Destroy a query object.

Member Function Documentation

◆ Architecture()

StormByte::Safe::String StormByte::System::Host::CPU::Architecture ( ) const

Native instruction-set name.

Returns
x86_64, arm64, x86 or another OS token; empty on failure.

◆ Bitness()

unsigned StormByte::System::Host::CPU::Bitness ( ) const
noexcept

Pointer width of this process, not CPU capability.

Returns
32 or 64; does not update LastError.

◆ LogicalProcessors()

unsigned StormByte::System::Host::CPU::LogicalProcessors ( ) const
noexcept

Logical processor count visible to the OS.

Returns
Processor count, or zero on failure; updates LastError.

◆ Manufacturer()

StormByte::Safe::String StormByte::System::Host::CPU::Manufacturer ( ) const

Processor vendor identifier, when exposed by the OS.

Returns
Vendor text or implementer code, or empty on failure.

◆ Model()

StormByte::Safe::String StormByte::System::Host::CPU::Model ( ) const

Processor brand text.

Returns
Model name, or empty on failure; Unavailable when the OS supplies no name.

◆ operator=() [1/2]

CPU & StormByte::System::Host::CPU::operator= ( const CPU & other)
default

Copy-assign a query object.

Parameters
otherSource query object.
Returns
This object.

◆ operator=() [2/2]

CPU & StormByte::System::Host::CPU::operator= ( CPU && other)
defaultnoexcept

Move-assign a query object.

Parameters
otherSource query object.
Returns
This object.

◆ PhysicalCores()

unsigned StormByte::System::Host::CPU::PhysicalCores ( ) const

Physical core count across processor packages.

Returns
Core count, or zero on failure.

The documentation for this class was generated from the following file: