31#ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_SYSTEM_H_
32#define ELEMENTSKERNEL_ELEMENTSKERNEL_SYSTEM_H_
94#if defined(__linux__) || defined(__APPLE__)
95#define TEMPLATE_SPECIALIZATION
100#ifdef _POSIX_HOST_NAME_MAX
101#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
103#define HOST_NAME_MAX 255
113using EntryPoint =
unsigned long (*)(
const unsigned long iid,
void** ppvObject);
defines the macros to be used for explicit export of the symbols
Macro to silence unused variables warnings from the compiler.
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
unsigned long(*)(const unsigned long iid, void **ppvObject) EntryPoint
Definition of the "generic" DLL entry point function.
ELEMENTS_API bool isEnvSet(const std::string &var)
Check if an environment variable is set or not.
const std::string SHLIB_SUFFIX
alias for LIB_SUFFIX
const std::string DEFAULT_INSTALL_PREFIX
constant for the canonical installation prefix (on Linux and MacOSX at least)
const std::string LIB_SUFFIX
constant that represents the standard suffix of the libraries: usually "."+LIB_EXTENSION
ELEMENTS_API const std::string getErrorString(unsigned long error)
Retrieve error code as string for a given error.
ELEMENTS_API int setEnv(const std::string &name, const std::string &value, bool overwrite=true)
set an environment variables.
ELEMENTS_API bool getStackLevel(ELEMENTS_UNUSED void *addresses, ELEMENTS_UNUSED void *&addr, ELEMENTS_UNUSED std::string &fnc, ELEMENTS_UNUSED std::string &lib)
ELEMENTS_API unsigned long unloadDynamicLib(ImageHandle handle)
unload dynamic link library
ELEMENTS_API int backTrace(ELEMENTS_UNUSED std::shared_ptr< void * > addresses, ELEMENTS_UNUSED const int depth)
ELEMENTS_API std::vector< std::string > getEnv()
get all environment variables
void * ImageHandle
Definition of an image handle.
const std::string SHLIB_VAR_NAME
name of the shared dynamic library path
ELEMENTS_API unsigned long getLastError()
Get last system known error.
ELEMENTS_API const std::string & osName()
OS name.
ELEMENTS_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
ELEMENTS_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
ELEMENTS_API int unSetEnv(const std::string &name)
Simple wrap around unsetenv for strings.
ELEMENTS_API unsigned long getProcedureByName(ImageHandle handle, const std::string &name, EntryPoint *pFunction)
Get a specific function defined in the DLL.
void * ProcessHandle
Definition of the process handle.
ELEMENTS_API const std::string & osVersion()
OS version.
ELEMENTS_API const std::string getLastErrorString()
Get last system error as string.
ELEMENTS_API const std::string & machineType()
Machine type.
const std::string LIB_PREFIX
constant that represent the common prefix of the libraries
void *(*)() Creator
Definition of the "generic" DLL entry point function.
const std::string LIB_EXTENSION
constant that represent the common extension of the libraries
ELEMENTS_API const std::string & hostName()
Host name.