ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::utils::system Namespace Reference

Classes

class  Mutex
 The Mutex class: Scope based mutex semaphore. The ifw::core::utils::system::Mutex semaphore is used to implement a safe mutex semaphore, at scope level. When entering the scope the semaphore is automatically created, based on a ID, if not existing, and locked. The semaphore created is recursive. When leaving the scope, the destructor will automatically unlock the semaphore. More...
 

Functions

double _Time ()
 
void Assert (const bool condition, const std::string &message, std::array< std::string, 3 > &location)
 Check if pointer is NULL. If yes, throw std::runtime_error.
 
void AssertPtr (const void *ptr, const std::string &object, std::array< std::string, 3 > &location)
 Check if pointer is NULL. If yes, throw std::runtime_error.
 
std::string Platform ()
 Get the name of the platform (OS).
 
int64_t Random (const int64_t min_val, const int64_t max_val)
 Generate an int64_t random number in the inteval specified.
 
std::string ExecCommand (const std::string &command)
 Execute a shell command (synchroneously).
 
void Assert (const bool condition, const std::string &message, const std::array< std::string, 3 > &location)
 
double Random (const double min_val, const double max_val)
 

Function Documentation

◆ _Time()

double ifw::core::utils::system::_Time ( )

◆ Assert() [1/2]

void ifw::core::utils::system::Assert ( const bool condition,
const std::string & message,
const std::array< std::string, 3 > & location )

◆ Assert() [2/2]

void ifw::core::utils::system::Assert ( const bool condition,
const std::string & message,
std::array< std::string, 3 > & location )

Check if pointer is NULL. If yes, throw std::runtime_error.

◆ AssertPtr()

void ifw::core::utils::system::AssertPtr ( const void * ptr,
const std::string & object,
std::array< std::string, 3 > & location )

Check if pointer is NULL. If yes, throw std::runtime_error.

◆ ExecCommand()

std::string ifw::core::utils::system::ExecCommand ( const std::string & command)

Execute a shell command (synchroneously).

Todo
: Execute a shell command (synchroneously). Return status and standard output/error.

◆ Platform()

std::string ifw::core::utils::system::Platform ( )

Get the name of the platform (OS).

Todo
: Generate ID for CII version.

◆ Random() [1/2]

double ifw::core::utils::system::Random ( const double min_val,
const double max_val )

◆ Random() [2/2]

int64_t ifw::core::utils::system::Random ( const int64_t min_val,
const int64_t max_val )

Generate an int64_t random number in the inteval specified.