TSDuck v3.38-3731
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SysInfo Class Reference

A singleton holding information on the current operating system. More...

#include <tsSysInfo.h>

Public Types

enum  SysArch {
  INTEL32 ,
  INTEL64 ,
  ARM32 ,
  ARM64 ,
  RISCV64 ,
  S390X ,
  PPC32 ,
  PPC64 ,
  MIPS32 ,
  MIPS64 ,
  SPARC
}
 Operating system architecture. More...
 
enum  SysFlavor {
  NONE ,
  UNKNOWN ,
  FEDORA ,
  REDHAT ,
  UBUNTU ,
  DEBIAN ,
  RASPBIAN ,
  ALPINE ,
  FREEBSD ,
  NETBSD ,
  OPENBSD ,
  DFLYBSD
}
 Operating systems flavor, typically a Linux distribution. More...
 
enum  SysOS {
  LINUX ,
  MACOS ,
  BSD ,
  WINDOWS
}
 Operating systems families. More...
 

Public Member Functions

SysArch arch () const
 Get the architecture of the CPU on which we run.
 
UString cpuName () const
 Get the name of the CPU architecure.
 
bool crcInstructions () const
 Check if the CPU supports accelerated instructions for CRC32 computation.
 
UString hostName () const
 Get the name of the system host.
 
size_t memoryPageSize () const
 Get system memory page size.
 
SysOS os () const
 Get the operating system family.
 
SysFlavor osFlavor () const
 Get the operating system flavor.
 
int systemMajorVersion () const
 Get the operating system major version as an integer.
 
UString systemName () const
 Get the operating system name.
 
UString systemVersion () const
 Get the operating system version.
 

Static Public Member Functions

static SysInfoInstance ()
 Get the instance of the singleton of this class.
 

Detailed Description

A singleton holding information on the current operating system.

Member Enumeration Documentation

◆ SysArch

Operating system architecture.

Note: unlisted architectures are not supported.

Enumerator
INTEL32 

Intel IA-32, also known as x86.

INTEL64 

64-bit extension of the IA-32 architecture, also known as AMD-64 or Intel x86-64.

ARM32 

32-bit Arm (up to Armv7).

ARM64 

64-bit Arm (Armv8 onwards), also known as aarch64.

RISCV64 

64-bit RISC-V.

S390X 

64-bit IBM s390x.

PPC32 

32-bit PowerPC.

PPC64 

64-bit PowerPC.

MIPS32 

32-bit MIPS.

MIPS64 

64-bit MIPS.

SPARC 

Sun SPARC.

◆ SysOS

Operating systems families.

Note: unlisted systems are not supported.

◆ SysFlavor

Operating systems flavor, typically a Linux distribution.

Enumerator
NONE 

No divergent flavor in the system family (e.g. macOS, Windows).

UNKNOWN 

Unknown flavor, unable to identify the distro.

FEDORA 

Fedora Linux.

REDHAT 

Red Hat Entreprise Linux or one of its clones such as Rocky Linux, Alma Linux, CentOS.

UBUNTU 

Ubuntu Linux.

DEBIAN 

Debian Linux.

RASPBIAN 

Raspbian Linux (Debian derivative on Raspberry Pi).

ALPINE 

Alpine Linux.

FREEBSD 

FreeBSD.

NETBSD 

NetBSD.

OPENBSD 

OpenBSD.

DFLYBSD 

DragonFlyBSD.

Member Function Documentation

◆ Instance()

static SysInfo & ts::SysInfo::Instance ( )
inlinestatic

Get the instance of the singleton of this class.

Returns
The instance of the singleton of this class.

◆ arch()

SysArch ts::SysInfo::arch ( ) const
inline

Get the architecture of the CPU on which we run.

This can be different from the preprocessing directives. For instance, on Windows, the actual CPU can be INTEL64 but the compiled code can be INTEL32.

Returns
The architecture of the CPU on which we run.

◆ os()

SysOS ts::SysInfo::os ( ) const
inline

Get the operating system family.

Returns
The operating system family.

◆ osFlavor()

SysFlavor ts::SysInfo::osFlavor ( ) const
inline

Get the operating system flavor.

Returns
The operating system flavor.

◆ crcInstructions()

bool ts::SysInfo::crcInstructions ( ) const
inline

Check if the CPU supports accelerated instructions for CRC32 computation.

Returns
True if the CPU supports CRC32 instructions.

◆ systemVersion()

UString ts::SysInfo::systemVersion ( ) const
inline

Get the operating system version.

Returns
The operating system version.

◆ systemMajorVersion()

int ts::SysInfo::systemMajorVersion ( ) const
inline

Get the operating system major version as an integer.

The exact meaning of this number is system dependent.

Returns
The operating system major version or -1 if unknown.

◆ systemName()

UString ts::SysInfo::systemName ( ) const
inline

Get the operating system name.

Returns
The operating system name.

◆ hostName()

UString ts::SysInfo::hostName ( ) const
inline

Get the name of the system host.

Returns
The name of the system host.

◆ cpuName()

UString ts::SysInfo::cpuName ( ) const
inline

Get the name of the CPU architecure.

Returns
The name of the CPU architecure.

◆ memoryPageSize()

size_t ts::SysInfo::memoryPageSize ( ) const
inline

Get system memory page size.

Returns
The system memory page size in bytes.

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