fawkes::ModuleManager Class Reference
Manager interface to load and unload modules, keeps track of loaded modules and does not reload modules if they are already loaded. More...
#include <module_manager.h>

Public Member Functions | |
| virtual | ~ModuleManager () |
| Virtual destructor for pure virtual class. | |
| virtual Module * | open_module (const char *filename)=0 |
| Open a module. | |
| virtual void | close_module (Module *module)=0 |
| Close a module by Module instance. | |
| virtual void | close_module (const char *filename)=0 |
| Close a module by filename. | |
| virtual bool | module_opened (const char *filename)=0 |
| Check if the module for the given filename is already opened. | |
| virtual Module * | get_module (const char *filename)=0 |
| Get a module if opened. | |
| virtual const char * | get_module_file_extension ()=0 |
| Get the file extension for the current module type. | |
Detailed Description
Manager interface to load and unload modules, keeps track of loaded modules and does not reload modules if they are already loaded.Definition at line 34 of file module_manager.h.
Constructor & Destructor Documentation
| virtual fawkes::ModuleManager::~ModuleManager | ( | ) | [inline, virtual] |
Member Function Documentation
| virtual void fawkes::ModuleManager::close_module | ( | const char * | filename | ) | [pure virtual] |
Close a module by filename.
- Parameters:
-
filename the name of the module file that should be closed, this is compared to loaded modules and must match what Module::GetBaseFilename() returns
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
| virtual void fawkes::ModuleManager::close_module | ( | Module * | module | ) | [pure virtual] |
Close a module by Module instance.
- Parameters:
-
module The module that is to be closed
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance().
| virtual Module* fawkes::ModuleManager::get_module | ( | const char * | filename | ) | [pure 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.
- Parameters:
-
filename file name of the module
- Returns:
- a pointer to the module with the reference cound incremented by one if the module had been opened already or NULL if it was not opened.
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance().
| virtual const char* fawkes::ModuleManager::get_module_file_extension | ( | ) | [pure virtual] |
Get the file extension for the current module type.
- Returns:
- Returns a string with the file extension that has to be used for modules on the current system (for example "so")
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
Referenced by fawkes::BlackBoardInstanceFactory::delete_interface_instance(), and fawkes::BlackBoardInstanceFactory::new_interface_instance().
| virtual bool fawkes::ModuleManager::module_opened | ( | const char * | filename | ) | [pure virtual] |
Check if the module for the given filename is already opened.
- Parameters:
-
filename the name of the module file to check if it is opened. It is compared to loaded modules and must match what Module::GetBaseFilename() returns
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
| virtual Module* fawkes::ModuleManager::open_module | ( | const char * | filename | ) | [pure virtual] |
Open a module.
- Parameters:
-
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
- Returns:
- Returns the module if the file was opened successfully or NULL otherwise. Do NOT delete the module after usage but use closeModule to close it.
- Exceptions:
-
ModuleOpenException thrown if the module could not be opened
Implemented in fawkes::ModuleManagerTemplate< MODULE_CLASS >.
Referenced by fawkes::BlackBoardInstanceFactory::new_interface_instance().
The documentation for this class was generated from the following file:
- src/libs/utils/system/dynamic_module/module_manager.h

