Fawkes API
Fawkes Development Version
|
Dynamic module manager. More...
#include <>>
Public Member Functions | |
ModuleManager (const char *module_base_dir, Module::ModuleFlags open_flags=Module::MODULE_FLAGS_DEFAULT) | |
Constructor of NetworkManagerTemplate. More... | |
virtual | ~ModuleManager () |
Destructor. More... | |
virtual Module * | open_module (const char *filename) |
Open a module. More... | |
virtual void | close_module (Module *module) |
Close a module by Module instance. More... | |
virtual void | close_module (const char *filename) |
Close a module by filename. More... | |
virtual bool | module_opened (const char *filename) |
Check if the module is already opened. More... | |
virtual Module * | get_module (const char *filename) |
Get a module if opened. More... | |
virtual const char * | get_module_file_extension () |
Get the file extension for the current module type. More... | |
void | set_open_flags (Module::ModuleFlags open_flags) |
Set flags to open modules with. More... | |
Dynamic module manager.
Manager to load and unload modules, keeps track of loaded modules and does not reload modules if they are already loaded.
Definition at line 40 of file module_manager.h.
fawkes::ModuleManager::ModuleManager | ( | const char * | module_base_dir, |
Module::ModuleFlags | open_flags = Module::MODULE_FLAGS_DEFAULT |
||
) |
Constructor of NetworkManagerTemplate.
module_base_dir | The module basedir where to look for plugins |
open_flags | flags to pass to modules when opening them |
Definition at line 45 of file module_manager.cpp.
|
virtual |
Destructor.
Definition at line 55 of file module_manager.cpp.
|
virtual |
Close a module by Module instance.
module | The module that is to be closed |
Definition at line 117 of file module_manager.cpp.
References fawkes::Module::get_base_filename().
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance().
|
virtual |
Close a module by filename.
filename | the name of the module file that should be closed, this is compared to loaded modules and must match what Module::GetBaseFilename() returns |
Definition at line 129 of file module_manager.cpp.
References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().
|
virtual |
Get a module if opened.
This will return a pointer to a module if it had already been opened! The reference count is increased and you have to manually unref the module once you are done with it! This method works similar to open_module() with the difference that it is not tried to load the module if it is not open.
filename | file name of the module |
Definition at line 153 of file module_manager.cpp.
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance().
|
virtual |
Get the file extension for the current module type.
Definition at line 183 of file module_manager.cpp.
References fawkes::Module::get_file_extension().
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance(), and fawkes::BlackBoardInstanceFactory::new_interface_instance().
|
virtual |
Check if the module is already opened.
filename | the name of the module file to check if it is opened. It is compared to loaded modules and must match what Module::get_base_filename() returns |
Definition at line 172 of file module_manager.cpp.
|
virtual |
Open a module.
filename | The file name of the module that should be opened. If the ModuleManager implementation takes a base dir argument (recommended) this filename is relative to that base dir |
ModuleOpenException | thrown if the module could not be opened |
Definition at line 87 of file module_manager.cpp.
References fawkes::Module::get_base_filename(), fawkes::Mutex::lock(), fawkes::Module::open(), and fawkes::Mutex::unlock().
Referenced by fawkes::BlackBoardInstanceFactory::new_interface_instance().
void fawkes::ModuleManager::set_open_flags | ( | Module::ModuleFlags | open_flags | ) |
Set flags to open modules with.
open_flags | flags to pass to modules when opening them |
Definition at line 70 of file module_manager.cpp.
Referenced by fawkes::PluginManager::PluginManager(), and fawkes::PluginManager::set_module_flags().