Drag[en]gine Game Engine  1.21
deBaseModule Class Reference

Base Module Class. More...

#include <deBaseModule.h>

Inheritance diagram for deBaseModule:
deBaseAIModule deBaseAnimationModule deBaseAnimatorModule deBaseArchiveModule deBaseAudioModule deBaseCrashRecoveryModule deBaseFontModule deBaseGraphicModule deBaseImageModule deBaseInputModule deBaseLanguagePackModule deBaseModelModule deBaseNetworkModule deBaseOcclusionMeshModule deBasePhysicsModule deBaseRigModule deBaseScriptingModule deBaseSkinModule deBaseSoundModule deBaseSynthesizerModule deBaseVRModule deBaseVideoModule

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 &parameter) 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
deEngineGetGameEngine () const
 Game engine object. More...
 
deLoadableModuleGetLoadableModule () const
 Loadable module. More...
 
deOSGetOS () const
 OS from game engine. More...
 
deVirtualFileSystemGetVFS () const
 Module virtual file system. More...
 
decString GetNativePathShare () const
 Native path to read only shares directory. More...
 

Error Tracing

deErrorTracePointSetErrorTrace (const char *error, const char *sourceFunc, int sourceLine)
 Add trace point and sets the error if the trace is empty. More...
 
deErrorTracePointSetErrorTrace (const deException &exception)
 Add trace point and sets the error if the trace is empty. More...
 
deErrorTracePointAddErrorTracePoint (const char *sourceFunc, int sourceLine)
 Add trace point to the engine error trace with an empty error. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ deBaseModule()

deBaseModule::deBaseModule ( deLoadableModule loadableModule)

Create base module.

◆ ~deBaseModule()

virtual deBaseModule::~deBaseModule ( )
virtual

Clean up base module.

Member Function Documentation

◆ AddErrorTracePoint()

deErrorTracePoint* deBaseModule::AddErrorTracePoint ( const char *  sourceFunc,
int  sourceLine 
)

Add trace point to the engine error trace with an empty error.

Parameters
[in]sourceFuncName of the source file where the error occurred.
[in]sourceLineThe line number where the error occurred.

◆ GetGameEngine()

deEngine* deBaseModule::GetGameEngine ( ) const

Game engine object.

◆ GetLoadableModule()

deLoadableModule& deBaseModule::GetLoadableModule ( ) const

Loadable module.

◆ GetNativePathShare()

decString deBaseModule::GetNativePathShare ( ) const

Native path to read only shares directory.

Version
1.6

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.

◆ GetOS()

deOS* deBaseModule::GetOS ( ) const

OS from game engine.

◆ GetParameterBool()

bool deBaseModule::GetParameterBool ( const char *  name) const

Boolean value of named parameter.

◆ GetParameterCount()

virtual int deBaseModule::GetParameterCount ( ) const
virtual

Number of parameters.

◆ GetParameterFloat()

float deBaseModule::GetParameterFloat ( const char *  name) const

Numeric value of named parameter.

◆ GetParameterInfo()

virtual void deBaseModule::GetParameterInfo ( int  index,
deModuleParameter parameter 
) const
virtual

Get information about parameter.

Parameters
[in]indexIndex of the parameter
[in]parameterObject to fill with information about the parameter

◆ GetParameterInt()

int deBaseModule::GetParameterInt ( const char *  name) const

Numeric value of named parameter.

◆ GetParameterValue()

virtual decString deBaseModule::GetParameterValue ( const char *  name) const
virtual

Value of named parameter.

◆ GetVFS()

deVirtualFileSystem& deBaseModule::GetVFS ( ) const
inline

Module virtual file system.

The following directories are available:

/config
Directory containing module configuration. The directory is writeable. This is an overlayed directory. A writeable version is layered ontop of a read-only version containing the module default files. This allows to directly write to configuration keeping the default configuration intact in case a user needs to look at it.
/share
Directory containing shared module data. This directory is read-only. Place in this directory all data you need for running the module that never changes.
/capture
Directory containing module output data. This directory is writeable. This directory is used to hold debug output of modules that are written to file. Developer can retrieve and later examine this data while the engine not running or not anymore.
/cache/global
Global cache directory for storing cached information related to the operation of the module in general which is not application specific. The stored files are kept across restarting the application. If the disk consumption grows old files are automatically removed without asking first to keep the size limit.
/cache/local
Local cache directory for storing cached information that is application specific. The stored files are kept across restarting the application. If the disk consumption grows old files are automatically removed without asking first to keep the size limit.

◆ IndexOfParameterNamed()

virtual int deBaseModule::IndexOfParameterNamed ( const char *  name) const
virtual

Index of named parameter or -1 if not found.

◆ LogError()

void deBaseModule::LogError ( const char *  message)

Output error message on console.

◆ LogErrorFormat()

void deBaseModule::LogErrorFormat ( const char *  message,
  ... 
)

Output formated error message on console.

◆ LogErrorFormatUsing()

void deBaseModule::LogErrorFormatUsing ( const char *  message,
va_list  args 
)

Output formated error message on console.

◆ LogException()

void deBaseModule::LogException ( const deException exception)

Output exception as error message on console.

◆ LogInfo()

void deBaseModule::LogInfo ( const char *  message)

Output information message on console.

◆ LogInfoFormat()

void deBaseModule::LogInfoFormat ( const char *  message,
  ... 
)

Output formated information message on console.

◆ LogInfoFormatUsing()

void deBaseModule::LogInfoFormatUsing ( const char *  message,
va_list  args 
)

Output formated information message on console.

◆ LogWarn()

void deBaseModule::LogWarn ( const char *  message)

Output warning message on console.

◆ LogWarnFormat()

void deBaseModule::LogWarnFormat ( const char *  message,
  ... 
)

Output formated warning message on console.

◆ LogWarnFormatUsing()

void deBaseModule::LogWarnFormatUsing ( const char *  message,
va_list  args 
)

Output formated warning message on console.

◆ PauseParallelProcessingUpdate()

virtual void deBaseModule::PauseParallelProcessingUpdate ( )
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.

◆ SendCommand()

virtual void deBaseModule::SendCommand ( const decUnicodeArgumentList command,
decUnicodeString answer 
)
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.

Parameters
[in]commandThe command to send to the module as a list of arguments.
[out]answerUnicode string to hold the answer returned from the module.

◆ SetErrorTrace() [1/2]

deErrorTracePoint* deBaseModule::SetErrorTrace ( const char *  error,
const char *  sourceFunc,
int  sourceLine 
)

Add trace point and sets the error if the trace is empty.

Parameters
[in]errorShort description of the error preferably of a single line.
[in]sourceFuncName of the source file where the error occurred.
[in]sourceLineThe line number where the error occurred.
Returns
Created trace point or NULL if an error occurred.

◆ SetErrorTrace() [2/2]

deErrorTracePoint* deBaseModule::SetErrorTrace ( const deException exception)

Add trace point and sets the error if the trace is empty.

Parameters
[in]exceptionException to use as source for the error information.
Returns
Created trace point or NULL if an error occurred.

◆ SetParameterBool()

void deBaseModule::SetParameterBool ( const char *  name,
bool  value 
)

Set boolean value of named parameter.

◆ SetParameterFloat()

void deBaseModule::SetParameterFloat ( const char *  name,
float  value 
)

Set numeric value of named parameter.

◆ SetParameterInt()

void deBaseModule::SetParameterInt ( const char *  name,
int  value 
)

Set numeric value of named parameter.

◆ SetParameterValue()

virtual void deBaseModule::SetParameterValue ( const char *  name,
const char *  value 
)
virtual

Set value of named parameter.


The documentation for this class was generated from the following file: