MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Functions
util::system Namespace Reference

Cross-platform operating system related functions. More...

Functions

template<typename T >
betoh (T const &x)
 Big endian to host order conversion.
 
template<int N>
void byte_swap (char *data)
 Swaps little/big endianess of the operand.
 
template<>
void byte_swap< 2 > (char *data)
 
template<>
void byte_swap< 4 > (char *data)
 
template<>
void byte_swap< 8 > (char *data)
 
template<typename T >
letoh (T const &x)
 Little endian to host order conversion.
 
void print_build_timestamp (char const *application_name, char const *date, char const *time)
 Prints the application name and the given date and time strings.
 
void print_build_timestamp (char const *application_name)
 Prints the application name and date and time of the build.
 
void print_stack_trace (void)
 Prints a stack trace.
 
float rand_float (void)
 Returns a floating point random number in [0, 1].
 
void rand_init (void)
 Initializes the random number generator.
 
int rand_int (void)
 Returns a random number in [0, 2^31].
 
void rand_seed (int seed)
 Initializes the random number generator with a given seed.
 
template<typename T >
read_binary_little_endian (std::istream *stream)
 Reads little endian according to host order conversion.
 
void register_segfault_handler (void)
 Registers signal SIGSEGV (segmentation fault) handler.
 
void signal_segfault_handler (int code)
 Handles signal SIGSEGV (segmentation fault) printing a stack trace.
 
void sleep (std::size_t msec)
 Sleeps the given amount of milli seconds.
 
void sleep_sec (float secs)
 Sleeps the given amount of seconds.
 

Detailed Description

Cross-platform operating system related functions.

Function Documentation

◆ betoh()

template<typename T >
T util::system::betoh ( T const &  x)
inline

Big endian to host order conversion.

◆ byte_swap()

template<int N>
void util::system::byte_swap ( char *  data)
inline

Swaps little/big endianess of the operand.

◆ byte_swap< 2 >()

template<>
void util::system::byte_swap< 2 > ( char *  data)
inline

Definition at line 185 of file system.h.

◆ byte_swap< 4 >()

template<>
void util::system::byte_swap< 4 > ( char *  data)
inline

Definition at line 192 of file system.h.

◆ byte_swap< 8 >()

template<>
void util::system::byte_swap< 8 > ( char *  data)
inline

Definition at line 200 of file system.h.

◆ letoh()

template<typename T >
T util::system::letoh ( T const &  x)
inline

Little endian to host order conversion.

◆ print_build_timestamp() [1/2]

void util::system::print_build_timestamp ( char const *  application_name,
char const *  date,
char const *  time 
)

Prints the application name and the given date and time strings.

Definition at line 23 of file system.cc.

◆ print_build_timestamp() [2/2]

void util::system::print_build_timestamp ( char const *  application_name)
inline

Prints the application name and date and time of the build.

Definition at line 132 of file system.h.

◆ print_stack_trace()

void util::system::print_stack_trace ( void  )

Prints a stack trace.

Definition at line 52 of file system.cc.

◆ rand_float()

float util::system::rand_float ( void  )
inline

Returns a floating point random number in [0, 1].

Definition at line 120 of file system.h.

◆ rand_init()

void util::system::rand_init ( void  )
inline

Initializes the random number generator.

Definition at line 108 of file system.h.

◆ rand_int()

int util::system::rand_int ( void  )
inline

Returns a random number in [0, 2^31].

Definition at line 126 of file system.h.

◆ rand_seed()

void util::system::rand_seed ( int  seed)
inline

Initializes the random number generator with a given seed.

Definition at line 114 of file system.h.

◆ read_binary_little_endian()

template<typename T >
T util::system::read_binary_little_endian ( std::istream *  stream)
inline

Reads little endian according to host order conversion.

Definition at line 253 of file system.h.

◆ register_segfault_handler()

void util::system::register_segfault_handler ( void  )

Registers signal SIGSEGV (segmentation fault) handler.

Definition at line 33 of file system.cc.

◆ signal_segfault_handler()

void util::system::signal_segfault_handler ( int  code)

Handles signal SIGSEGV (segmentation fault) printing a stack trace.

Definition at line 41 of file system.cc.

◆ sleep()

void util::system::sleep ( std::size_t  msec)
inline

Sleeps the given amount of milli seconds.

Definition at line 96 of file system.h.

◆ sleep_sec()

void util::system::sleep_sec ( float  secs)
inline

Sleeps the given amount of seconds.

Definition at line 102 of file system.h.