|
|
This class holds global information about the engine. Note: this is a singleton class.
int main (int argc, const char **argv, const char **environ)
| main |
[static]
Main entry point to be called directly from a wrapper program
Parameters:
argc | Argument count |
argv | Argument array |
environ | Environment variables |
Returns: Program exit code
int run ()
| run |
Run the engine.
Returns: Error code, 0 for success
Engine * self ()
| self |
[static]
Get a pointer to the unique instance.
Returns: A pointer to the singleton instance of the engine
bool Register (const Plugin *plugin, bool reg = true)
| Register |
[static]
Register or unregister a plugin to the engine.
Parameters:
plugin | A pointer to the plugin to (un)register |
reg | True to register (default), false to unregister |
Returns: True on success, false on failure
inline String configFile (const char *name)
| configFile |
[static]
The configuration directory path
inline String & configPath ()
| configPath |
[static]
The configuration directory path
inline String & modulePath ()
| modulePath |
[static]
The module loading path
inline String & moduleSuffix ()
| moduleSuffix |
[static]
The module suffix
void init ()
| init |
[static]
Reinitialize the plugins
void halt (unsigned int code)
| halt |
[static]
Stop the engine and the entire program
Parameters:
code | Return code of the program |
bool exiting ()
| exiting |
[static]
Check if the engine is currently exiting
Returns: True if exiting, false in normal operation
bool install (MessageHandler *handler)
| install |
[static]
Installs a handler in the dispatcher.
Parameters:
handler | A pointer to the handler to install |
Returns: True on success, false on failure
bool uninstall (MessageHandler *handler)
| uninstall |
[static]
Uninstalls a handler drom the dispatcher.
Parameters:
handler | A pointer to the handler to uninstall |
Returns: True on success, false on failure
bool enqueue (Message *msg)
| enqueue |
[static]
Enqueue a message in the message queue
Parameters:
msg | The message to enqueue, will be destroyed after dispatching |
Returns: True if enqueued, false on error (already queued)
inline bool enqueue (const char *name)
| enqueue |
[static]
Convenience function. Enqueue a new parameterless message in the message queue
Parameters:
name | Name of the parameterless message to put in queue |
Returns: True if enqueued, false on error (already queued)
bool dispatch (Message *msg)
| dispatch |
[static]
Dispatch a message to the registered handlers
Parameters:
msg | Pointer to the message to dispatch |
Returns: True if one handler accepted it, false if all ignored
bool dispatch (Message &msg)
| dispatch |
[static]
Dispatch a message to the registered handlers
Parameters:
msg | The message to dispatch |
Returns: True if one handler accepted it, false if all ignored
bool dispatch (const char *name)
| dispatch |
[static]
Convenience function. Dispatch a parameterless message to the registered handlers
Parameters:
name | The name of the message to create and dispatch |
Returns: True if one handler accepted it, false if all ignored
inline void setHook (void (*hookFunc)(Message &, bool) = 0)
| setHook |
Install or remove a hook to catch messages after being dispatched
Parameters:
hookFunc | Pointer to a callback function |
int usedPlugins ()
| usedPlugins |
Get a count of plugins that are actively in use
Returns: Count of plugins in use
~Engine ()
| ~Engine |
[protected]
Destroys the engine and everything. You must not call it directly, run() will do it for you.
bool loadPlugin (const char *file)
| loadPlugin |
[protected]
Loads one plugin from a shared object file
Returns: True if success, false on failure
void loadPlugins ()
| loadPlugins |
[protected]
Loads the plugins from the plugins directory
void initPlugins ()
| initPlugins |
[protected]
Initialize all registered plugins
Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54. |