ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Functions

System level utilities. More...

#include <string>
#include <sys/sem.h>
#include <pthread.h>
#include <mutex>
#include "rad/logger.hpp"
#include "ctd/defines/defines.hpp"

Go to the source code of this file.

Classes

class  ctd::system::Mutex
 The Mutex class: Scope based mutex semaphore. The ctd::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...
 

Namespaces

 ctd::system
 
 ctd::system::testUtils
 

Macros

#define BEGIN_CRIT_SEC(id)
 Macro to initiate critical section. More...
 
#define END_CRIT_SEC(id)   }
 Dummy macro to mark end of critical section. More...
 

Functions

double ctd::system::_Time ()
 
void ctd::system::Assert (const bool condition, const std::string &message, std::array< std::string, 3 > &location)
 Check if pointer is NULL. If yes, throw rad::Exception. More...
 
void ctd::system::AssertPtr (const void *ptr, const std::string &object, std::array< std::string, 3 > &location)
 Check if pointer is NULL. If yes, throw rad::Exception. More...
 
std::string ctd::system::Platform ()
 Get the name of the platform (OS). More...
 
int64_t ctd::system::Random (const int64_t min_val, const int64_t max_val)
 Generate an int64_t random number in the inteval specified. More...
 
std::string ctd::system::ExecCommand (const std::string &command)
 Execute a shell command (synchroneously). More...
 
std::string ctd::system::testUtils::GetResDir (const std::string &module_path, const std::string &res_dir="test/resource")
 Derives the "resource" directory from the current working point. More...
 
void ctd::system::testUtils::SetRootEnvVars (const std::string &module_path, const std::string &res_dir="test/resource")
 Set the root environment variables: CFGROOT, INTROOT, DATAROOT. More...
 

Detailed Description

System level utilities.

Macro Definition Documentation

#define BEGIN_CRIT_SEC (   id)
Value:
{ \
ctd::system::Mutex tmp_mutex(id); \

Macro to initiate critical section.

#define END_CRIT_SEC (   id)    }

Dummy macro to mark end of critical section.