ModuleManager class.
More...
#include <ModuleManager.h>
ModuleManager class.
This is a class to manage for loading and unloading modules.
- Since
- 0.4.0
typedef void(* RTC::ModuleManager::ModuleInitFunc) (Manager *) |
Constructor.
Constructor. Initialize based on information in the set Property object.
- Parameters
-
prop | Properties for initialization |
RTC::ModuleManager::~ModuleManager |
( |
void |
| ) |
|
void RTC::ModuleManager::addLoadpath |
( |
const std::vector< std::string > & |
load_path | ) |
|
Add the module load path.
Add specified path list to search path list.
- Returns
- load_path List of additional module search path
Referenced by getLoadPath().
void RTC::ModuleManager::addNewFile |
( |
const std::string & |
fpath, |
|
|
coil::vstring & |
modules |
|
) |
| |
|
protected |
void RTC::ModuleManager::allowAbsolutePath |
( |
| ) |
|
|
inline |
Allow absolute path when specify module path.
Set to allow the absolute path when specify the module for the load.
References m_absoluteAllowed.
void RTC::ModuleManager::allowModuleDownload |
( |
| ) |
|
|
inline |
Allow URL when specify module path.
Allow URL when specify module for the load. When this setup is allowed, downloading and loading the module will be allowed.
References m_downloadAllowed.
void RTC::ModuleManager::disallowAbsolutePath |
( |
| ) |
|
|
inline |
Disallow absolute path when specify module path.
Set to disallow the absolute path when specify the module for the load.
References m_absoluteAllowed.
void RTC::ModuleManager::disallowModuleDownload |
( |
| ) |
|
|
inline |
bool RTC::ModuleManager::fileExist |
( |
const std::string & |
filename | ) |
|
Check whether the file exists.
Check whether the specified file exists.
- Parameters
-
filename | Name of file existence for checking |
- Returns
- File existence result(File existence:true, Else:false)
Referenced by disallowModuleDownload().
std::string RTC::ModuleManager::findFile |
( |
const std::string & |
fname, |
|
|
const std::vector< std::string > & |
load_path |
|
) |
| |
Search the file from the LoadPath.
Check whether the specified file exists in the specified path.
- Parameters
-
fname | Target file name of the search |
load_path | Path list for the search |
- Returns
- File name that was found
Referenced by disallowModuleDownload().
std::string RTC::ModuleManager::getInitFuncName |
( |
const std::string & |
file_path | ) |
|
Create initialization function symbol.
Assemble names of the initialization functions.
- Parameters
-
file_path | Name of module for initialization |
- Returns
- Assembly result of initialization function name
Referenced by disallowModuleDownload().
Get the loadable module list.
Get the loadable module list (not implemented).
- Returns
- Loadable module list
Referenced by getLoadPath().
Get the module list that has been loaded.
Get the module list that has been loaded.
- Returns
- List of module that has been loaded
Referenced by getLoadPath().
std::vector<std::string> RTC::ModuleManager::getLoadPath |
( |
| ) |
|
|
inline |
void RTC::ModuleManager::getModuleList |
( |
const std::string & |
lang, |
|
|
coil::vstring & |
modules |
|
) |
| |
|
protected |
void RTC::ModuleManager::getModuleProfiles |
( |
const std::string & |
lang, |
|
|
const coil::vstring & |
modules, |
|
|
vProperties & |
modprops |
|
) |
| |
|
protected |
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
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
void RTC::ModuleManager::removeInvalidModules |
( |
| ) |
|
|
protected |
void RTC::ModuleManager::setLoadpath |
( |
const std::vector< std::string > & |
load_path | ) |
|
Set the module load path.
Specify searching path to find the target module when loading module.
- Parameters
-
load_path | List of module search path |
Refer to the symbol of the module.
void RTC::ModuleManager::unload |
( |
const std::string & |
file_name | ) |
|
Unload the module.
Close and unload the specified module that has been loaded.
- Parameters
-
file_name | Name of module for the unloading |
void RTC::ModuleManager::unloadAll |
( |
| ) |
|
Unload all modules.
Unload all modules that have been loaded.
bool RTC::ModuleManager::m_absoluteAllowed |
|
protected |
bool RTC::ModuleManager::m_downloadAllowed |
|
protected |
std::string RTC::ModuleManager::m_initFuncPrefix |
|
protected |
Initial execution function prefix.
std::string RTC::ModuleManager::m_initFuncSuffix |
|
protected |
Initial execution function suffix.
vProperties RTC::ModuleManager::m_modprofs |
|
protected |
Module list that has already loaded.
Logger RTC::ModuleManager::rtclog |
|
protected |
The documentation for this class was generated from the following file: