ModuleManager class.
More...
#include <ModuleManager.h>
|
| | ModuleManager (coil::Properties &prop) |
| | Constructor.
|
| |
| | ~ModuleManager () |
| | Destructor.
|
| |
| std::string | load (const std::string &file_name) |
| | Load the module.
|
| |
| std::string | load (coil::Properties &prop) |
| | Load the module.
|
| |
| std::string | load (const std::string &file_name, const std::string &init_func) |
| | Load and intialize the module.
|
| |
| std::string | load (coil::Properties &prop, const std::string &init_func) |
| | Load and intialize the module.
|
| |
| void | unload (const std::string &file_name) |
| | Unload the module.
|
| |
| void | unloadAll () |
| | Unload all modules.
|
| |
| void * | symbol (const std::string &file_name, const std::string &func_name) |
| | Refer to the symbol of the module .
|
| |
| void | setLoadpath (const std::vector< std::string > &load_path) |
| | Set the module load path.
|
| |
| std::vector< std::string > | getLoadPath () |
| | Get the module load path.
|
| |
| void | addLoadpath (const std::vector< std::string > &load_path) |
| | Add the module load path.
|
| |
| std::vector< coil::Properties > | getLoadedModules () |
| | Get the module list that has been loaded.
|
| |
| std::vector< coil::Properties > | getLoadableModules () |
| | Get the loadable module list.
|
| |
| void | allowAbsolutePath () |
| | Allow absolute path when specify module path.
|
| |
| void | disallowAbsolutePath () |
| | Disallow absolute path when specify module path.
|
| |
| void | allowModuleDownload () |
| | Allow URL when specify module path.
|
| |
| void | disallowModuleDownload () |
| | Disallow URL when specify module path.
|
| |
| std::string | findFile (const std::string &fname, const std::vector< std::string > &load_path) |
| | Search the file from the LoadPath.
|
| |
| bool | fileExist (const std::string &filename) |
| | Check whether the file exists.
|
| |
| std::string | getInitFuncName (const std::string &file_path) |
| | Create initialization function symbol.
|
| |
|
| void | removeInvalidModules () |
| | Removing incalid module profiles .
|
| |
| void | getModuleList (const std::string &lang, coil::vstring &modules) |
| | Getting loadable file list on the loadpath for given language .
|
| |
| void | addNewFile (const std::string &fpath, coil::vstring &modules, const std::string &lang) |
| | Adding file path not existing cache .
|
| |
| void | getModuleProfiles (const std::string &lang, const coil::vstring &modules, vProperties &modprops) |
| | Getting module properties from given language and file list .
|
| |
ModuleManager class.
This is a class to manage for loading and unloading modules.
- Since
- 0.4.0
◆ DllMap
◆ DllMapConstItr
◆ DllMapItr
◆ ModuleInitFunc
◆ StringVector
◆ StringVectorConstItr
◆ StringVectorItr
◆ ModuleManager()
| RTC::ModuleManager::ModuleManager |
( |
coil::Properties & |
prop | ) |
|
|
explicit |
Constructor.
Constructor. Initialize based on information in the set Property object.
- Parameters
-
| prop | Properties for initialization |
◆ ~ModuleManager()
| RTC::ModuleManager::~ModuleManager |
( |
| ) |
|
◆ addLoadpath()
| void RTC::ModuleManager::addLoadpath |
( |
const std::vector< std::string > & |
load_path | ) |
|
Add the module load path.
◆ addNewFile()
| void RTC::ModuleManager::addNewFile |
( |
const std::string & |
fpath, |
|
|
coil::vstring & |
modules, |
|
|
const std::string & |
lang |
|
) |
| |
|
protected |
Adding file path not existing cache .
◆ allowAbsolutePath()
| void RTC::ModuleManager::allowAbsolutePath |
( |
| ) |
|
|
inline |
◆ allowModuleDownload()
| void RTC::ModuleManager::allowModuleDownload |
( |
| ) |
|
|
inline |
◆ disallowAbsolutePath()
| void RTC::ModuleManager::disallowAbsolutePath |
( |
| ) |
|
|
inline |
◆ disallowModuleDownload()
| void RTC::ModuleManager::disallowModuleDownload |
( |
| ) |
|
|
inline |
◆ fileExist()
| bool RTC::ModuleManager::fileExist |
( |
const std::string & |
filename | ) |
|
Check whether the file exists.
◆ findFile()
| std::string RTC::ModuleManager::findFile |
( |
const std::string & |
fname, |
|
|
const std::vector< std::string > & |
load_path |
|
) |
| |
Search the file from the LoadPath.
◆ getInitFuncName()
| std::string RTC::ModuleManager::getInitFuncName |
( |
const std::string & |
file_path | ) |
|
Create initialization function symbol.
◆ getLoadableModules()
| std::vector< coil::Properties > RTC::ModuleManager::getLoadableModules |
( |
| ) |
|
Get the loadable module list.
◆ getLoadedModules()
| std::vector< coil::Properties > RTC::ModuleManager::getLoadedModules |
( |
| ) |
|
Get the module list that has been loaded.
◆ getLoadPath()
| std::vector< std::string > RTC::ModuleManager::getLoadPath |
( |
| ) |
|
|
inline |
◆ getModuleList()
| void RTC::ModuleManager::getModuleList |
( |
const std::string & |
lang, |
|
|
coil::vstring & |
modules |
|
) |
| |
|
protected |
Getting loadable file list on the loadpath for given language .
◆ getModuleProfiles()
| void RTC::ModuleManager::getModuleProfiles |
( |
const std::string & |
lang, |
|
|
const coil::vstring & |
modules, |
|
|
vProperties & |
modprops |
|
) |
| |
|
protected |
Getting module properties from given language and file list .
◆ load() [1/4]
| std::string RTC::ModuleManager::load |
( |
coil::Properties & |
prop | ) |
|
Load the module.
Load file_name as DLL or a shared liblary. The file_name is specified by the relative path to default load path (manager.modules.load_path).
If Property manager.modules.abs_path_allowed is yes, the load module can be specified by the absolute path.
If Property manager.modules.download_allowed is yes, the load module can be specified with URL.
The module_file_name can be specified by the absolute path. If manager.modules.abs_path_allowed is no, module of file_name will be searched from the default module load path and loaded.
- Parameters
-
| prop | module_file_name: module file name module_file_path: module file path language: programming language |
- Returns
- Name of module for the specified load
◆ load() [2/4]
| std::string RTC::ModuleManager::load |
( |
coil::Properties & |
prop, |
|
|
const std::string & |
init_func |
|
) |
| |
Load and intialize the module.
Load the specified file as DLL or a shared library, and execute operation for specified initialization.
- Parameters
-
| prop | module_file_name: module file name module_file_path: module file path language: programming language |
| init_func | Operation for initialization |
- Returns
- Name of module for the specified load
◆ load() [3/4]
| std::string RTC::ModuleManager::load |
( |
const std::string & |
file_name | ) |
|
Load the module.
Load file_name as DLL or a shared liblary. The file_name is specified by the relative path to default load path (manager.modules.load_path).
If Property manager.modules.abs_path_allowed is yes, the load module can be specified by the absolute path.
If Property manager.modules.download_allowed is yes, the load module can be specified with URL.
The file_name can be specified by the absolute path. If manager.modules.abs_path_allowed is no, module of file_name will be searched from the default module load path and loaded.
- Parameters
-
| file_name | The target module name for the loading |
- Returns
- Name of module for the specified load
◆ load() [4/4]
| std::string RTC::ModuleManager::load |
( |
const std::string & |
file_name, |
|
|
const std::string & |
init_func |
|
) |
| |
Load and intialize the module.
Load the specified file as DLL or a shared library, and execute operation for specified initialization.
- Parameters
-
| file_name | The target module name for the loading |
| init_func | Operation for initialization |
- Returns
- Name of module for the specified load
◆ removeInvalidModules()
| void RTC::ModuleManager::removeInvalidModules |
( |
| ) |
|
|
protected |
Removing incalid module profiles .
◆ setLoadpath()
| void RTC::ModuleManager::setLoadpath |
( |
const std::vector< std::string > & |
load_path | ) |
|
Set the module load path.
◆ symbol()
| void * RTC::ModuleManager::symbol |
( |
const std::string & |
file_name, |
|
|
const std::string & |
func_name |
|
) |
| |
Refer to the symbol of the module .
◆ unload()
| void RTC::ModuleManager::unload |
( |
const std::string & |
file_name | ) |
|
◆ unloadAll()
| void RTC::ModuleManager::unloadAll |
( |
| ) |
|
◆ m_absoluteAllowed
| bool RTC::ModuleManager::m_absoluteAllowed |
|
protected |
◆ m_configPath
Configuration path list .
◆ m_downloadAllowed
| bool RTC::ModuleManager::m_downloadAllowed |
|
protected |
◆ m_initFuncPrefix
| std::string RTC::ModuleManager::m_initFuncPrefix |
|
protected |
Initial execution function prefix .
◆ m_initFuncSuffix
| std::string RTC::ModuleManager::m_initFuncSuffix |
|
protected |
Initial execution function suffix .
◆ m_loadfailmods
| std::map<std::string, coil::vstring> RTC::ModuleManager::m_loadfailmods |
|
protected |
◆ m_loadPath
◆ m_modprofs
| vProperties RTC::ModuleManager::m_modprofs |
|
protected |
◆ m_modules
Module list that has already loaded .
◆ m_properties
| coil::Properties& RTC::ModuleManager::m_properties |
|
protected |
◆ m_supported_languages
| coil::vstring RTC::ModuleManager::m_supported_languages |
|
protected |
◆ rtclog
| Logger RTC::ModuleManager::rtclog |
|
protected |
The documentation for this class was generated from the following file: