ADTF
Loading...
Searching...
No Matches
a_util::system Namespace Reference

Serves as component for portable OS (Windows, Linux, ...) functionality. More...

Classes

class  AddressInfo
 
class  HighResSchedulingSupport
 
class  Timer
 

Functions

std::string getCurrentUserName ()
 
std::string getHostname ()
 
a_util::filesystem::Path getExecutablePath ()
 
int getLastSystemError ()
 
void resetLastSystemError ()
 Reset last system error to its initial value.
 
std::string formatSystemError (int system_error_code)
 
void sleepMilliseconds (std::uint32_t ms)
 
void sleepMicroseconds (std::uint64_t us)
 
timestamp_t getCurrentMilliseconds ()
 
timestamp_t getCurrentMicroseconds ()
 
std::string generateUUIDv4 ()
 

Detailed Description

Serves as component for portable OS (Windows, Linux, ...) functionality.

Function Documentation

◆ formatSystemError()

std::string a_util::system::formatSystemError ( int system_error_code)

Get the description message associated with the given system error code

Parameters
[in]system_error_codeThe error code to get the description for.
Returns
Description associated with the system error code

◆ generateUUIDv4()

std::string a_util::system::generateUUIDv4 ( )

Generate a UUIDv4 string

Returns
A fully randomized UUIDv4 string

◆ getCurrentMicroseconds()

timestamp_t a_util::system::getCurrentMicroseconds ( )

Get the current microseconds passed since the first invocation (or -1 if not available)

Note
This method requires high-resolution timer support in the OS
Returns
System running time in microseconds

◆ getCurrentMilliseconds()

timestamp_t a_util::system::getCurrentMilliseconds ( )

Get the current milliseconds passed since system start

Returns
System running time in milliseconds

◆ getCurrentUserName()

std::string a_util::system::getCurrentUserName ( )

Get the current user name

Returns
The current name of the user

◆ getExecutablePath()

a_util::filesystem::Path a_util::system::getExecutablePath ( )

Get full path to the executable that started the calling system process

Returns
Absolute path and including to the executable

◆ getHostname()

std::string a_util::system::getHostname ( )

Get the current hostname

Returns
The hostname

◆ getLastSystemError()

int a_util::system::getLastSystemError ( )

Get the last system error (platform specific, errno or GetLastError)

Returns
The last system error code

◆ sleepMicroseconds()

void a_util::system::sleepMicroseconds ( std::uint64_t us)

Yields calling thread to the operating system, scheduled to awake after a period of microseconds.

Note
To achieve the high resolution, use HighResSchedulingSupport
Parameters
[in]usDuration to yield the thread in microseconds

◆ sleepMilliseconds()

void a_util::system::sleepMilliseconds ( std::uint32_t ms)

Yield calling thread to the operating system, scheduled to awake after a period of milliseconds.

Parameters
[in]msDuration to yield the thread in milliseconds