PLCnext API Documentation
22.9.0.33
|
Factory class for extension modules More...
#include <ModuleFactory.hxx>
Public Types | |
using | ModuleInterfacePtr = std::unique_ptr< TModuleInterface > |
using | FactoryFunction = std::function< ModuleInterfacePtr()> |
using | FactoryFunctions = std::vector< std::pair< String, FactoryFunction > > |
Public Member Functions | |
ModuleFactory (void)=default | |
Constructs an ModuleFactory instance. More... | |
ModuleFactory (const ModuleFactory &arg)=default | |
Copy constructor. More... | |
ModuleFactory (ModuleFactory &&arg) noexcept=default | |
Move constructor. More... | |
ModuleFactory & | operator= (const ModuleFactory &arg)=default |
Copy-assignment operator. More... | |
ModuleFactory & | operator= (ModuleFactory &&arg) noexcept=default |
Move-assignment operator. More... | |
virtual | ~ModuleFactory (void) noexcept=default |
Destructs this instance and frees all resources. More... | |
ModuleInterfacePtr | Create (const String &moduleName) const |
Creates a module instance More... | |
std::vector< String > | GetModuleNames () const |
Returns all known module names More... | |
void | AddFactoryFunction (const String &moduleName, FactoryFunction function) |
Adds a factory function More... | |
Factory class for extension modules
TModuleInterface | Type of the base class for the modules |
This class is used as an internal factory used by the ModuleLibraryBase.
|
default |
Constructs an ModuleFactory instance.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
virtualdefaultnoexcept |
Destructs this instance and frees all resources.
void Arp::System::Commons::Extensibility::ModuleFactory< TModuleInterface >::AddFactoryFunction | ( | const String & | moduleName, |
FactoryFunction | function | ||
) |
Adds a factory function
moduleName | Name of the module, typically the common type name |
function | Function pointer to the factory function |
Throws an exception if the name is already present.
ModuleFactory< TModuleInterface >::ModuleInterfacePtr Arp::System::Commons::Extensibility::ModuleFactory< TModuleInterface >::Create | ( | const String & | moduleName | ) | const |
Creates a module instance
moduleName | Name of the module, typically the common type name |
std::vector< String > Arp::System::Commons::Extensibility::ModuleFactory< TModuleInterface >::GetModuleNames |
Returns all known module names
|
default |
Copy-assignment operator.
|
defaultnoexcept |
Move-assignment operator.