Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CDynLib Class Reference

Resource holding data about a dynamic library. More...

`#include <KeosDynLib.h>`

List of all members.

## Public Member Functions

| CDynLib (const String &strName)
| Default constructor - used by DynLibManager.
| ~CDynLib ()
| Default destructor.
void | Load ()
| Load the library.
void | Unload ()
| Unload the library.
const String & | GetName (void) const
| Get the name of the library.
void * | GetSymbol (const String &strName) const throw ()
| Returns the address of the given symbol from the loaded library.

## Protected Member Functions

String | DynlibError (void)
| Return error information in library loading.

## Protected Attributes

String | m_strName
| Name of the library.
DYNLIB_HANDLE | m_hInst
| Handle to the loaded library.

## Detailed Description

Resource holding data about a dynamic library.

This class holds the data required to get symbols from libraries loaded at run-time (i.e. from DLL's for so's).

Definition at line 44 of file KeosDynLib.h.

## Constructor & Destructor Documentation

Keos::CDynLib::CDynLib | ( | const String & | strName | ) |

| Default constructor - used by DynLibManager.

Warning:
  Do not call directly.

Parameters:

  | strName | Name of the library.

Definition at line 38 of file KeosDynLib.cpp.

References m_hInst, and m_strName.

Keos::CDynLib::~CDynLib | ( |  | ) |

| Default destructor. Definition at line 45 of file KeosDynLib.cpp.

## Member Function Documentation

String Keos::CDynLib::DynlibError | ( | void |  | ) | `[protected]`

| Return error information in library loading.

Returns:
  Error information.

Definition at line 92 of file KeosDynLib.cpp.

Referenced by Load(), and Unload().

const String& Keos::CDynLib::GetName | ( | void |  | ) | const`[inline]`

| Get the name of the library.

Returns:
  The name of the library.

Definition at line 77 of file KeosDynLib.h.

void * Keos::CDynLib::GetSymbol | ( | const String & | strName | ) | const throw ()

| Returns the address of the given symbol from the loaded library.

Parameters:

  | strName | The name of the symbol to search for.

Returns:
  If the function succeeds, the returned value is a handle to the symbol, if the function fails, the returned value is NULL.

Definition at line 86 of file KeosDynLib.cpp.

References m_hInst.

Referenced by Keos::CPlatformManager::CPlatformManager(), Keos::CRoot::LoadPlugin(), and Keos::CRoot::UnloadPlugins().

void Keos::CDynLib::Load | ( |  | ) |

| Load the library. Definition at line 50 of file KeosDynLib.cpp. References DYNLIB_EXCEPT, DynlibError(), m_hInst, and m_strName. Referenced by Keos::CDynLibManager::Load().

void Keos::CDynLib::Unload | ( |  | ) |

| Unload the library. Definition at line 72 of file KeosDynLib.cpp. References DYNLIB_EXCEPT, DynlibError(), m_hInst, and m_strName. Referenced by Keos::CDynLibManager::Unload(), Keos::CRoot::UnloadPlugins(), and Keos::CDynLibManager::~CDynLibManager().

## Member Data Documentation

DYNLIB_HANDLE Keos::CDynLib::m_hInst`[protected]`

| Handle to the loaded library. Definition at line 91 of file KeosDynLib.h. Referenced by CDynLib(), GetSymbol(), Load(), and Unload().

String Keos::CDynLib::m_strName`[protected]`

| Name of the library. Definition at line 48 of file KeosDynLib.h. Referenced by CDynLib(), Load(), and Unload().

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

- KeosEngine/KeosDynLib.h
- KeosEngine/KeosDynLib.cpp