Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

ps
Class DllLoader

   in DllLoader.h
   in DllLoader.cpp

class DllLoader


Field Summary
private void* m_Handle
          
private const char* m_Name
          
 
Constructor Summary
DllLoader( const char* name )
          Prepare the DLL loader.
~DllLoader()
          
 
Method Summary
 bool IsLoaded() const
          Check whether the library has been loaded successfully.
 bool LoadDLL()
          Attempt to load and initialise the library, if not already.
 void LoadSymbol( const char* name, T& fptr ) const
          Attempt to load a named symbol from the library.
private void LoadSymbolInternal( const char* name, void** fptr ) const
          
 void Unload()
          Unload the library, if it has been loaded already.
 

Field Detail

m_Handle

private void* m_Handle;

m_Name

private const char* m_Name;


Constructor Detail

DllLoader

public DllLoader( const char* name );
Prepare the DLL loader. Does no actual work.
Parameters:
name - base name of the library (from which we'll derive "name.dll", "libname_dbg.so", etc). Pointer must remain valid for this object's lifetime (which is fine if you just use a string literal).

~DllLoader

public ~DllLoader();


Method Detail

IsLoaded

public bool IsLoaded() const;
Check whether the library has been loaded successfully. Returns false before LoadDLL has been called; otherwise returns the same as LoadDLL did.

LoadDLL

public bool LoadDLL();
Attempt to load and initialise the library, if not already. Can be harmlessly called multiple times. Returns false if unsuccessful.

LoadSymbol

public void LoadSymbol( const char* name, T& fptr ) const;
Attempt to load a named symbol from the library. If IsLoaded is false, throws PSERROR_DllLoader_DllNotLoaded. If it cannot load the symbol, throws PSERROR_DllLoader_SymbolNotFound. In both cases, sets fptr to NULL. Otherwise, fptr is set to point to the loaded function.
Throws:
PSERROR_DllLoader

LoadSymbolInternal

private void LoadSymbolInternal( const char* name, void** fptr ) const;

Unload

public void Unload();
Unload the library, if it has been loaded already. (Usually not needed, since the destructor will unload it.)

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD