The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

DLLManager Class Reference

The DLLManager class is able to load a module file by filename, and locate its init_module symbol. More...

#include <dynamic.h>

Inheritance diagram for DLLManager:

Inheritance graph
[legend]
Collaboration diagram for DLLManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DLLManager (InspIRCd *ServerInstance, const char *fname)
 This constructor loads the module using dlopen().
virtual ~DLLManager ()
bool GetSymbol (void **v, const char *sym_name)
 Get a symbol using dynamic linking.
const char * LastError ()
 Get the last error from dlopen() or dlsym().

Public Attributes

void * h
 The module handle.

Protected Attributes

const char * err
 The last error string, or NULL.

Detailed Description

The DLLManager class is able to load a module file by filename, and locate its init_module symbol.

Definition at line 20 of file dynamic.h.


Constructor & Destructor Documentation

DLLManager::DLLManager InspIRCd ServerInstance,
const char *  fname
 

This constructor loads the module using dlopen().

Parameters:
ServerInstance The creator class of this object
fname The filename to load. This should be within the modules dir.

Definition at line 22 of file dynamic.cpp.

References err, and h.

DLLManager::~DLLManager  )  [virtual]
 

Definition at line 40 of file dynamic.cpp.

References h.


Member Function Documentation

bool DLLManager::GetSymbol void **  v,
const char *  sym_name
 

Get a symbol using dynamic linking.

Parameters:
v A function pointer, pointing at an init_module function
sym_name The symbol name to find, usually "init_module"
Returns:
true if the symbol can be found, also the symbol will be put into v.

Definition at line 49 of file dynamic.cpp.

References err, and h.

Referenced by DLLFactory< ReturnType >::DLLFactory().

const char* DLLManager::LastError  )  [inline]
 

Get the last error from dlopen() or dlsym().

Returns:
The last error string, or NULL if no error has occured.

Definition at line 47 of file dynamic.h.

Referenced by DLLFactory< ReturnType >::DLLFactory().


Member Data Documentation

const char* DLLManager::err [protected]
 

The last error string, or NULL.

Definition at line 26 of file dynamic.h.

Referenced by DLLManager(), and GetSymbol().

void* DLLManager::h
 

The module handle.

This is OS dependent, on POSIX platforms it is a pointer to a function pointer (yes, really!) and on windows it is a library handle.

Definition at line 56 of file dynamic.h.

Referenced by DLLManager(), GetSymbol(), and ~DLLManager().


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