PLCnext API Documentation 25.0.2.69
Public Member Functions | Protected Member Functions | List of all members
Arp::System::Commons::Extensibility::ModuleLibraryBase< TModuleInterface > Class Template Reference

Base class for a library providing extension modules More...

#include <ModuleLibraryBase.hxx>

Public Member Functions

const ModuleFactory< TModuleInterface > & GetFactory () const
 Returns a const reference to the ModuleFactory More...
 

Protected Member Functions

 ModuleLibraryBase ()=default
 Constructs an ModuleLibraryBase instance.
 
 ModuleLibraryBase (const ModuleLibraryBase &arg)=default
 Copy constructor.
 
 ModuleLibraryBase (ModuleLibraryBase &&arg) noexcept=default
 Move constructor.
 
ModuleLibraryBaseoperator= (const ModuleLibraryBase &arg)=default
 Copy-assignment operator.
 
ModuleLibraryBaseoperator= (ModuleLibraryBase &&arg) noexcept=default
 Move-assignment operator.
 
virtual ~ModuleLibraryBase (void) noexcept=default
 Destructs this instance and frees all resources.
 
ModuleFactory< TModuleInterface > & GetFactory ()
 Returns a non-const reference to the ModuleFactory More...
 

Detailed Description

template<typename TModuleInterface>
class Arp::System::Commons::Extensibility::ModuleLibraryBase< TModuleInterface >

Base class for a library providing extension modules

Template Parameters
TModuleInterfaceType of the base class for the modules

This class is used as the starting point for the module infrastructure to create module implementations.

The library must provide a function that creates an object of a derived class and returns a reference to that object. The library object is intended to be a singleton and using a static class instance in the called function is preferred.

extern "C" ARP_CXX_SYMBOL_EXPORT const SomeModuleLibraryBase& CreateModuleLibrary()
{
static SomeSomeModuleLibrary instance;
return instance;
}

Member Function Documentation

◆ GetFactory() [1/2]

template<typename TModuleInterface >
ModuleFactory< TModuleInterface > & Arp::System::Commons::Extensibility::ModuleLibraryBase< TModuleInterface >::GetFactory
protected

Returns a non-const reference to the ModuleFactory

Use this function to register factory functions for modules.

◆ GetFactory() [2/2]

template<typename TModuleInterface >
const ModuleFactory< TModuleInterface > & Arp::System::Commons::Extensibility::ModuleLibraryBase< TModuleInterface >::GetFactory

Returns a const reference to the ModuleFactory

Use this function to create modules.


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