|
PLCnext API Documentation 25.0.2.69
|
High level API to enable work with dynamically loadable shared libraries. More...
#include <SharedLibrary.hpp>
Public Types | |
| using | SymbolNames = std::vector< String > |
Public Member Functions | |
| SharedLibrary (void) | |
| Constructs an SharedLibrary instance. | |
| SharedLibrary (const SharedLibrary &arg)=delete | |
| Copy contructor. | |
| SharedLibrary & | operator= (const SharedLibrary &arg)=delete |
| Assignment operator. | |
| ~SharedLibrary (void) | |
| Destructs this instance and frees all resouces. | |
| SymbolNames | GetExportedFunctionNames (const String &path) const |
| Loads the specified shared library. More... | |
| void | Load (const String &path, SharedLibraryMemoryLockOption sharedLibraryMemoryLockOption=SharedLibraryMemoryLockOption::Nothing) |
| Loads the specified shared library. More... | |
| bool | TryLoad (const String &path, SharedLibraryMemoryLockOption sharedLibraryMemoryLockOption=SharedLibraryMemoryLockOption::Nothing) |
| Loads the specified shared library. More... | |
| void | Unload (void) |
| Unloads the shared library. More... | |
| void * | GetFunctionAddress (const String &symbolName) |
| Returns the address where specified symbol is located in the memory. More... | |
Static Public Member Functions | |
| static String | GetArpLibrariesDirectory (void) |
| static String | GetFormattedPath (const String &path) |
| Formats the path depending on OS. More... | |
| static bool | ProbeLibrary (const String &path, String &probedPath) |
| Probes the library More... | |
High level API to enable work with dynamically loadable shared libraries.
| SharedLibrary::SymbolNames Arp::System::Commons::Runtime::SharedLibrary::GetExportedFunctionNames | ( | const String & | path | ) | const |
Loads the specified shared library.
Symbols exposed by the shared library are globally available after a successfull load.
| path | The complete path to the library to load. |
| Arp::Exception | if the library could not be loaded. |
Formats the path depending on OS.
| path | Path that shall be formatted. |
| void * Arp::System::Commons::Runtime::SharedLibrary::GetFunctionAddress | ( | const String & | symbolName | ) |
Returns the address where specified symbol is located in the memory.
| symbolName | Name of queried symbol. |
| void Arp::System::Commons::Runtime::SharedLibrary::Load | ( | const String & | path, |
| SharedLibraryMemoryLockOption | sharedLibraryMemoryLockOption = SharedLibraryMemoryLockOption::Nothing |
||
| ) |
Loads the specified shared library.
Symbols exposed by the shared library are globally available after a successfull load.
| path | The complete path to the library to load. |
| sharedLibraryMemoryLockOption | Optionally option to lock memory of shared library. If not set, then is set SharedLibraryMemoryLockOption::Nothing. |
| Arp::Exception | if the library could not be loaded. |
|
static |
Probes the library
| path | Path to library |
| probedPath | Probed path to library |
| bool Arp::System::Commons::Runtime::SharedLibrary::TryLoad | ( | const String & | path, |
| SharedLibraryMemoryLockOption | sharedLibraryMemoryLockOption = SharedLibraryMemoryLockOption::Nothing |
||
| ) |
Loads the specified shared library.
Symbols exposed by the shared library are globally available after a successfull load.
| path | The complete path to the library to load. |
| sharedLibraryMemoryLockOption | Optionally option to lock memory of shared library. If not set, then is set SharedLibraryMemoryLockOption::Nothing. |
true on success, otherwise false.| void Arp::System::Commons::Runtime::SharedLibrary::Unload | ( | void | ) |
Unloads the shared library.
| Arp::Exception | in case the unload fails. |