-template <class T> class DLLFactory : public DLLFactoryBase
-{
- public:
- DLLFactory(InspIRCd* Instance, const char *fname, const char *func_name=0) : DLLFactoryBase(Instance, fname, func_name)
- {
- if (factory_func)
- factory = reinterpret_cast<T*>(factory_func());
- else
- factory = reinterpret_cast<T*>(-1);
- }
-
- ~DLLFactory()
+ /** Unloads the module if one was loaded. */
+ ~DLLManager();
+
+ /** Attempts to create a new module instance from this shared library.
+ * @return Either a new instance of the Module class or NULL on error.
+ */
+ Module* CallInit();
+
+ /** Retrieves the value of the specified symbol.
+ * @param name The name of the symbol to retrieve.
+ * @return Either the value of the specified symbol or or NULL if it does not exist.
+ */
+ void* GetSymbol(const char* name) const;
+
+ /** Retrieves the value of the specified symbol and casts it to the requested type.
+ * @param name The name of the symbol to retrieve.
+ * @return Either the value of the specified symbol or or NULL if it does not exist.
+ */
+ template <typename TReturn>
+ TReturn* GetSymbol(const char* name) const