PLCnext API Documentation 23.6.0.37
Public Member Functions | Static Public Member Functions | List of all members
Arp::System::Commons::Runtime::SharedLibrary Class Reference

High level API to enable work with dynamically loadable shared libraries. More...

#include <SharedLibrary.hpp>

Public Member Functions

 SharedLibrary (void)
 Constructs an SharedLibrary instance.
 
 SharedLibrary (const SharedLibrary &arg)=delete
 Copy contructor.
 
SharedLibraryoperator= (const SharedLibrary &arg)=delete
 Assignment operator.
 
virtual ~SharedLibrary (void)
 Destructs this instance and frees all resouces.
 
void Load (const String &path)
 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...
 

Detailed Description

High level API to enable work with dynamically loadable shared libraries.

Member Function Documentation

◆ GetFormattedPath()

static String Arp::System::Commons::Runtime::SharedLibrary::GetFormattedPath ( const String path)
static

Formats the path depending on OS.

Parameters
pathPath that shall be formatted.
Returns
Formatted path.

◆ GetFunctionAddress()

void * Arp::System::Commons::Runtime::SharedLibrary::GetFunctionAddress ( const String symbolName)

Returns the address where specified symbol is located in the memory.

Parameters
symbolNameName of queried symbol.
Returns
Valid memory address on success, NULL if symbol could not be found.

◆ Load()

void Arp::System::Commons::Runtime::SharedLibrary::Load ( const String path)

Loads the specified shared library.

Symbols exposed by the shared library are globally available after a successfull load.

Parameters
pathThe complete path to the library to load.
Exceptions
Arp::Exceptionif the library could not be loaded.

◆ ProbeLibrary()

static bool Arp::System::Commons::Runtime::SharedLibrary::ProbeLibrary ( const String path,
String probedPath 
)
static

Probes the library

Parameters
pathPath to library
probedPathProbed path to library
Returns
true, if library could be probed. Otherwise false.

◆ Unload()

void Arp::System::Commons::Runtime::SharedLibrary::Unload ( void  )

Unloads the shared library.

Exceptions
Arp::Exceptionin case the unload fails.

The documentation for this class was generated from the following file: