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

DLLFactoryBase Class Reference

This class is a specialized form of DLLManager designed to load InspIRCd modules. More...

#include <dynamic.h>

Inheritance diagram for DLLFactoryBase:

Inheritance graph
[legend]
Collaboration diagram for DLLFactoryBase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DLLFactoryBase (InspIRCd *Instance, const char *fname, const char *func_name=0)
 Default constructor.
virtual ~DLLFactoryBase ()
 Default destructor.

Public Attributes

void *(* factory_func )(void)
 A function pointer to the factory function.

Detailed Description

This class is a specialized form of DLLManager designed to load InspIRCd modules.

It's job is to call the init_module function and receive a factory pointer.

Definition at line 72 of file dynamic.h.


Constructor & Destructor Documentation

DLLFactoryBase::DLLFactoryBase InspIRCd Instance,
const char *  fname,
const char *  func_name = 0
 

Default constructor.

This constructor loads a module file by calling its DLLManager subclass constructor, then finds the symbol using DLLManager::GetSymbol(), and calls the symbol, obtaining a valid pointer to the init_module function

Definition at line 68 of file dynamic.cpp.

References factory_func, DLLManager::GetSymbol(), and DLLManager::LastError().

00068                                                                                         : DLLManager(Instance, fname)
00069 {
00070         /* try get the factory function if there is no error yet */
00071         factory_func = 0;
00072         
00073         if (!LastError())
00074         {
00075                 if (!GetSymbol( (void **)&factory_func, symbol ? symbol : "init_module"))
00076                 {
00077                         throw ModuleException("Missing init_module() entrypoint!");
00078                 }
00079         }
00080 }

DLLFactoryBase::~DLLFactoryBase  )  [virtual]
 

Default destructor.

Definition at line 82 of file dynamic.cpp.

00083 {
00084 }


Member Data Documentation

void*(* DLLFactoryBase::factory_func)(void)
 

A function pointer to the factory function.

Referenced by DLLFactory< T >::DLLFactory(), and DLLFactoryBase().


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