PLCnext API Documentation
22.9.0.33
|
Base class for loading a library with modules More...
#include <SharedModuleLibrary.hxx>
Public Types | |
using | ModuleInterfacePtr = std::unique_ptr< TModuleInterface > |
owning pointer to a module More... | |
Public Member Functions | |
SharedModuleLibrary (const String &path) | |
Constructs an SharedModuleLibrary instance. More... | |
SharedModuleLibrary (const SharedModuleLibrary &arg)=delete | |
Copy constructor. More... | |
SharedModuleLibrary (SharedModuleLibrary &&arg)=delete | |
Move constructor. More... | |
SharedModuleLibrary & | operator= (const SharedModuleLibrary &arg)=delete |
Copy-assignment operator. More... | |
SharedModuleLibrary & | operator= (SharedModuleLibrary &&arg)=delete |
Move-assignment operator. More... | |
virtual | ~SharedModuleLibrary (void)=default |
Destructs this instance and frees all resources. More... | |
template<typename TModule > | |
ModuleInterfacePtr | CreateModule () const |
Creates a module by type More... | |
ModuleInterfacePtr | CreateModule (const String &moduleName) const |
Creates a module by name More... | |
const String & | GetFullPath () const |
Returns the full path to the library file More... | |
String | GetFileName () const |
Returns the file name of the library (without directory) More... | |
bool | Exists () const |
Returns true if the library file exists. More... | |
bool | IsLoaded () const |
Returns true if the library is loaded More... | |
void | Load () |
Loads the library More... | |
void | Unload () |
Unload the library More... | |
Protected Member Functions | |
virtual String | GetModuleLibraryFactoryFunctionName () const =0 |
Returns the name of the factory function for the module library More... | |
Base class for loading a library with modules
This class contains code related to the type of the modules to be created. Implement GetModuleLibraryFactoryFunction() to return the name of the factory function of the module library. (see ModuleLibraryBase for an example)
using Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::ModuleInterfacePtr = std::unique_ptr<TModuleInterface> |
owning pointer to a module
|
explicit |
Constructs an SharedModuleLibrary instance.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
virtualdefault |
Destructs this instance and frees all resources.
SharedModuleLibrary< TModuleInterface >::ModuleInterfacePtr Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::CreateModule |
Creates a module by type
TModuleInterface | Type of the module to be created |
This function uses the CommonTypeName of TModule to create the module instance.
SharedModuleLibrary< TModuleInterface >::ModuleInterfacePtr Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::CreateModule | ( | const String & | moduleName | ) | const |
Creates a module by name
param name="moduleName">name of the module to be created
As a convention use the CommonTypeName as the module name.
bool Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::Exists |
Returns true if the library file exists.
String Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::GetFileName |
Returns the file name of the library (without directory)
const String & Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::GetFullPath |
Returns the full path to the library file
|
protectedpure virtual |
Returns the name of the factory function for the module library
see ModuleLibraryBase for an example
bool Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::IsLoaded |
Returns true if the library is loaded
void Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::Load |
Loads the library
When the library is loaded LoadModuleLibraryBase is called to get the factory function of the module library object. That object acts as an entry point to the library.
|
delete |
Copy-assignment operator.
|
delete |
Move-assignment operator.
void Arp::System::Commons::Extensibility::SharedModuleLibrary< TModuleInterface >::Unload | ( | void | ) |
Unload the library