ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Functions
ctd::system Namespace Reference

Namespaces

 testUtils
 

Classes

class  Mutex
 

Functions

void Sleep (const float sleep_time)
 Sleep. More...
 
double Time ()
 Return the time in seconds since epoch. More...
 
void SecondsToTimeSpec (const double time, struct timespec &time_spec)
 Convert time in seconds since epoch to a timespec struct. More...
 
void SecondsToTimeVal (const double time, struct timeval &time_val)
 Convert time in seconds since epoch to timeval struct. More...
 
std::string IsoTime (const double time_since_epoch, const uint8_t prec=6)
 Generate ISO8601 timestamp from provided time in seconds since epoch. More...
 
std::string IsoTimeNow (const int8_t prec=6)
 Generate ISO8601 timestamp from time of invoking this function. More...
 
void 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 Platform ()
 Get the name of the platform (OS). More...
 
std::string GenUniqueId (const std::string &prefix="")
 Generate a unique UUID based ID. A prefix may be prepended, if requested. More...
 
int64_t Random (const int64_t min_val, const int64_t max_val)
 Generate an int64_t random number in the inteval specified. More...
 
std::string ExecCommand (const std::string &command)
 Execute a shell command (synchroneously). More...
 
double Random (const double min_val, const double max_val)
 

Function Documentation

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.

std::string ctd::system::ExecCommand ( const std::string &  command)

Execute a shell command (synchroneously).

Todo:
: Execute a shell command (synchroneously). Return status and standard output/error.
Todo:
: Execute a shell command (synchroneously). Return status and standard output/error.
Todo:
: Execute a shell command (synchroneously). Return status and standard output/error.
std::string ctd::system::GenUniqueId ( const std::string &  prefix = "")

Generate a unique UUID based ID. A prefix may be prepended, if requested.

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.

std::string ctd::system::IsoTimeNow ( const int8_t  prec = 6)

Generate ISO8601 timestamp from time of invoking this function.

std::string ctd::system::Platform ( )

Get the name of the platform (OS).

Todo:
: Generate ID for CII version.
Todo:
: Generate ID for CII version.
Todo:
: Generate ID for CII version.
Todo:
: Generate ID for CII version.
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.

double ctd::system::Random ( const double  min_val,
const double  max_val 
)
void ctd::system::SecondsToTimeSpec ( const double  time,
struct timespec &  time_spec 
)

Convert time in seconds since epoch to a timespec struct.

void ctd::system::SecondsToTimeVal ( const double  time,
struct timeval &  time_val 
)

Convert time in seconds since epoch to timeval struct.

void ctd::system::Sleep ( const float  sleep_time)

Sleep.

Parameters
sleep_timeSleep time in seconds. Note: Blocks the thread in which it is invoked, the entire application if singlethreaded.
double ctd::system::Time ( )

Return the time in seconds since epoch.