Fawkes API
Fawkes Development Version
|
#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 43 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 47 of file module_manager.cpp.
|
virtual |
Destructor.
Definition at line 56 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 125 of file module_manager.cpp.
|
virtual |
Close a module by Module instance.
module | The module that is to be closed |
Definition at line 114 of file module_manager.cpp.
References fawkes::Mutex::lock().
|
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 148 of file module_manager.cpp.
|
virtual |
Get the file extension for the current module type.
Definition at line 176 of file module_manager.cpp.
|
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 166 of file module_manager.cpp.
References fawkes::Module::get_file_extension().
|
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 86 of file module_manager.cpp.
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.
References fawkes::Mutex::lock(), and fawkes::Mutex::unlock().