TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsSysInfo.h>

Public Types

enum  SysArch {
  INTEL32 ,
  INTEL64 ,
  ARM32 ,
  ARM64 ,
  RISCV64 ,
  S390X ,
  PPC32 ,
  PPC64 ,
  MIPS32 ,
  MIPS64 ,
  LOONG32 ,
  LOONG64 ,
  SPARC
}
enum  SysFlavor {
  NONE ,
  UNKNOWN ,
  FEDORA ,
  REDHAT ,
  UBUNTU ,
  DEBIAN ,
  RASPBIAN ,
  ALPINE ,
  FREEBSD ,
  NETBSD ,
  OPENBSD ,
  DFLYBSD
}
enum  SysOS {
  LINUX ,
  MACOS ,
  BSD ,
  WINDOWS
}

Public Member Functions

SysArch arch () const
size_t cpuCoreCount () const
UString cpuName () const
bool crcInstructions () const
UString hostName () const
size_t memoryPageSize () const
SysOS os () const
SysFlavor osFlavor () const
int systemBuild () const
int systemMajorVersion () const
UString systemName () const
UString systemVersion () const

Static Public Member Functions

static ts::UString GetAccelerations ()
static ts::UString GetCompilerVersion ()
static ts::UString GetSystemVersion ()
static SysInfo & Instance ()
 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.

LOONG32 

32-bit LoongArch.

LOONG64 

64-bit LoongArch.

SPARC 

Sun SPARC.

◆ SysOS

Operating systems families. Note: unlisted systems are not supported.

Enumerator
LINUX 

Any Linux distro.

MACOS 

Apple macOS.

BSD 

Any BSD flavor.

WINDOWS 

Microsoft Windows.

◆ 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()

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

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.

◆ systemBuild()

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

Get the operating system build as an integer. The exact meaning of this number is system dependent. On Windows, it returns the Windows build number.

Returns
The operating system build 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.

◆ cpuCoreCount()

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

Get the number of CPU cores. This is typically the number of logical cores, which can be different from the number of physical cores when they implement some form of hyperthreading. The result can be the same as std::thread::hardware_concurrency() but the latter is documented to be considered as a hint only and not accurate.

Returns
The number of CPU cores.

◆ memoryPageSize()

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

Get system memory page size.

Returns
The system memory page size in bytes.

◆ GetSystemVersion()

ts::UString ts::SysInfo::GetSystemVersion ( )
static

Build a string representing the system on which the application runs.

Returns
A string describing the system.

◆ GetCompilerVersion()

ts::UString ts::SysInfo::GetCompilerVersion ( )
static

Build a string representing the compiler which was used to build TSDuck.

Returns
A string describing the compiler.

◆ GetAccelerations()

ts::UString ts::SysInfo::GetAccelerations ( )
static

Build a string describing the hardware accelerations on the system on which the application runs.

Returns
A string describing the hardware accelerations.

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