]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/base.h
Somehow this return got removed, should fix "Access denied by configuration" crash
[user/henk/code/inspircd.git] / include / base.h
index bc096b85bdd9e54ee629df5e94c245638f048d5e..8d8f7b96cf5d6997c9e4a04f563b19c30a0f74f2 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -36,8 +36,6 @@ class CoreExport classbase
 
        /**
         * Called just prior to destruction via cull list.
-        *
-        * @return true to allow the delete, or false to halt the delete
         */
        virtual CullResult cull();
        virtual ~classbase();
@@ -93,6 +91,8 @@ class CoreExport refcountbase
 
 /** Base class for use count tracking. Uses reference<>, but does not
  * cause object deletion when the last user is removed.
+ *
+ * Safe for use as a second parent class; will not add a second vtable.
  */
 class CoreExport usecountbase
 {
@@ -150,14 +150,13 @@ class reference
  */
 class CoreExport CoreException : public std::exception
 {
- protected:
+ public:
        /** Holds the error message to be displayed
         */
        const std::string err;
        /** Source of the exception
         */
        const std::string source;
- public:
        /** Default constructor, just uses the error mesage 'Core threw an exception'.
         */
        CoreException() : err("Core threw an exception"), source("The core") {}
@@ -197,4 +196,33 @@ class CoreExport ModuleException : public CoreException
 
 typedef const reference<Module> ModuleRef;
 
+enum ServiceType {
+       /** is a Command */
+       SERVICE_COMMAND,
+       /** is a ModeHandler */
+       SERVICE_MODE,
+       /** is a metadata descriptor */
+       SERVICE_METADATA,
+       /** is a data processing provider (MD5, SQL) */
+       SERVICE_DATA,
+       /** is an I/O hook provider (SSL) */
+       SERVICE_IOHOOK
+};
+
+/** A structure defining something that a module can provide */
+class CoreExport ServiceProvider : public classbase
+{
+ public:
+       /** Module that is providing this service */
+       ModuleRef creator;
+       /** Name of the service being provided */
+       const std::string name;
+       /** Type of service (must match object type) */
+       const ServiceType service;
+       ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type)
+               : creator(Creator), name(Name), service(Type) {}
+       virtual ~ServiceProvider();
+};
+
+
 #endif