PixelLightAPI  .
Public Member Functions
PLCore::DynLib Class Reference

Dynamic library (aka "shared library") class. More...

#include <DynLib.h>

List of all members.

Public Member Functions

PLCORE_API DynLib ()
 Constructor.
PLCORE_API ~DynLib ()
 Destructor.
bool Load (const String &sPath)
 Loads a dynamic library.
bool IsLoaded () const
 Returns if the dynamic library has been loaded.
String GetPath () const
 Get the path (set within 'Load()') to the dynamic library.
String GetAbsPath () const
 Get the absolute path to the dynamic library.
void * GetSymbol (const String &sSymbol) const
 Returns a pointer to a symbol in the library.
bool Unload ()
 Unloads the dynamic library.

Detailed Description

Dynamic library (aka "shared library") class.

Note:
  • Implementation of the bridge design pattern, this class is the abstraction

Constructor & Destructor Documentation

PLCORE_API PLCore::DynLib::DynLib ( )
PLCORE_API PLCore::DynLib::~DynLib ( )

Destructor.

Note:
  • The dynamic library is unloaded automatically

Member Function Documentation

bool PLCore::DynLib::Load ( const String sPath) [inline]

Loads a dynamic library.

Parameters:
[in]sPathPath to the dynamic library
Returns:
'true' if the library could be loaded, else 'false'
Note:
  • Dependent dynamic libraries are first searched within the same path as the given one
  • If the library has already been loaded, this function will fail
bool PLCore::DynLib::IsLoaded ( ) const [inline]

Returns if the dynamic library has been loaded.

Returns:
'true' if loaded, else 'false'
String PLCore::DynLib::GetPath ( ) const [inline]

Get the path (set within 'Load()') to the dynamic library.

Returns:
The path to the dynamic library (e.g. "file://C:/PixelLight/Runtime/x86/PLCore.dll" on Windows)
String PLCore::DynLib::GetAbsPath ( ) const [inline]

Get the absolute path to the dynamic library.

Returns:
The absolute path to the dynamic library (native path style, e.g. "C:\PixelLight\Runtime\x86\PLCore.dll" on Windows)
void * PLCore::DynLib::GetSymbol ( const String sSymbol) const [inline]

Returns a pointer to a symbol in the library.

Parameters:
[in]sSymbolName of the symbol to retrieve
Returns:
Pointer to the symbol, or a null pointer on error
Note:
  • The pointer to the symbol only stays valid as long as this dynamic library instance is not unloaded
bool PLCore::DynLib::Unload ( ) [inline]

Unloads the dynamic library.

Returns:
'true' if the library could be unloaded, else false

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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:28
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported