Elements  5.12
A C++ base framework for the Euclid Software.
ModuleInfo.h
Go to the documentation of this file.
1 
27 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_MODULEINFO_H_
28 #define ELEMENTSKERNEL_ELEMENTSKERNEL_MODULEINFO_H_
29 
30 // STL include files
31 #include <string>
32 #include <vector>
33 #include <memory>
34 #include <dlfcn.h>
35 
36 // Framework include files
37 #include "ElementsKernel/System.h" // LIB_PREFIX, LIB_EXTENSION
38 #include "ElementsKernel/Path.h" // for Path::Item
39 #include "ElementsKernel/Export.h" // ELEMENTS_API
40 
41 namespace Elements {
42 namespace System {
43 
45 public:
46  ModuleInfo();
47  explicit ModuleInfo(void *);
48  const std::string name() const;
49  const std::string libraryName() const;
50  const void* addresse() const;
51  operator const Dl_info&() const;
52  bool isEmpty() const;
53 private:
55 };
56 
57 enum class ModuleType {
58  UNKNOWN, SHAREDLIB, EXECUTABLE
59 };
60 
84 
85 
86 } // namespace System
87 } // namespace Elements
88 
89 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_MODULEINFO_H_
90 
System.h
This file is intended to iron out all the differences between systems (currently Linux and MacOSX)
Export.h
defines the macros to be used for explicit export of the symbols
std::string
STL class.
Elements::System::setModuleHandle
ELEMENTS_API void setModuleHandle(ImageHandle handle)
Attach module handle.
Definition: ModuleInfo.cpp:149
Path.h
provide functions to retrieve resources pointed by environment variables
Elements::System::moduleName
ELEMENTS_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:95
Elements::Path::Item
boost::filesystem::path Item
Definition: Path.h:61
std::vector< std::string >
Elements::System::ModuleType
ModuleType
Definition: ModuleInfo.h:57
Elements::System::exeHandle
ELEMENTS_API ImageHandle exeHandle()
Handle to the executable file running.
Definition: ModuleInfo.cpp:165
Elements::System::moduleNameFull
ELEMENTS_API const std::string & moduleNameFull()
Get the full name of the (executable/DLL) file.
Definition: ModuleInfo.cpp:107
Elements::System::linkedModules
ELEMENTS_API const std::vector< std::string > linkedModules()
Vector of names of linked modules.
Definition: ModuleInfo.cpp:235
Elements::System::moduleType
ELEMENTS_API ModuleType moduleType()
Get type of the module.
Definition: ModuleInfo.cpp:124
ELEMENTS_API
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::System::ModuleInfo
Definition: ModuleInfo.h:44
Elements::System::processHandle
ELEMENTS_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:143
Elements::System::exeName
ELEMENTS_API const std::string & exeName()
Name of the executable file running.
Definition: ModuleInfo.cpp:185
Elements::System::ModuleInfo::m_dlinfo
std::unique_ptr< Dl_info > m_dlinfo
Definition: ModuleInfo.h:54
Elements::System::moduleHandle
ELEMENTS_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:153
Elements::System::ImageHandle
void * ImageHandle
Definition of an image handle.
Definition: System.h:118
Elements::System::getSelfProc
ELEMENTS_API Path::Item getSelfProc()
Get the path to the /proc directory of the process.
Definition: ModuleInfo.cpp:193
std::unique_ptr< Dl_info >
Elements::System::getExecutablePath
ELEMENTS_API Path::Item getExecutablePath()
Get the full executable path.
Definition: ModuleInfo.cpp:247
Elements::System::ProcessHandle
void * ProcessHandle
Definition of the process handle.
Definition: System.h:120
Elements::System::ModuleType::UNKNOWN
@ UNKNOWN
Elements::System::linkedModulePaths
ELEMENTS_API std::vector< Path::Item > linkedModulePaths()
Definition: ModuleInfo.cpp:209
Elements
Definition: Auxiliary.h:43