ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Functions
system.hpp File Reference
#include <string>
#include <sys/sem.h>
#include <pthread.h>
#include "rad/Logger.hpp"
#include "ctd/defines/defines.hpp"

Go to the source code of this file.

Classes

class  ctd::system::Mutex
 

Namespaces

 ctd
 Conversion source file.
 
 ctd::system
 
 ctd::system::testUtils
 

Macros

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

Functions

void ctd::system::Sleep (const float sleep_time)
 Sleep. More...
 
double ctd::system::Time ()
 Return the time in seconds since epoch. More...
 
void ctd::system::SecondsToTimeSpec (const double time, struct timespec &time_spec)
 Convert time in seconds since epoch to a timespec struct. More...
 
void ctd::system::SecondsToTimeVal (const double time, struct timeval &time_val)
 Convert time in seconds since epoch to timeval struct. More...
 
std::string ctd::system::IsoTime (const double time_since_epoch, const uint8_t prec=6)
 Generate ISO8601 timestamp from provided time in seconds since epoch. More...
 
std::string ctd::system::IsoTimeNow (const int8_t prec=6)
 Generate ISO8601 timestamp from time of invoking this function. More...
 
void ctd::system::AssertPtr (const void *ptr, const std::string &object, const std::string &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...
 
std::string ctd::system::GenUniqueId (const std::string &prefix="")
 Generate a unique UUID based ID. A prefix may be prepended, if requested. 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...
 

Macro Definition Documentation

#define BEGIN_CRIT_SEC (   id)
Value:
{ \
ctd::system::Mutex tmpMutex(id); \
base::threading::internal::NoMutex Mutex
Definition: easylogging++.h:1066

Macro to initiate critical section.

#define END_CRIT_SEC   }

Macro to mark end of critical section.