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 37 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 41 of file module_manager.cpp.
|
virtual |
Destructor.
Definition at line 50 of file module_manager.cpp.
|
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 119 of file module_manager.cpp.
References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().
|
virtual |
Close a module by Module instance.
module | The module that is to be closed |
Definition at line 108 of file module_manager.cpp.
References close_module(), and fawkes::Module::get_base_filename().
Referenced by close_module(), and fawkes::BlackBoardInstanceFactory::delete_interface_instance().
|
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 142 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 170 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 160 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 80 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 64 of file module_manager.cpp.
Referenced by fawkes::PluginManager::PluginManager(), and fawkes::PluginManager::set_module_flags().