Parallel numerical verification of the σ_odd problem
October 6, 2018
|
Some generic helper functions for programs. More...
Go to the source code of this file.
Namespaces | |
helper | |
Some generic helper functions for programs. | |
Macros | |
#define | GET_OVERLOAD_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME |
From "Variadic macros tricks" https://codecraft.co/2014/11/25/variadic-macros-tricks/. More... | |
#define | TSV1_(a) |
#define | TSV2_(a, b) |
#define | TSV3_(a, b, c) |
#define | TSV4_(a, b, c, d) |
#define | TSV5_(a, b, c, d, e) |
#define | TSV6_(a, b, c, d, e, f) |
#define | TSV7_(a, b, c, d, e, f, g) |
#define | TSV8_(a, b, c, d, e, f, g, h) |
#define | TSV9_(a, b, c, d, e, f, g, h, i) |
#define | TSV10_(a, b, c, d, e, f, g, h, i, j) |
#define | PRINT_LIST(l) |
Print to stdcerr the element of the list l, separated by comma. More... | |
#define | STR(x) STRINGIFY(x) |
Convert the value of the macro x to a literal string. More... | |
#define | STRINGIFY(x) #x |
Convert the name of the macro x to a literal string. More... | |
#define | TSV(...) |
Print to stdout all parameters separated by tabulation. More... | |
Functions | |
std::string | helper::concat_path (std::string path1, std::string path2) |
Return the path composed by path1/path2. More... | |
std::string | helper::duration_ms_to_string (double duration_ms) |
Return a string with the duration expressed in milliseconds, seconds, minutes and hours, separated by tabulation. More... | |
std::string | helper::duration_to_string (std::chrono::duration< double > duration_second) |
Return a string with the duration expressed in milliseconds, seconds, minutes and hours, separated by tabulation. More... | |
std::string | helper::file_to_string (std::string filename) |
Read the file and return its content to a string. If failed then print a error message and exit. More... | |
std::string | helper::get_string (int argc, const char *const argv[], unsigned int i, void(*help_and_exit_function)()=nullptr) |
Return argv[i] converted in string. More... | |
unsigned int | helper::get_uint (int argc, const char *const argv[], unsigned int i, void(*help_and_exit_function)()=nullptr) |
Return argv[i] converted in integer. More... | |
unsigned long | helper::get_ulong (int argc, const char *const argv[], unsigned int i, void(*help_and_exit_function)()=nullptr) |
Return argv[i] converted in integer. More... | |
bool | helper::is_file_exists (std::string filename) |
Return true iff the file (or directory) exists. More... | |
void | helper::print_intern_config_compiler () |
Print to stdcout the intern configuration of the compiler. More... | |
std::string | helper::remove_last_if_null (const std::string &s) |
If s terminates by a null character then return a copy of s without this last character, else return s. More... | |
std::string | helper::to_string (bool b) |
Return the string "true" if b, else "false". More... | |
Some generic helper functions for programs.
(September 14, 2018) GPLv3 — Copyright (C) 2017, 2018 Olivier Pirson http://www.opimedia.be/
Definition in file helper.hpp.
#define GET_OVERLOAD_ | ( | _1, | |
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
NAME, | |||
... | |||
) | NAME |
From "Variadic macros tricks" https://codecraft.co/2014/11/25/variadic-macros-tricks/.
Definition at line 29 of file helper.hpp.
#define PRINT_LIST | ( | l | ) |
Print to stdcerr the element of the list l, separated by comma.
(Useful during development phase.)
l | iterable |
Definition at line 90 of file helper.hpp.
#define STR | ( | x | ) | STRINGIFY(x) |
Convert the value of the macro x to a literal string.
x | macro |
Definition at line 104 of file helper.hpp.
#define STRINGIFY | ( | x | ) | #x |
Convert the name of the macro x to a literal string.
x | macro |
Definition at line 111 of file helper.hpp.
#define TSV | ( | ... | ) |
Print to stdout all parameters separated by tabulation.
If a NTSV macro is defined then do nothing.
(Useful during development phase.)
Definition at line 247 of file helper.hpp.
#define TSV10_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i, | |||
j | |||
) |
Definition at line 72 of file helper.hpp.
#define TSV1_ | ( | a | ) |
Definition at line 32 of file helper.hpp.
#define TSV2_ | ( | a, | |
b | |||
) |
Definition at line 36 of file helper.hpp.
#define TSV3_ | ( | a, | |
b, | |||
c | |||
) |
Definition at line 40 of file helper.hpp.
#define TSV4_ | ( | a, | |
b, | |||
c, | |||
d | |||
) |
Definition at line 44 of file helper.hpp.
#define TSV5_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) |
Definition at line 48 of file helper.hpp.
#define TSV6_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f | |||
) |
Definition at line 52 of file helper.hpp.
#define TSV7_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g | |||
) |
Definition at line 57 of file helper.hpp.
#define TSV8_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h | |||
) |
Definition at line 62 of file helper.hpp.
#define TSV9_ | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i | |||
) |
Definition at line 67 of file helper.hpp.