Drag[en]gine Game Engine
1.21
|
Base Module Class. More...
#include <deBaseModule.h>
Public Member Functions | |
Constructors and Destructors | |
deBaseModule (deLoadableModule &loadableModule) | |
Create base module. More... | |
virtual | ~deBaseModule () |
Clean up base module. More... | |
Parameters | |
virtual int | GetParameterCount () const |
Number of parameters. More... | |
virtual void | GetParameterInfo (int index, deModuleParameter ¶meter) const |
Get information about parameter. More... | |
virtual int | IndexOfParameterNamed (const char *name) const |
Index of named parameter or -1 if not found. More... | |
virtual decString | GetParameterValue (const char *name) const |
Value of named parameter. More... | |
int | GetParameterInt (const char *name) const |
Numeric value of named parameter. More... | |
float | GetParameterFloat (const char *name) const |
Numeric value of named parameter. More... | |
bool | GetParameterBool (const char *name) const |
Boolean value of named parameter. More... | |
virtual void | SetParameterValue (const char *name, const char *value) |
Set value of named parameter. More... | |
void | SetParameterFloat (const char *name, float value) |
Set numeric value of named parameter. More... | |
void | SetParameterInt (const char *name, int value) |
Set numeric value of named parameter. More... | |
void | SetParameterBool (const char *name, bool value) |
Set boolean value of named parameter. More... | |
Parallel Processing | |
virtual void | PauseParallelProcessingUpdate () |
Parallel processing is pausing and threads are still running. More... | |
Debugging | |
virtual void | SendCommand (const decUnicodeArgumentList &command, decUnicodeString &answer) |
Sends a command to the module and retrieves an answer from it. More... | |
void | LogInfo (const char *message) |
Output information message on console. More... | |
void | LogInfoFormat (const char *message,...) |
Output formated information message on console. More... | |
void | LogInfoFormatUsing (const char *message, va_list args) |
Output formated information message on console. More... | |
void | LogWarn (const char *message) |
Output warning message on console. More... | |
void | LogWarnFormat (const char *message,...) |
Output formated warning message on console. More... | |
void | LogWarnFormatUsing (const char *message, va_list args) |
Output formated warning message on console. More... | |
void | LogError (const char *message) |
Output error message on console. More... | |
void | LogErrorFormat (const char *message,...) |
Output formated error message on console. More... | |
void | LogErrorFormatUsing (const char *message, va_list args) |
Output formated error message on console. More... | |
void | LogException (const deException &exception) |
Output exception as error message on console. More... | |
Accessors | |
deEngine * | GetGameEngine () const |
Game engine object. More... | |
deLoadableModule & | GetLoadableModule () const |
Loadable module. More... | |
deOS * | GetOS () const |
OS from game engine. More... | |
deVirtualFileSystem & | GetVFS () const |
Module virtual file system. More... | |
decString | GetNativePathShare () const |
Native path to read only shares directory. More... | |
Error Tracing | |
deErrorTracePoint * | SetErrorTrace (const char *error, const char *sourceFunc, int sourceLine) |
Add trace point and sets the error if the trace is empty. More... | |
deErrorTracePoint * | SetErrorTrace (const deException &exception) |
Add trace point and sets the error if the trace is empty. More... | |
deErrorTracePoint * | AddErrorTracePoint (const char *sourceFunc, int sourceLine) |
Add trace point to the engine error trace with an empty error. More... | |
Base Module Class.
Modules are the basic building stone of the entire engine. Each system has at least one module providing specilized functionality in the given set of tasks. Each module can be customized with the use of module parameters. Each parameter is a decimal value which can have though different meanings. The parameter information object describes what values are acceptable by a certain parameter. This allows GUI scripts to provide appropriate input widgets to let the user alter the values. Parameters are required to be error safe. If a certain value is not accepted it has to be converted to the nearest feasible one.
deBaseModule::deBaseModule | ( | deLoadableModule & | loadableModule | ) |
Create base module.
|
virtual |
Clean up base module.
deErrorTracePoint* deBaseModule::AddErrorTracePoint | ( | const char * | sourceFunc, |
int | sourceLine | ||
) |
Add trace point to the engine error trace with an empty error.
[in] | sourceFunc | Name of the source file where the error occurred. |
[in] | sourceLine | The line number where the error occurred. |
deEngine* deBaseModule::GetGameEngine | ( | ) | const |
Game engine object.
deLoadableModule& deBaseModule::GetLoadableModule | ( | ) | const |
Loadable module.
decString deBaseModule::GetNativePathShare | ( | ) | const |
Native path to read only shares directory.
Always use "/shared" directory inside GetVFS(). This path is provided only for certain libraries requiring absolute native path. If the shared directory is not physically present on a hard disk this call returns empty string.
deOS* deBaseModule::GetOS | ( | ) | const |
OS from game engine.
bool deBaseModule::GetParameterBool | ( | const char * | name | ) | const |
Boolean value of named parameter.
|
virtual |
Number of parameters.
float deBaseModule::GetParameterFloat | ( | const char * | name | ) | const |
Numeric value of named parameter.
|
virtual |
Get information about parameter.
[in] | index | Index of the parameter |
[in] | parameter | Object to fill with information about the parameter |
int deBaseModule::GetParameterInt | ( | const char * | name | ) | const |
Numeric value of named parameter.
|
virtual |
Value of named parameter.
|
inline |
Module virtual file system.
The following directories are available:
|
virtual |
Index of named parameter or -1 if not found.
void deBaseModule::LogError | ( | const char * | message | ) |
Output error message on console.
void deBaseModule::LogErrorFormat | ( | const char * | message, |
... | |||
) |
Output formated error message on console.
void deBaseModule::LogErrorFormatUsing | ( | const char * | message, |
va_list | args | ||
) |
Output formated error message on console.
void deBaseModule::LogException | ( | const deException & | exception | ) |
Output exception as error message on console.
void deBaseModule::LogInfo | ( | const char * | message | ) |
Output information message on console.
void deBaseModule::LogInfoFormat | ( | const char * | message, |
... | |||
) |
Output formated information message on console.
void deBaseModule::LogInfoFormatUsing | ( | const char * | message, |
va_list | args | ||
) |
Output formated information message on console.
void deBaseModule::LogWarn | ( | const char * | message | ) |
Output warning message on console.
void deBaseModule::LogWarnFormat | ( | const char * | message, |
... | |||
) |
Output formated warning message on console.
void deBaseModule::LogWarnFormatUsing | ( | const char * | message, |
va_list | args | ||
) |
Output formated warning message on console.
|
virtual |
Parallel processing is pausing and threads are still running.
If module has special processing which potentially blocks threads from finishing running it is given the chances to finish these processings now. This method is called for all modules repeatedly until all threads successfully finished.
The default implementation does nothing.
|
virtual |
Sends a command to the module and retrieves an answer from it.
At least the 'help' command has to be understood answering a list of possible commands. The command is provided in the 'command' parameter and the answer has to be written into 'answer'. The default implementation simply answers only to help with itself.
[in] | command | The command to send to the module as a list of arguments. |
[out] | answer | Unicode string to hold the answer returned from the module. |
deErrorTracePoint* deBaseModule::SetErrorTrace | ( | const char * | error, |
const char * | sourceFunc, | ||
int | sourceLine | ||
) |
Add trace point and sets the error if the trace is empty.
[in] | error | Short description of the error preferably of a single line. |
[in] | sourceFunc | Name of the source file where the error occurred. |
[in] | sourceLine | The line number where the error occurred. |
deErrorTracePoint* deBaseModule::SetErrorTrace | ( | const deException & | exception | ) |
Add trace point and sets the error if the trace is empty.
[in] | exception | Exception to use as source for the error information. |
void deBaseModule::SetParameterBool | ( | const char * | name, |
bool | value | ||
) |
Set boolean value of named parameter.
void deBaseModule::SetParameterFloat | ( | const char * | name, |
float | value | ||
) |
Set numeric value of named parameter.
void deBaseModule::SetParameterInt | ( | const char * | name, |
int | value | ||
) |
Set numeric value of named parameter.
|
virtual |
Set value of named parameter.