GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
Loads a Shared Object library.
The be moved, but not copied. When the object is destroyed, the library is closed. The caller is responsible for keeping the object alive while symbols from the object are being used.
Definition at line 13 of file DynamicLibrary.h.
Public Member Functions | |
DynamicLibrary (const DynamicLibrary &)=delete | |
DynamicLibrary (DynamicLibrary &&other) noexcept | |
DynamicLibrary (std::string libname_param, bool unique_name=false) | |
~DynamicLibrary () | |
void * | GetSymbol (const char *symbol) |
DynamicLibrary & | operator= (const DynamicLibrary &)=delete |
DynamicLibrary & | operator= (DynamicLibrary &&other) noexcept |
Private Member Functions | |
void | swap (DynamicLibrary &other) |
Private Attributes | |
std::string | fLibName |
void * | fLibrary |
std::string | fTempName |
|
explicit |
Loads a shared object library.
libname_param | Path to the library to be loaded. |
unique_name | Generates a uniquely named symlink to the file, which is then opened. |
dlopen/dlclose maintains a reference count, caching shared objects in case a library is loaded multiple times. However, if a library is going to change as the program runs, then this caching works against us. In this case, "unique_name" should be set to true.
Definition at line 27 of file DynamicLibrary.cxx.
References fLibName, fLibrary, fTempName, and full_path().
DynamicLibrary::~DynamicLibrary | ( | ) |
Destructs the shared object library.
Closes the shared object library. All symbols from the shared object library become invalid. The caller is responsible for keeping the DynamicLibrary alive, while symbols from the library are in use.
Definition at line 54 of file DynamicLibrary.cxx.
|
noexcept |
Move constructor.
Definition at line 64 of file DynamicLibrary.cxx.
|
delete |
void * DynamicLibrary::GetSymbol | ( | const char * | symbol | ) |
Extracts a symbol from the shared library.
Definition at line 82 of file DynamicLibrary.cxx.
References dlsym, and fLibrary.
Referenced by TGRSIOptions::FileAutoDetect().
|
delete |
|
noexcept |
Move assignment operator.
Definition at line 69 of file DynamicLibrary.cxx.
|
private |
Definition at line 75 of file DynamicLibrary.cxx.
|
private |
Definition at line 61 of file DynamicLibrary.h.
Referenced by DynamicLibrary(), and swap().
|
private |
Definition at line 60 of file DynamicLibrary.h.
Referenced by DynamicLibrary(), ~DynamicLibrary(), GetSymbol(), and swap().
|
private |
Definition at line 62 of file DynamicLibrary.h.
Referenced by DynamicLibrary(), ~DynamicLibrary(), and swap().