#include <manager.h>
Public Types | |
typedef std::list< Module * > | list_type |
Type of the list of modules. | |
enum | { errSuccess = 0, errOpen = 1, errLookup = 2, errUnavailable = 3, errConfig = 4, errLoad = 5, errCore = 6, errNonZeroRefs = 7, errStop = 8 } |
Possible error codes for the error_code() function. More... | |
Public Member Functions | |
ModManager (Core &core, ConfModuleA const &confmodule) | |
Constructor. | |
~ModManager () | |
Destructor. | |
void | broadcast (int state, Module &sender, int msg, void *arg) |
Sends a notification message to all modules in load order. | |
void | broadcast_reverse (int state, Module &sender, int msg, void *arg) |
Sends a notification message to all modules in reverse load order. | |
Module * | find (std::string const &name) |
Finds a loaded module by name. | |
Module * | find (std::string const &name, int state) |
Finds a module by name and state. | |
bool | load (std::string const &name) |
Loads a module. | |
bool | load (LoadModule const &lm) |
Loads modules as specified by the load-module directive. | |
bool | reload () |
Reloads the configuration for all modules. | |
void | start () |
Starts all modules. | |
void | stop () |
Stops all modules. | |
bool | unload (Module &module) |
Unloads a module. | |
Core & | core () const |
Returns the core. | |
std::string const & | error () const |
Returns a description of the last error that occured. | |
int | error_code () const |
Returns the code of the last error that occured. | |
void | global (conf::ConfGlobalQ &global) |
Sets the ConfGlobalQ object used to configure modules. | |
list_type const & | modules () const |
Returns the list of loaded modules. | |
bool | started () const |
Returns whether the modules manager is started. |
|
|
|
Constructor.
|
|
Calls the Module::notify() function for all modules in a given state, in the order they were loaded, using the given parameters.
|
|
Calls the Module::notify() function for all modules in a given state, in the reverse order they were loaded, using the given parameters.
|
|
Returns a description of the last error that occured, after a failed call to load() or unload().
|
|
Returns the code of the last error that occured, after a failed call to load() or unload().
|
|
Finds a module by name and state.
|
|
Finds a loaded module with the given name.
|
|
Sets the ConfGlobalQ object used to configure modules. This function is for use by the core module only. |
|
Loads modules listed through the given load-module directive.
|
|
Loads a module. A successful load does NOT guarantee that the module is in the Module::msLoaded state yet. Other modules calling this function should wait to get the Module::mnLoaded notification before using the module. The module is started by this function as well, but only if the start() function has already been called by the core.
|
|
Returns the list of loaded modules. The core is NOT in this list.
|
|
Reloads the configuration for all modules. This function is for use by the core module only. |
|
Starts all modules, and sets the module manager to the started state. This function is for use by the core module only.
|
|
Stops all modules. This function is for use by the core module only. |
|
Unloads a module. The module is first stopped if it was started. If it fails, then the module is NOT unloaded. A module can't be unloaded if its reference count is non-zero and you can't unload the core module. Attempting to do so will result in a failure.
|