X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fbase.h;h=8d8f7b96cf5d6997c9e4a04f563b19c30a0f74f2;hb=d3ca6510fa23308481d10da0bb7770d251fb659b;hp=bc096b85bdd9e54ee629df5e94c245638f048d5e;hpb=fa2cdd0bb89330cfd9a6c49c4705da2a3cb02834;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/base.h b/include/base.h index bc096b85b..8d8f7b96c 100644 --- a/include/base.h +++ b/include/base.h @@ -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 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