My Project
Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CPluginLoader Class Reference

a DLL/so plug-in loaded explicitly at runtime. More...

#include <PluginLoader.hpp>

Public Member Functions

 CPluginLoader (const char *filename=NULL)
 the dll to load, it does not load it immediately. More...
 
bool IsValid ()
 whether the plugin loaded is valid. More...
 
const char * GetDLLFilePath ()
 
ClassDescriptorGetClassDescriptor (int i)
 The plugin must provide the system with a way to retrieve the Class Descriptors defined by the plugin. More...
 
const char * GetLibDescription ()
 When a plugin file is loaded that contains an entity that the system does not have access to (i.e. More...
 
int GetNumberOfClasses ()
 return the number of plugin classes inside the DLL
 
void Init (const char *sFilename)
 init the asset entity object. More...
 
void UnLoad ()
 Free the library. More...
 
int Activate (int nType=0, void *pVoid=NULL)
 Activate the DLL. More...
 

Static Public Member Functions

static void * LoadLibraryS (const char *pcDllname, int iMode=2)
 
static void * GetProcAddressS (void *Lib, const char *Fnname)
 
static bool FreeLibraryS (void *hDLL)
 

Detailed Description

a DLL/so plug-in loaded explicitly at runtime.

This is a header only file.

Constructor & Destructor Documentation

§ CPluginLoader()

ParaEngine::CPluginLoader::CPluginLoader ( const char *  filename = NULL)
inline

the dll to load, it does not load it immediately.

Member Function Documentation

§ Activate()

int ParaEngine::CPluginLoader::Activate ( int  nType = 0,
void *  pVoid = NULL 
)
inline

Activate the DLL.

Parameters
nTypetype of the activation
See also
PluginActivationType
Parameters
pVoidany data associated with the type
Returns
: E_FAIL if not succeeded.

§ GetClassDescriptor()

ClassDescriptor* ParaEngine::CPluginLoader::GetClassDescriptor ( int  i)
inline

The plugin must provide the system with a way to retrieve the Class Descriptors defined by the plugin.

Class descriptors provide the system with information about the plugin classes in the DLL. The function LibClassDesc(i) allows the system to access the class descriptors. A DLL may have several class descriptors, one for each plugin class. The function should return a pointer to the 'i-th' class descriptor.

§ GetDLLFilePath()

const char* ParaEngine::CPluginLoader::GetDLLFilePath ( )
inline
Returns
dll file path. this is the same as the asset entity key.

§ GetLibDescription()

const char* ParaEngine::CPluginLoader::GetLibDescription ( )
inline

When a plugin file is loaded that contains an entity that the system does not have access to (i.e.

the DLL is not available), a message is presented to the user. The system requires that each DLL return a text string to present to the user if it is unavailable.

Returns
return the dll description string.

§ Init()

void ParaEngine::CPluginLoader::Init ( const char *  sFilename)
inline

init the asset entity object.

Parameters
sFilename: dll file path

§ IsValid()

bool ParaEngine::CPluginLoader::IsValid ( )
inline

whether the plugin loaded is valid.

§ UnLoad()

void ParaEngine::CPluginLoader::UnLoad ( )
inline

Free the library.


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