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

Identity and capacity of this machine. More...

Enumerations

enum class  Error { Success = 0 , Failed }
 Host enumerators. More...
 

Functions

StormByte::Error::Fault LastError () noexcept
 Last Host error on this thread.
 
bool Name (StormByte::String::String &name)
 Host name of this machine.
 
StormByte::String::String Architecture ()
 Instruction-set name of this machine.
 
StormByte::String::String CPU ()
 Processor brand string.
 
StormByte::String::String OS ()
 Operating system brand and version.
 
StormByte::String::String Kernel ()
 Kernel identification.
 
StormByte::Size PageSize ()
 System page size.
 
StormByte::Size PhysicalMemory ()
 Installed physical memory.
 
StormByte::Size AvailableMemory ()
 Currently available physical memory.
 
unsigned LogicalProcessors () noexcept
 Logical processor count.
 
unsigned Bitness () noexcept
 Pointer width of this process.
 

Detailed Description

Identity and capacity of this machine.

Name returns true on success. Architecture, CPU, OS, Kernel, PageSize, PhysicalMemory and AvailableMemory return a value and update LastError. On failure the string is empty or the Size is zero. LogicalProcessors and Bitness do not touch LastError.

Enumeration Type Documentation

◆ Error

enum class StormByte::System::Host::Error
strong

Host enumerators.

Domain tag StormByte.System.Host. Zero is success.

Enumerator
Success 

No error.

Failed 

The platform call failed.

Function Documentation

◆ Architecture()

StormByte::String::String StormByte::System::Host::Architecture ( )

Instruction-set name of this machine.

Returns
x86_64, arm64, x86 or another platform token. Empty on failure.

◆ AvailableMemory()

StormByte::Size StormByte::System::Host::AvailableMemory ( )

Currently available physical memory.

Returns
Size in bytes, or zero on failure.

◆ Bitness()

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

Pointer width of this process.

Returns
32 or 64.

◆ CPU()

StormByte::String::String StormByte::System::Host::CPU ( )

Processor brand string.

Returns
Brand text. Empty on failure.

◆ Kernel()

StormByte::String::String StormByte::System::Host::Kernel ( )

Kernel identification.

Returns
Text such as Linux 7.2.7 SMP PREEMPT_DYNAMIC, NT 10.0.26100 or Darwin 24.1.0. Empty on failure.

◆ LastError()

StormByte::Error::Fault StormByte::System::Host::LastError ( )
noexcept

Last Host error on this thread.

Returns
Success or an Error code. Stored in the System module TLS.

◆ LogicalProcessors()

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

Logical processor count.

Returns
Hardware concurrency, or 0 if unknown.

◆ Name()

bool StormByte::System::Host::Name ( StormByte::String::String &  name)

Host name of this machine.

Parameters
[out]nameOwned UTF-8 text. Written only on success.
Returns
true if the name was read.

◆ OS()

StormByte::String::String StormByte::System::Host::OS ( )

Operating system brand and version.

Returns
Text such as Gentoo 2.18, Windows 11 or macOS 15.1. Empty on failure.

◆ PageSize()

StormByte::Size StormByte::System::Host::PageSize ( )

System page size.

Returns
Page size in bytes, or zero on failure.

◆ PhysicalMemory()

StormByte::Size StormByte::System::Host::PhysicalMemory ( )

Installed physical memory.

Returns
Size in bytes, or zero on failure.