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

DLLFactory< T > Class Template Reference

This is the highest-level class of the DLLFactory system used to load InspIRCd modules. More...

#include <dynamic.h>

Inheritance diagram for DLLFactory< T >:

Inheritance graph
[legend]
Collaboration diagram for DLLFactory< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DLLFactory (InspIRCd *Instance, const char *fname, const char *func_name=0)
 Default constructor.
 ~DLLFactory ()
 The destructor deletes the ModuleFactory pointer.

Public Attributes

T * factory
 The ModuleFactory pointer.

Detailed Description

template<class T>
class DLLFactory< T >

This is the highest-level class of the DLLFactory system used to load InspIRCd modules.

Its job is to finally call the init_module function and obtain a pointer to a ModuleFactory. This template is a container for ModuleFactory itself, so that it may 'plug' into ModuleFactory and provide module loading capabilities transparently.

Definition at line 96 of file dynamic.h.


Constructor & Destructor Documentation

template<class T>
DLLFactory< T >::DLLFactory InspIRCd Instance,
const char *  fname,
const char *  func_name = 0
[inline]
 

Default constructor.

This constructor passes its paramerers down through DLLFactoryBase and then DLLManager to load the module, then calls the factory function to retrieve a pointer to a ModuleFactory class. It is then down to the core to call the ModuleFactory::CreateModule() method and receive a Module* which it can insert into its module lists.

Definition at line 105 of file dynamic.h.

References DLLFactoryBase::factory_func.

00105                                                                                    : DLLFactoryBase(Instance, fname, func_name)
00106         {
00107                 if (factory_func)
00108                         factory = reinterpret_cast<T*>(factory_func());
00109                 else
00110                         factory = reinterpret_cast<T*>(-1);
00111         }

template<class T>
DLLFactory< T >::~DLLFactory  )  [inline]
 

The destructor deletes the ModuleFactory pointer.

Definition at line 115 of file dynamic.h.

00116         {
00117                 if (factory)
00118                         delete factory;
00119         }


Member Data Documentation

template<class T>
T* DLLFactory< T >::factory
 

The ModuleFactory pointer.

Definition at line 123 of file dynamic.h.


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