Class responsible of loading modules dynamically from shared libraries.
More...
#include <module_loader.hpp>
|
static Module * | loadModule (const string modulename, uint32_t majorVersion, uint32_t minorVersion) |
| Loads and constructs a module from specific file.
|
|
static vector< string > | lookupModules () |
| Searches for module from the current working directory.
|
|
static string | serviceNameFromModuleFilename (string moduleFilename) |
| Tries to resolve service name from module filename.
|
|
static bool | unloadModule (const string modulename) |
| Unloads a module .
|
|
Class responsible of loading modules dynamically from shared libraries.
◆ loadModule()
static Module * kanzi::connect::DynamicModule::loadModule |
( |
const string | modulename, |
|
|
uint32_t | majorVersion, |
|
|
uint32_t | minorVersion ) |
|
static |
Loads and constructs a module from specific file.
- Parameters
-
modulename | the name of the module from which the library filename is build upon. |
majorVersion | major version of kanzi loading the service. |
minorVersion | minor version of kanzi loading the service. |
- Returns
- newly allocated module instance or nullptr in case loading failed. NOTE: It is not possible to unload modules so everything loaded remains in memory.
◆ lookupModules()
static vector< string > kanzi::connect::DynamicModule::lookupModules |
( |
| ) |
|
|
static |
Searches for module from the current working directory.
- Returns
- vector of filenames pointing to potential modules.
◆ serviceNameFromModuleFilename()
static string kanzi::connect::DynamicModule::serviceNameFromModuleFilename |
( |
string | moduleFilename | ) |
|
|
static |
Tries to resolve service name from module filename.
This function expects the naming to be following "service_cluster_GL_vs2015_Debug.dll" | "libservice_cluster.so"
- Parameters
-
moduleFilename | the module filename to be analyzed. |
- Returns
- service name if able to resolve it. empty string if unable to do the task.
◆ unloadModule()
static bool kanzi::connect::DynamicModule::unloadModule |
( |
const string | modulename | ) |
|
|
static |
Unloads a module .
- Parameters
-
modulename | the name of the module from which the library filename is build upon. return true if moulde is unloaded, otherwise false. |
The documentation for this class was generated from the following file:
- connect/module_loader.hpp