ADTF  3.18.4
workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/system/system.h
Go to the documentation of this file.
1 
15 #ifndef A_UTIL_UTIL_SYSTEM_SYSTEM_HEADER_INCLUDED
16 #define A_UTIL_UTIL_SYSTEM_SYSTEM_HEADER_INCLUDED
17 
18 #include <a_util/base/types.h> //timestamp_t
19 #include <a_util/filesystem/path.h> //Path
20 
21 #include <string>
22 
23 namespace a_util {
24 namespace system {
29 std::string getCurrentUserName();
30 
35 std::string getHostname();
36 
42 
48 
51 
57 std::string formatSystemError(int system_error_code);
58 
63 void sleepMilliseconds(std::uint32_t ms);
64 
70 void sleepMicroseconds(std::uint64_t us);
71 
77 
84 
91 public:
94 
97 
102  bool isSupported() const;
103 
104 private:
106  HighResSchedulingSupport& operator=(const HighResSchedulingSupport&); // = delete;
107 
108 private:
109  unsigned int _handle;
110 };
111 
112 } // namespace system
113 } // namespace a_util
114 
115 #endif // A_UTIL_UTIL_SYSTEM_SYSTEM_HEADER_INCLUDED
File/Directory path class.
Definition: path.h:45
bool isSupported() const
Check whether high resolution scheduling is supported by the OS.
HighResSchedulingSupport()
CTOR - requests support from OS.
~HighResSchedulingSupport()
DTOR - relinquishes support from the OS.
std::int64_t timestamp_t
Type of a timestamp value. If not otherwise stated, always in microseconds.
std::string getHostname()
Get the current hostname.
void resetLastSystemError()
Reset last system error to its initial value.
void sleepMilliseconds(std::uint32_t ms)
Yield calling thread to the operating system, scheduled to awake after a period of milliseconds.
timestamp_t getCurrentMicroseconds()
Get the current microseconds passed since the first invocation (or -1 if not available)
std::string formatSystemError(int system_error_code)
Get the description message associated with the given system error code.
std::string getCurrentUserName()
Get the current user name.
timestamp_t getCurrentMilliseconds()
Get the current milliseconds passed since system start.
void sleepMicroseconds(std::uint64_t us)
Yields calling thread to the operating system, scheduled to awake after a period of microseconds.
a_util::filesystem::Path getExecutablePath()
Get full path to the executable that started the calling system process.
int getLastSystemError()
Get the last system error (platform specific, errno or GetLastError)
Serves as the root component, with common functionality documented in core functionality.
Definition: base.h:24
Public API for Path type and functions.
Public types and functions defining a_util core functionality.