DynamicModule

class kanzi::connect::DynamicModule

Class responsible of loading modules dynamically from shared libraries.

Public Static Functions

Module *loadModule(const string modulename, uint32_t majorVersion, uint32_t minorVersion)

Loads and constructs a module from specific file.

Return

newly allocated module instance or nullptr in case loading failed. NOTE: It is not possible to unload modules so everything loaded remains in memory.

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.

vector<string> lookupModules()

Searches for module from the current working directory.

Return

vector of filenames pointing to potential modules.

string serviceNameFromModuleFilename(string moduleFilename)

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”

Return

service name if able to resolve it. empty string if unable to do the task.

Parameters
  • moduleFilename: the module filename to be analyzed.