Elements  6.2
A C++ base framework for the Euclid Software.
Namespaces | Macros | Typedefs | Functions | Variables
System.h File Reference

This file is intended to iron out all the differences between systems (currently Linux and MacOSX) More...

#include <climits>
#include <memory>
#include <string>
#include <typeinfo>
#include <vector>
#include "ElementsKernel/Export.h"
#include "ElementsKernel/Unused.h"
Include dependency graph for System.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Elements
 
 Elements::System
 

Macros

#define HOST_NAME_MAX   255
 

Typedefs

using Elements::System::ImageHandle = void *
 Definition of an image handle. More...
 
using Elements::System::ProcessHandle = void *
 Definition of the process handle. More...
 
using Elements::System::EntryPoint = unsigned long(*)(const unsigned long iid, void **ppvObject)
 Definition of the "generic" DLL entry point function. More...
 
using Elements::System::Creator = void *(*)()
 Definition of the "generic" DLL entry point function. More...
 

Functions

ELEMENTS_API unsigned long Elements::System::loadDynamicLib (const std::string &name, ImageHandle *handle)
 Load dynamic link library. More...
 
ELEMENTS_API unsigned long Elements::System::unloadDynamicLib (ImageHandle handle)
 unload dynamic link library More...
 
ELEMENTS_API unsigned long Elements::System::getProcedureByName (ImageHandle handle, const std::string &name, EntryPoint *pFunction)
 Get a specific function defined in the DLL. More...
 
ELEMENTS_API unsigned long Elements::System::getProcedureByName (ImageHandle handle, const std::string &name, Creator *pFunction)
 Get a specific function defined in the DLL. More...
 
ELEMENTS_API unsigned long Elements::System::getLastError ()
 Get last system known error. More...
 
const ELEMENTS_API std::string Elements::System::getLastErrorString ()
 Get last system error as string. More...
 
const ELEMENTS_API std::string Elements::System::getErrorString (unsigned long error)
 Retrieve error code as string for a given error. More...
 
const ELEMENTS_API std::string Elements::System::typeinfoName (const std::type_info &)
 Get platform independent information about the class type. More...
 
const ELEMENTS_API std::string Elements::System::typeinfoName (const char *)
 
const ELEMENTS_API std::stringElements::System::hostName ()
 Host name. More...
 
const ELEMENTS_API std::stringElements::System::osName ()
 OS name. More...
 
const ELEMENTS_API std::stringElements::System::osVersion ()
 OS version. More...
 
const ELEMENTS_API std::stringElements::System::machineType ()
 Machine type. More...
 
ELEMENTS_API std::string Elements::System::getEnv (const std::string &var)
 get a particular environment variable More...
 
ELEMENTS_API bool Elements::System::getEnv (const string &var, string &value)
 get a particular env var, storing the value in the passed string (if set) More...
 
ELEMENTS_API std::vector< std::stringElements::System::getEnv ()
 get all environment variables More...
 
ELEMENTS_API int Elements::System::setEnv (const string &name, const string &value, bool overwrite)
 set an environment variables. More...
 
ELEMENTS_API int Elements::System::unSetEnv (const std::string &name)
 Simple wrap around unsetenv for strings. More...
 
ELEMENTS_API bool Elements::System::isEnvSet (const std::string &var)
 Check if an environment variable is set or not. More...
 
ELEMENTS_API int Elements::System::backTrace (ELEMENTS_UNUSED std::shared_ptr< void * > addresses, ELEMENTS_UNUSED const int depth)
 
const ELEMENTS_API std::vector< std::stringElements::System::backTrace (const int depth, const int offset=0)
 
ELEMENTS_API bool Elements::System::getStackLevel (ELEMENTS_UNUSED void *addresses, ELEMENTS_UNUSED void *&addr, ELEMENTS_UNUSED std::string &fnc, ELEMENTS_UNUSED std::string &lib)
 

Variables

const std::string Elements::System::SHLIB_VAR_NAME {"LD_LIBRARY_PATH"}
 name of the shared dynamic library path More...
 
const std::string Elements::System::LIB_PREFIX {"lib"}
 constant that represent the common prefix of the libraries More...
 
const std::string Elements::System::LIB_EXTENSION {"so"}
 constant that represent the common extension of the libraries More...
 
const std::string Elements::System::LIB_SUFFIX {"." + LIB_EXTENSION}
 constant that represents the standard suffix of the libraries: usually "."+LIB_EXTENSION More...
 
const std::string Elements::System::SHLIB_SUFFIX {LIB_SUFFIX}
 alias for LIB_SUFFIX More...
 
const std::string Elements::System::DEFAULT_INSTALL_PREFIX {"/usr"}
 constant for the canonical installation prefix (on Linux and MacOSX at least) More...
 
const int Elements::System::STACK_OFFSET {2}
 

Detailed Description

This file is intended to iron out all the differences between systems (currently Linux and MacOSX)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

All the compilation system dependent parts (#if, #ifdef etc) should be located in this file. This should clear the need of these entities in all other C++ files.

Definition in file System.h.

Macro Definition Documentation

◆ HOST_NAME_MAX

#define HOST_NAME_MAX   255

Definition at line 103 of file System.h.