InspIRCd  4.0
Public Member Functions | List of all members
DLLManager Class Reference

#include <dynamic.h>

Inheritance diagram for DLLManager:
Cullable insp::uncopiable

Public Member Functions

 DLLManager (const std::string &name)
 
 ~DLLManager ()
 
ModuleCallInit ()
 
void * GetSymbol (const char *name) const
 
template<typename TReturn >
TReturn * GetSymbol (const char *name) const
 
const char * GetVersion () const
 
const std::string & LastError () const
 
const std::string & LibraryName () const
 
- Public Member Functions inherited from Cullable
virtual ~Cullable ()
 
virtual Result Cull ()
 

Additional Inherited Members

- Protected Member Functions inherited from Cullable
 Cullable ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ DLLManager()

DLLManager::DLLManager ( const std::string &  name)

Attempts to load the specified module.

Parameters
nameThe name of the library to load.

◆ ~DLLManager()

DLLManager::~DLLManager ( )

Unloads the module if one was loaded.

Member Function Documentation

◆ CallInit()

Module * DLLManager::CallInit ( )

Attempts to create a new module instance from this shared library.

Returns
Either a new instance of the Module class or NULL on error.

◆ GetSymbol() [1/2]

void * DLLManager::GetSymbol ( const char *  name) const

Retrieves the value of the specified symbol.

Parameters
nameThe name of the symbol to retrieve.
Returns
Either the value of the specified symbol or or NULL if it does not exist.

◆ GetSymbol() [2/2]

template<typename TReturn >
TReturn* DLLManager::GetSymbol ( const char *  name) const
inline

Retrieves the value of the specified symbol and casts it to the requested type.

Parameters
nameThe name of the symbol to retrieve.
Returns
Either the value of the specified symbol or or NULL if it does not exist.

◆ GetVersion()

const char* DLLManager::GetVersion ( ) const
inline

Retrieves the module version from the dynamic library.

◆ LastError()

const std::string& DLLManager::LastError ( ) const
inline

Retrieves the last error which occurred or an empty string if no errors have occurred.

◆ LibraryName()

const std::string& DLLManager::LibraryName ( ) const
inline

Retrieves the filename of the underlying shared library.


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