Elements 6.2.1
A C++ base framework for the Euclid Software.
|
Classes | |
class | ModuleInfo |
Typedefs | |
using | ImageHandle = void * |
Definition of an image handle. | |
using | ProcessHandle = void * |
Definition of the process handle. | |
using | EntryPoint = unsigned long(*)(const unsigned long iid, void **ppvObject) |
Definition of the "generic" DLL entry point function. | |
using | Creator = void *(*)() |
Definition of the "generic" DLL entry point function. | |
Enumerations | |
enum class | ModuleType { UNKNOWN , SHAREDLIB , EXECUTABLE } |
enum class | InfoType { NoFetch , RemainTime , Times , ProcessBasics , PriorityBoost , Memory , Quota , System , Modules , IO } |
Enumeration for fetching information. More... | |
Variables | |
const std::string | SHLIB_VAR_NAME {"LD_LIBRARY_PATH"} |
name of the shared dynamic library path | |
const std::string | LIB_PREFIX {"lib"} |
constant that represent the common prefix of the libraries | |
const std::string | LIB_EXTENSION {"so"} |
constant that represent the common extension of the libraries | |
const std::string | LIB_SUFFIX {"." + LIB_EXTENSION} |
constant that represents the standard suffix of the libraries: usually "."+LIB_EXTENSION | |
const std::string | SHLIB_SUFFIX {LIB_SUFFIX} |
alias for LIB_SUFFIX | |
const std::string | DEFAULT_INSTALL_PREFIX {"/usr"} |
constant for the canonical installation prefix (on Linux and MacOSX at least) | |
const int | STACK_OFFSET {2} |
using Elements::System::Creator = typedef void* (*)() |
using Elements::System::EntryPoint = typedef unsigned long (*)(const unsigned long iid, void** ppvObject) |
using Elements::System::ImageHandle = typedef void* |
using Elements::System::ProcessHandle = typedef void* |
|
strong |
Enumeration for fetching information.
Enumerator | |
---|---|
NoFetch | |
RemainTime | |
Times | |
ProcessBasics | |
PriorityBoost | |
Memory | |
Quota | |
System | |
Modules | |
IO |
Definition at line 28 of file SystemBase.h.
|
strong |
Enumerator | |
---|---|
UNKNOWN | |
SHAREDLIB | |
EXECUTABLE |
Definition at line 58 of file ModuleInfo.h.
Elements::System::__attribute__ | ( | (noinline) | ) |
Definition at line 386 of file System.cpp.
Definition at line 397 of file System.cpp.
References backTrace(), std::dec(), std::vector< T >::emplace_back(), getStackLevel(), std::hex(), std::setiosflags(), std::setw(), and STACK_OFFSET.
ELEMENTS_API int Elements::System::backTrace | ( | ELEMENTS_UNUSED std::shared_ptr< void * > | addresses, |
ELEMENTS_UNUSED const int | depth | ||
) |
Referenced by backTrace(), and Elements::ProgramManager::onTerminate().
ImageHandle Elements::System::exeHandle | ( | ) |
Handle to the executable file running.
Definition at line 165 of file ModuleInfo.cpp.
Name of the executable file running.
Definition at line 184 of file ModuleInfo.cpp.
References std::vector< T >::empty().
get all environment variables
get all defined environment vars
Definition at line 357 of file System.cpp.
References std::vector< T >::emplace_back().
Referenced by getEnv(), isEnvSet(), and loadDynamicLib().
string Elements::System::getEnv | ( | const std::string & | var | ) |
get a particular environment variable
Definition at line 324 of file System.cpp.
References getEnv().
bool Elements::System::getEnv | ( | const std::string & | var, |
std::string & | value | ||
) |
get a particular env var, storing the value in the passed string (if set)
get a particular environment variable, storing the value in the passed string if the variable is set. Returns true if the variable is set, false otherwise.
Definition at line 334 of file System.cpp.
Retrieve error code as string for a given error.
Definition at line 165 of file System.cpp.
References std::strerror().
Referenced by getLastErrorString().
Path::Item Elements::System::getExecutablePath | ( | ) |
Get the full executable path.
Definition at line 247 of file ModuleInfo.cpp.
References getSelfProc().
Get last system known error.
Retrieve last error code.
Definition at line 153 of file System.cpp.
Referenced by getLastErrorString(), and unloadDynamicLib().
Get last system error as string.
Retrieve last error code as string.
Definition at line 159 of file System.cpp.
References getErrorString(), and getLastError().
Referenced by getProcedureByName().
unsigned long Elements::System::getProcedureByName | ( | ImageHandle | handle, |
const std::string & | name, | ||
Creator * | pFunction | ||
) |
Get a specific function defined in the DLL.
Definition at line 148 of file System.cpp.
References getProcedureByName().
unsigned long Elements::System::getProcedureByName | ( | ImageHandle | handle, |
const std::string & | name, | ||
EntryPoint * | pFunction | ||
) |
Get a specific function defined in the DLL.
Definition at line 124 of file System.cpp.
References std::string::c_str(), std::endl(), and getLastErrorString().
Referenced by getProcedureByName().
Path::Item Elements::System::getSelfProc | ( | ) |
Get the path to the /proc directory of the process.
Definition at line 192 of file ModuleInfo.cpp.
Referenced by getExecutablePath(), and linkedModulePaths().
ELEMENTS_API bool Elements::System::getStackLevel | ( | ELEMENTS_UNUSED void * | addresses, |
ELEMENTS_UNUSED void *& | addr, | ||
ELEMENTS_UNUSED std::string & | fnc, | ||
ELEMENTS_UNUSED std::string & | lib | ||
) |
Referenced by backTrace().
bool Elements::System::getStackLevel | ( | void *addresses | ELEMENTS_UNUSED, |
void *&addr | ELEMENTS_UNUSED, | ||
string &fnc | ELEMENTS_UNUSED, | ||
string &lib | ELEMENTS_UNUSED | ||
) |
Definition at line 427 of file System.cpp.
const ModuleInfo & Elements::System::getThisExecutableInfo | ( | ) |
Definition at line 33 of file ThisModule.cpp.
References Elements::System::ModuleInfo::isEmpty().
Host name.
Definition at line 278 of file System.cpp.
References std::vector< T >::data(), and HOST_NAME_MAX.
bool Elements::System::isEnvSet | ( | const std::string & | var | ) |
Check if an environment variable is set or not.
Definition at line 347 of file System.cpp.
References getEnv(), and isEnvSet().
Referenced by isEnvSet().
vector< Path::Item > Elements::System::linkedModulePaths | ( | ) |
Definition at line 207 of file ModuleInfo.cpp.
References std::vector< T >::emplace_back(), std::getline(), and getSelfProc().
Referenced by linkedModules().
Vector of names of linked modules.
Definition at line 236 of file ModuleInfo.cpp.
References std::vector< T >::emplace_back(), linkedModulePaths(), and std::vector< T >::size().
unsigned long Elements::System::loadDynamicLib | ( | const std::string & | name, |
ImageHandle * | handle | ||
) |
Load dynamic link library.
Definition at line 88 of file System.cpp.
References getEnv(), std::string::length(), and SHLIB_SUFFIX.
Machine type.
Definition at line 313 of file System.cpp.
ImageHandle Elements::System::moduleHandle | ( | ) |
Handle to currently executed module.
Definition at line 153 of file ModuleInfo.cpp.
References moduleHandle(), and processHandle().
Referenced by moduleHandle(), moduleName(), and moduleNameFull().
Get the name of the (executable/DLL) file without file-type.
Retrieve base name of module.
Definition at line 96 of file ModuleInfo.cpp.
References std::vector< T >::empty(), moduleHandle(), and processHandle().
Get the full name of the (executable/DLL) file.
Retrieve full name of module.
Definition at line 108 of file ModuleInfo.cpp.
References std::vector< T >::empty(), moduleHandle(), and processHandle().
ModuleType Elements::System::moduleType | ( | ) |
Get type of the module.
Definition at line 124 of file ModuleInfo.cpp.
References EXECUTABLE, SHAREDLIB, and UNKNOWN.
OS name.
Definition at line 289 of file System.cpp.
OS version.
Definition at line 301 of file System.cpp.
void * Elements::System::processHandle | ( | ) |
Handle to running process.
Retrieve process handle.
Definition at line 143 of file ModuleInfo.cpp.
Referenced by moduleHandle(), moduleName(), and moduleNameFull().
int Elements::System::setEnv | ( | const std::string & | name, |
const std::string & | value, | ||
bool | overwrite = true |
||
) |
set an environment variables.
Set an environment variables. If value is empty, the variable is removed from the environment. When overwrite is 0, the variable is not set if already present. Returns 0 on success, -1 on failure. See man 3 setenv.
Definition at line 369 of file System.cpp.
References std::string::c_str(), and setEnv().
Referenced by setEnv().
void Elements::System::setModuleHandle | ( | ImageHandle | handle | ) |
Attach module handle.
Definition at line 149 of file ModuleInfo.cpp.
const string Elements::System::typeinfoName | ( | const std::type_info & | tinfo | ) |
Get platform independent information about the class type.
Definition at line 186 of file System.cpp.
References typeinfoName().
Referenced by typeinfoName().
unsigned long Elements::System::unloadDynamicLib | ( | ImageHandle | handle | ) |
unload dynamic link library
Definition at line 115 of file System.cpp.
References getLastError().
int Elements::System::unSetEnv | ( | const std::string & | name | ) |
Simple wrap around unsetenv for strings.
Definition at line 379 of file System.cpp.
References std::string::c_str(), and unSetEnv().
Referenced by unSetEnv().
const std::string Elements::System::DEFAULT_INSTALL_PREFIX {"/usr"} |
const std::string Elements::System::LIB_EXTENSION {"so"} |
const std::string Elements::System::LIB_PREFIX {"lib"} |
const std::string Elements::System::LIB_SUFFIX {"." + LIB_EXTENSION} |
const std::string Elements::System::SHLIB_SUFFIX {LIB_SUFFIX} |
const std::string Elements::System::SHLIB_VAR_NAME {"LD_LIBRARY_PATH"} |
const int Elements::System::STACK_OFFSET {2} |
Definition at line 92 of file System.h.
Referenced by backTrace().