PLCnext API Documentation  22.9.0.33
SharedLibrary.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 
9 // forwards
10 namespace Arp { namespace System { namespace Ve
11 {
12 class ISharedLibraryService;
13 }}}
14 
15 namespace Arp { namespace System { namespace Commons { namespace Runtime
16 {
17 
20 {
21 public: // construction/destruction
22 
25 
27  SharedLibrary(const SharedLibrary& arg) = delete;
28 
30  SharedLibrary& operator=(const SharedLibrary& arg) = delete;
31 
33  virtual ~SharedLibrary(void);
34 
35 public: // operations
36 
44  void Load(const String& path);
45 
49  void Unload(void);
50 
56  void* GetFunctionAddress(const String& symbolName);
57 
58 public: // static operations
59  static String GetArpLibrariesDirectory(void);
60 
64  static String GetFormattedPath(const String& path);
65 
70  static bool ProbeLibrary(const String& path, String& probedPath);
71 
72 private: // fields
73  Arp::System::Ve::ISharedLibraryService* pSharedLibraryService;
74 
75 };
76 
78 // inline methods of class SharedLibrary
79 
80 }}}} // end of namesapce Arp::System::Commons::Runtime
High level API to enable work with dynamically loadable shared libraries.
Definition: SharedLibrary.hpp:20
void Load(const String &path)
Loads the specified shared library.
static String GetFormattedPath(const String &path)
Formats the path depending on OS.
SharedLibrary(const SharedLibrary &arg)=delete
Copy contructor.
void * GetFunctionAddress(const String &symbolName)
Returns the address where specified symbol is located in the memory.
SharedLibrary & operator=(const SharedLibrary &arg)=delete
Assignment operator.
SharedLibrary(void)
Constructs an SharedLibrary instance.
virtual ~SharedLibrary(void)
Destructs this instance and frees all resouces.
void Unload(void)
Unloads the shared library.
static bool ProbeLibrary(const String &path, String &probedPath)
Probes the library
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API