DDS
ver. 3.6
|
Namespaces | |
impl | |
INet | |
INet declares helpers for Socket and Network operations. | |
stlx | |
STL extensions. | |
Classes | |
class | auto_setenv |
A helper class. Helps to automatically track environment variables. More... | |
class | CConditionEvent |
Helper class for conditional events. More... | |
class | CFindCfgFile |
This class helps to find a cfg location with the best match from the given order. More... | |
class | CHexView |
This class helps to represent a given container's data as in a HEX viewer. More... | |
class | CMutex |
A Mutex wrapper. Based on pthread calls. More... | |
class | CPIDFile |
A PID-file helper. More... | |
class | CProcList |
This class is used to quarry a list of currently running processes. More... | |
class | CProcStatus |
This class helps to retrieve process's information from /proc/<pid>/status. More... | |
class | CSessionIDFile |
class | custom_istream_iterator |
This custom istream iterator helps to read input line by line without breaking lines after whitespace etc. More... | |
struct | HumanReadable |
struct | IsDigit |
class | NONCopyable |
Class which makes child to be non-copyable object. More... | |
class | NullType |
struct | SFileExists |
The SFileExists functor helps to check whether the file by a given full path exists or not. More... | |
struct | SFindName |
class | smart_mutex |
A smart CMutex helper. More... | |
struct | STimeMeasure |
class | system_error |
The system_error exception class retrieves a string, which represent the last error. More... | |
struct | ToLower |
struct | ToUpper |
Typedefs | |
using | crc_optimal_64_t = boost::crc_optimal< 64, 0x04C11DB7, 0, 0, false, false > |
typedef const char * | LPCTSTR |
Long Pointer to a Constant null-Terminated String. More... | |
typedef std::basic_string< char > | tstring |
It wraps wchar_t, when _GLIBCPP_USE_WCHAR_T and _UNICODE are defined and char otherwise. More... | |
typedef std::basic_stringstream< char > | tstringstream |
typedef char | TCHAR |
Use TCHAR instead of char or wchar_t. It will be appropriately translated. More... | |
typedef const char * | LPCSTR |
A long pointer to constant string. More... | |
typedef std::set< std::string > | StringSet_t |
An STL set of strings. More... | |
typedef std::vector< std::string > | StringVector_t |
An STL vector of strings. More... | |
typedef std::vector< char > | CHARVector_t |
An STL vector of char(s). More... | |
typedef std::vector< unsigned char > | BYTEVector_t |
An STL vector of bytes. More... | |
typedef std::map< size_t, std::string > | UIntStringMap_t |
An STL map, which is mapping pairs of size_t (as a key) and string (as a value). More... | |
typedef std::map< std::string, size_t > | StringUIntMap_t |
An STL map, which is mapping pairs of string (as a key) and size_t (as a value) More... | |
typedef int | ERRORCODE |
typedef const ERRORCODE | ERRORCODE_C |
typedef CHexView< BYTEVector_t > | BYTEVectorHexView_t |
typedef std::vector< pid_t > | vectorPid_t |
Enumerations | |
enum | ELogSeverityLevel { proto_low, proto_mid, proto_high, debug, info, warning, error, fatal, log_stdout, log_stdout_clean, log_stderr } |
Log Severity levels. More... | |
Functions | |
std::string | get_temp_dir (const std::string &_prefix) |
void | conflicting_options (const boost::program_options::variables_map &_vm, const char *_opt1, const char *_opt2) |
The conflicting_options function used to check that 'opt1' and 'opt2' are not specified at the same time. More... | |
void | option_dependency (const boost::program_options::variables_map &_vm, const char *_for_what, const char *_required_option) |
The option_dependency function used to check that if 'for_what' is specified, then 'required_option' is specified too. More... | |
template<class ret_t , class crc_t > | |
ret_t | crc (const std::string &_str) |
uint32_t | crc32 (const std::string &_str) |
uint64_t | crc64 (const std::string &_str) |
template<class ret_t , class crc_t > | |
ret_t | crc (std::istream &_stream) |
uint32_t | crc32 (std::istream &_stream) |
uint64_t | crc64 (std::istream &_stream) |
template<class T , class Ch , class Tr , class Dist > | |
bool | operator== (const custom_istream_iterator< T, Ch, Tr, Dist > &lhs, const custom_istream_iterator< T, Ch, Tr, Dist > &rhs) |
template<class T , class Ch , class Tr , class Dist > | |
bool | operator!= (const custom_istream_iterator< T, Ch, Tr, Dist > &lhs, const custom_istream_iterator< T, Ch, Tr, Dist > &rhs) |
void | findCommanderServerImpl (std::string *_host, std::string *_port, const std::string &_name) |
void | findCommanderServer (std::string *_host, std::string *_port) |
void | findCommanderUI (std::string *_host, std::string *_port) |
std::istream & | operator>> (std::istream &_in, ELogSeverityLevel &_logSeverityLevel) |
std::ostream & | operator<< (std::ostream &_out, ELogSeverityLevel _logSeverityLevel) |
void | setupEnv () |
ERRORCODE_C | erOK (EXIT_SUCCESS) |
ERRORCODE_C | erTrue (-1) |
ERRORCODE_C | erFalse (-2) |
ERRORCODE_C | erError (EXIT_FAILURE) |
ERRORCODE_C | erNotImpl (3) |
ERRORCODE_C | BASE_FOR_GENERAL_ERR (50) |
ERRORCODE_C | erNULLArg (BASE_FOR_GENERAL_ERR+1) |
ERRORCODE_C | erFILE_NOT_FOUND (BASE_FOR_GENERAL_ERR+2) |
ERRORCODE_C | BASE_FOR_XML_ERR (100) |
ERRORCODE_C | erXMLInit (BASE_FOR_XML_ERR+1) |
ERRORCODE_C | erXMLReadConfig (BASE_FOR_XML_ERR+2) |
ERRORCODE_C | erXMLNullNode (BASE_FOR_XML_ERR+3) |
int | errno2str (std::string *_msg) |
Retrieves a string, which represent the last error. More... | |
std::string | errno2str () |
Retrieves a string, which represent the last error. More... | |
BOOST_LOG_ATTRIBUTE_KEYWORD (severity, "Severity", ELogSeverityLevel) class Logger | |
void | parseExe (const std::string &_exeStr, const std::string &_exePrefix, std::string &_filepath, std::string &_filename, std::string &_cmdStr) |
template<class Options_t > | |
int | defaultExecSetup (int _argc, char *_argv[], Options_t *_options, std::function< bool(int argc, char *argv[], Options_t *)> _parseFunc) |
int | defaultExecReinit (const boost::uuids::uuid &_sid) |
template<typename _T > | |
_T * | smart_append (_T *_pString, const typename _T::value_type _ItemToAdd) |
appends character _ItemToAdd to the string _pString if there is no such suffix on the end of _pString. More... | |
template<typename _T > | |
_T & | trim_right (_T *_pString, const typename _T::value_type &_chWhat) |
trims trailing characters from the string. More... | |
template<typename _T > | |
_T & | trim_left (_T *_pString, const typename _T::value_type &_chWhat) |
trims leading characters from the string. More... | |
template<typename _T > | |
_T & | trim (_T *_pString, const typename _T::value_type &_chWhat) |
trims trailing and leading characters from the string. More... | |
template<typename _T > | |
_T & | replace (_T *_pString, const _T &_what, const _T &_with) |
finds elements in a string match a specified string and replaces it. More... | |
template<typename _T > | |
_T & | to_upper (_T &_str) |
convert string to upper case. More... | |
template<typename _T > | |
_T & | to_lower (_T &_str) |
convert string to lower case. More... | |
bool | IsProcessRunning (pid_t _PID) |
The function checks, whether the process which corresponds to the given _PID can be found. More... | |
vectorPid_t | getprocbyname (const std::string &_Srv, bool _filterForRealUserID=false) |
_filterForRealUserID is an OS X specific argument More... | |
bool | is_status_ok (int status) |
pid_t | execute (const std::string &_Command, const std::string &_stdoutFileName, const std::string &_stderrFileName, std::string *_outputFilesAccessPermissions=nullptr) |
void | execute (const std::string &_Command) |
We do not want the parent process to wait for its child process and we do not want to create a zombie. More... | |
pid_t | execute (const std::string &_Command, const std::chrono::seconds &_Timeout, std::string *_output=nullptr, std::string *_errout=nullptr, int *_exitCode=nullptr) |
std::string | getProgressDisplayString (int _completed, int _total) |
const LPCSTR | g_cszLOG_DATETIME_FRMT ("%Y-%m-%d %H:%M:%S") |
Log Date/Time format. More... | |
const size_t | LOG_DATETIME_BUFF_LEN (25) |
const LPCSTR | g_cszLOG_SEVERITY_INFO ("INF") |
const LPCSTR | g_cszLOG_SEVERITY_WARNING ("WRN") |
const LPCSTR | g_cszLOG_SEVERITY_FAULT ("ERR") |
const LPCSTR | g_cszLOG_SEVERITY_CRITICAL_ERROR ("FLT") |
const LPCSTR | g_cszLOG_SEVERITY_DEBUG ("DBG") |
const LPCSTR | g_cszMODULENAME_CORE ("CORE") |
const LPCSTR | g_cszReportBugsAddr ("Report bugs/comments to fairroot@gsi.de") |
const LPCSTR | g_cszDDSServerIsNotFound_StartIt ("Looks like we can't find any suitable DDS commander server to " "connect. Use \"dds-session start\" to start one.") |
void | get_cuser_name (std::string *_RetVal) |
The function returns current user name. More... | |
void | get_homedir (uid_t _uid, std::string *_RetVal) |
The function returns home directory path of the given user. More... | |
void | get_homedir (const char *_UName, std::string *_RetVal) |
The function returns home directory path of the given user. More... | |
void | get_cuser_homedir (std::string *_RetVal) |
The function returns home directory path of the current user. More... | |
template<class _T > | |
void | smart_path (_T *_Path) |
The function extends any environment variable found in the give path to its value. More... | |
template<class _T > | |
_T | smart_path (const _T &_Path) |
void | get_hostname (std::string *_RetVal) |
The function is used to access the host name (with FCDN) of the current processor. More... | |
unsigned long | gettid () |
A system helper, which helps to get a Thread ID of the current thread. More... | |
char * | __cxa_demangle (const char *mangled, char *buf, size_t *len, int *status) |
demangling C++ symbols. More... | |
std::string | demangle (const std::type_info &ti) |
void | get_env (const std::string &_EnvVarName, std::string *_RetVal) |
off_t | file_size (const std::string &_FileName) |
The function file_size() retrieves file size of a given file. More... | |
bool | file_exists (const std::string &_FileName) |
size_t | getNCores () |
the function returns a number of available CPU cores More... | |
Variables | |
const std::array< std::string, 11 > | g_LogSeverityLevelString |
typedef std::vector<unsigned char> dds::misc::BYTEVector_t |
An STL vector of bytes.
typedef std::vector<char> dds::misc::CHARVector_t |
An STL vector of char(s).
using dds::misc::crc_optimal_64_t = typedef boost::crc_optimal<64, 0x04C11DB7, 0, 0, false, false> |
typedef int dds::misc::ERRORCODE |
typedef const ERRORCODE dds::misc::ERRORCODE_C |
typedef const char* dds::misc::LPCSTR |
A long pointer to constant string.
typedef const char* dds::misc::LPCTSTR |
Long Pointer to a Constant null-Terminated String.
It wraps wchar_t, when _GLIBCPP_USE_WCHAR_T and _UNICODE are defined and char otherwise.
typedef std::set<std::string> dds::misc::StringSet_t |
An STL set of strings.
typedef std::map<std::string, size_t> dds::misc::StringUIntMap_t |
An STL map, which is mapping pairs of string (as a key) and size_t (as a value)
typedef std::vector<std::string> dds::misc::StringVector_t |
An STL vector of strings.
typedef char dds::misc::TCHAR |
Use TCHAR instead of char or wchar_t. It will be appropriately translated.
if _GLIBCPP_USE_WCHAR_T and _UNICODE are correctly defined (or not).
typedef std::basic_string<char> dds::misc::tstring |
It wraps wchar_t, when _GLIBCPP_USE_WCHAR_T and _UNICODE are defined and char otherwise.
typedef std::basic_stringstream<char> dds::misc::tstringstream |
typedef std::map<size_t, std::string> dds::misc::UIntStringMap_t |
An STL map, which is mapping pairs of size_t (as a key) and string (as a value).
typedef std::vector<pid_t> dds::misc::vectorPid_t |
char* dds::misc::__cxa_demangle | ( | const char * | mangled, |
char * | buf, | ||
size_t * | len, | ||
int * | status | ||
) |
ERRORCODE_C dds::misc::BASE_FOR_GENERAL_ERR | ( | 50 | ) |
ERRORCODE_C dds::misc::BASE_FOR_XML_ERR | ( | 100 | ) |
dds::misc::BOOST_LOG_ATTRIBUTE_KEYWORD | ( | severity | , |
"Severity" | , | ||
ELogSeverityLevel | |||
) |
Return singleton instance
Initialization of log. Has to be called in main.
Main logger object
File sink
|
inline |
The conflicting_options function used to check that 'opt1' and 'opt2' are not specified at the same time.
[in] | _vm | - a BOOST program options variable map. |
[in] | _opt1 | - the first option to check. |
[in] | _opt2 | - the second option to check. |
std::runtime_error | - thrown if the 'opt1' and 'opt2' are specified at the same time. |
ret_t dds::misc::crc | ( | const std::string & | _str | ) |
ret_t dds::misc::crc | ( | std::istream & | _stream | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
ERRORCODE_C dds::misc::erError | ( | EXIT_FAILURE | ) |
ERRORCODE_C dds::misc::erFalse | ( | - | 2 | ) |
ERRORCODE_C dds::misc::erFILE_NOT_FOUND | ( | BASE_FOR_GENERAL_ERR+ | 2 | ) |
ERRORCODE_C dds::misc::erNotImpl | ( | 3 | ) |
ERRORCODE_C dds::misc::erNULLArg | ( | BASE_FOR_GENERAL_ERR+ | 1 | ) |
ERRORCODE_C dds::misc::erOK | ( | EXIT_SUCCESS | ) |
|
inline |
Retrieves a string, which represent the last error.
[in,out] | _msg | - an error message will be written to this buffer, must not be NULL. |
|
inline |
Retrieves a string, which represent the last error.
ERRORCODE_C dds::misc::erTrue | ( | - | 1 | ) |
ERRORCODE_C dds::misc::erXMLInit | ( | BASE_FOR_XML_ERR+ | 1 | ) |
ERRORCODE_C dds::misc::erXMLNullNode | ( | BASE_FOR_XML_ERR+ | 3 | ) |
ERRORCODE_C dds::misc::erXMLReadConfig | ( | BASE_FOR_XML_ERR+ | 2 | ) |
|
inline |
|
inline |
We do not want the parent process to wait for its child process and we do not want to create a zombie.
|
inline |
|
inline |
|
inline |
The function file_size() retrieves file size of a given file.
[in] | _FileName | - full file name. |
system_error | - thrown if error occurs. |
|
inline |
|
inline |
|
inline |
const LPCSTR dds::misc::g_cszDDSServerIsNotFound_StartIt | ( | "Looks like we can't find any suitable DDS commander server to " "connect. Use \"dds-session start\" to start one." | ) |
const LPCSTR dds::misc::g_cszLOG_DATETIME_FRMT | ( | "%Y-%m-%d %H:%M:%S" | ) |
Log Date/Time format.
const LPCSTR dds::misc::g_cszLOG_SEVERITY_CRITICAL_ERROR | ( | "FLT" | ) |
const LPCSTR dds::misc::g_cszLOG_SEVERITY_DEBUG | ( | "DBG" | ) |
const LPCSTR dds::misc::g_cszLOG_SEVERITY_FAULT | ( | "ERR" | ) |
const LPCSTR dds::misc::g_cszLOG_SEVERITY_INFO | ( | "INF" | ) |
const LPCSTR dds::misc::g_cszLOG_SEVERITY_WARNING | ( | "WRN" | ) |
const LPCSTR dds::misc::g_cszMODULENAME_CORE | ( | "CORE" | ) |
const LPCSTR dds::misc::g_cszReportBugsAddr | ( | "Report bugs/comments to fairroot@gsi.de" | ) |
|
inline |
The function returns home directory path of the current user.
[out] | _RetVal | - A pointer to string buffer where path will be stored. Must not be NULL. |
|
inline |
The function returns current user name.
[out] | _RetVal | - A pinter to string buffer where user name will be stored. Must not be NULL. |
|
inline |
|
inline |
The function returns home directory path of the given user.
[in] | _uid | - user id the home directory of which should be returned. |
[out] | _RetVal | - A pointer to string buffer where path will be stored. Must not be NULL. |
|
inline |
The function returns home directory path of the given user.
[in] | _UName | - a name of the user the home directory of which should be returned. |
[out] | _RetVal | - A pointer to string buffer where path will be stored. Must not be NULL. |
|
inline |
The function is used to access the host name (with FCDN) of the current processor.
[out] | _RetVal | - The returned buffer string. Must not be NULL. |
|
inline |
|
inline |
the function returns a number of available CPU cores
|
inline |
_filterForRealUserID is an OS X specific argument
|
inline |
|
inline |
A system helper, which helps to get a Thread ID of the current thread.
|
inline |
|
inline |
The function checks, whether the process which corresponds to the given _PID can be found.
[in] | _PID | - a process ID to look for. |
const size_t dds::misc::LOG_DATETIME_BUFF_LEN | ( | 25 | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
The option_dependency function used to check that if 'for_what' is specified, then 'required_option' is specified too.
[in] | _vm | - a BOOST program options variable map. |
[in] | _for_what | - option to check. |
[in] | _required_option | - required option. |
std::runtime_error | - thrown if 'for_what' is specified but there is no 'required_option' found. |
|
inline |
finds elements in a string match a specified string and replaces it.
[in,out] | _pString | - The string to be processed. |
[in] | _what | - String to be replaced. |
[in] | _with | - Replacing string. |
|
inline |
_T* dds::misc::smart_append | ( | _T * | _pString, |
const typename _T::value_type | _ItemToAdd | ||
) |
appends character _ItemToAdd to the string _pString if there is no such suffix on the end of _pString.
[in] | _pString | - The string to be processed. |
[in] | _ItemToAdd | - The target characters to be checked and added. |
|
inline |
The function extends any environment variable found in the give path to its value.
This function also extends "~/" or "~user_name/" to a real user's home directory path. When, for example, there is a variable $GLITE_LOCATE = /opt/glite and the given path is "$GLITE_LOCATION/etc/test.xml", the return value will be a path "/opt/glite/etc/test.xml"
[in,out] | _Path | - A pointer to a string buffer which represents a path to extend. Must not be NULL. |
convert string to lower case.
[in] | _str | - Sting to convert. |
convert string to upper case.
[in] | _str | - Sting to convert. |
_T& dds::misc::trim | ( | _T * | _pString, |
const typename _T::value_type & | _chWhat | ||
) |
trims trailing and leading characters from the string.
[in] | _pString | - The string to be trimmed. |
[in] | _chWhat | - The target character to be trimmed. |
_T& dds::misc::trim_left | ( | _T * | _pString, |
const typename _T::value_type & | _chWhat | ||
) |
trims leading characters from the string.
[in] | _pString | - The string to be trimmed. |
[in] | _chWhat | - The target character to be trimmed. |
_T& dds::misc::trim_right | ( | _T * | _pString, |
const typename _T::value_type & | _chWhat | ||
) |
trims trailing characters from the string.
[in] | _pString | - The string to be trimmed. |
[in] | _chWhat | - The target character to be trimmed. |
const std::array<std::string, 11> dds::misc::g_LogSeverityLevelString |