Drag[en]gine Game Engine  1.0
deLibraryModule Class Reference

Loadable Module. More...

#include <deLibraryModule.h>

Inheritance diagram for deLibraryModule:
deLoadableModule

Public Types

enum  eErrorCodes {
  eecLibFileNotFound = 10, eecLibFileNotRegularFile, eecLibFileSizeMismatch, eecLibFileCheckSumMismatch,
  eecLibFileOpenFailed, eecLibFileEntryPointNotFound, eecLibFileCreateModuleFailed
}
 Error Codes. More...
 
- Public Types inherited from deLoadableModule
enum  eErrorCodes { eecSuccess, eecCreateModuleFailed }
 Error Codes. More...
 

Public Member Functions

Constructors and Destructors
 deLibraryModule (deModuleSystem *system, const char *xmlDefFilename)
 Creates a new library module. More...
 
virtual ~deLibraryModule ()
 Cleans up the loadable module. More...
 
Management
const decStringGetLibFileName () const
 Retrieves the filename of the library file. More...
 
int GetLibFileSize () const
 Retrieves the required size in bytes of the library file. More...
 
const decStringGetLibFileHash () const
 Retrieves the required hash code of the library file. More...
 
const decStringGetLibFileEntryPoint () const
 Retrieves the name of the entry point function in the library file. More...
 
Module Management
virtual void LoadModule ()
 Loads the module from the appropriate source. Sets the error code in both the case of success and failure and stored the module for later retrieval. More...
 
virtual void UnloadModule ()
 Unloads the module. Sets the module to NULL and clears the error code. More...
 
Type Testing and Safe Casting
virtual bool IsLibraryModule () const
 Determines if this is a library loaded module. More...
 
virtual deLibraryModuleCastToLibraryModule ()
 Cast to a library loaded rule. More...
 
Visiting
virtual void Visit (deLoadableModuleVisitor *visitor)
 Visits the rule. More...
 
- Public Member Functions inherited from deLoadableModule
 deLoadableModule (deModuleSystem *system)
 Creates a new loadable module. More...
 
virtual ~deLoadableModule ()
 Cleans up the loadable module. More...
 
deModuleSystemGetSystem () const
 Retrieves the linked module system. More...
 
const decStringGetLoggingName () const
 Retrieves the name to use as the source for this module for logging. More...
 
void SetLoggingName (const char *name)
 Sets the name to use as the source for this module for logging. More...
 
void SetDefaultLoggingName ()
 Sets the default logging name which is "Module &lt;module-name&gt;". More...
 
const decStringGetName () const
 Retrieves the unique name of the module. More...
 
void SetName (const char *name)
 Sets the unique name of the module. More...
 
deModuleSystem::eModuleTypes GetType () const
 Retrieves the type of the module. More...
 
void SetType (deModuleSystem::eModuleTypes type)
 Sets the type of the module. More...
 
const decString GetDescription () const
 Retrieves the description of the module. More...
 
void SetDescription (const char *description)
 Sets the description of the module. More...
 
const decStringGetAuthor () const
 Retrieves the author of the module. More...
 
void SetAuthor (const char *author)
 Sets the author of the module. More...
 
const decStringGetVersion () const
 Retrieves the version of the module. More...
 
void SetVersion (const char *version)
 Sets the version of the module. More...
 
decStringListGetPatternList ()
 Retrieves the file pattern list recognized by this module if a multiple type module. More...
 
const decStringListGetPatternList () const
 
const decStringGetDefaultExtension () const
 Retrieves the default extension to be used for saving files if this is a multiple type module. More...
 
void SetDefaultExtension (const char *extension)
 Sets the default extension to be used for saving files if this is a multiple type module. More...
 
const decStringGetDirectoryName () const
 Retrieves the directory name for this module. More...
 
void SetDirectoryName (const char *dirName)
 Sets the directory name for this module. More...
 
bool GetIsFallback () const
 
void SetIsFallback (bool fallback)
 
bool GetEnabled () const
 Determines if the module is enabled. More...
 
void SetEnabled (bool enabled)
 Sets if the module is enabled. More...
 
deBaseModuleGetModule () const
 Retrieves the module if loaded or NULL. More...
 
void SetModule (deBaseModule *module)
 Sets the module if loaded of NULL. More...
 
bool IsLoaded () const
 Determines if the module is loaded and working. More...
 
int GetErrorCode () const
 Retrieves the error code from the last load attempt. More...
 
void SetErrorCode (int code)
 Sets the error code. More...
 
bool IsLocked () const
 Determines if the module is locked. More...
 
virtual void Lock ()
 Locks the module and increases the lock counter. More...
 
virtual void Unlock ()
 Decreases the lock counter and unlocks the module if the counter reaches 0. More...
 
int GetRefCount () const
 Retrieves the reference count. More...
 
void AddReference ()
 Adds a reference by increasing the reference counter by 1. More...
 
void FreeReference ()
 Decreases the reference counter by 1 and frees the module if the counter reaches 0. More...
 
virtual bool IsInternalModule () const
 Determines if this is an internal module. More...
 
virtual deInternalModuleCastToInternalModule ()
 Cast to an internal module. More...
 

Detailed Description

Loadable Module.

Wraps an engine module loadable from a library file. Retrieves the informations from an XML module definition file. Supports loading of modules from libraries on unix and windows systems.

Author
Pl├╝ss Roland
Version
1.0
Date
2014

Member Enumeration Documentation

◆ eErrorCodes

Error Codes.

Enumerator
eecLibFileNotFound 

Module library file could not be found.

eecLibFileNotRegularFile 

Module library file is not a regular library file.

eecLibFileSizeMismatch 

Size of the module library file does not match the size in the module definitin.

eecLibFileCheckSumMismatch 

Checksum of the module library file does not match the checksum in the module definition.

eecLibFileOpenFailed 

Module library file could not be opened.

eecLibFileEntryPointNotFound 

Entry point function specified in the module definition could not be found in the library file.

eecLibFileCreateModuleFailed 

Creating the module using the entry point function failed.

Constructor & Destructor Documentation

◆ deLibraryModule()

deLibraryModule::deLibraryModule ( deModuleSystem system,
const char *  xmlDefFilename 
)

Creates a new library module.

◆ ~deLibraryModule()

virtual deLibraryModule::~deLibraryModule ( )
virtual

Cleans up the loadable module.

Member Function Documentation

◆ CastToLibraryModule()

virtual deLibraryModule* deLibraryModule::CastToLibraryModule ( )
virtual

Cast to a library loaded rule.

Reimplemented from deLoadableModule.

Referenced by GetLibFileEntryPoint().

◆ GetLibFileEntryPoint()

const decString& deLibraryModule::GetLibFileEntryPoint ( ) const
inline

Retrieves the name of the entry point function in the library file.

References CastToLibraryModule(), IsLibraryModule(), LoadModule(), UnloadModule(), and Visit().

◆ GetLibFileHash()

const decString& deLibraryModule::GetLibFileHash ( ) const
inline

Retrieves the required hash code of the library file.

◆ GetLibFileName()

const decString& deLibraryModule::GetLibFileName ( ) const
inline

Retrieves the filename of the library file.

◆ GetLibFileSize()

int deLibraryModule::GetLibFileSize ( ) const
inline

Retrieves the required size in bytes of the library file.

◆ IsLibraryModule()

virtual bool deLibraryModule::IsLibraryModule ( ) const
virtual

Determines if this is a library loaded module.

Reimplemented from deLoadableModule.

Referenced by GetLibFileEntryPoint().

◆ LoadModule()

virtual void deLibraryModule::LoadModule ( )
virtual

Loads the module from the appropriate source. Sets the error code in both the case of success and failure and stored the module for later retrieval.

Implements deLoadableModule.

Referenced by GetLibFileEntryPoint().

◆ UnloadModule()

virtual void deLibraryModule::UnloadModule ( )
virtual

Unloads the module. Sets the module to NULL and clears the error code.

Implements deLoadableModule.

Referenced by GetLibFileEntryPoint().

◆ Visit()

virtual void deLibraryModule::Visit ( deLoadableModuleVisitor visitor)
virtual

Visits the rule.

Reimplemented from deLoadableModule.

Referenced by GetLibFileEntryPoint().


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