summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-15 18:26:53 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-15 18:26:53 +0000
commitfb3964d5c007900061e86e392ceb786bd47260c0 (patch)
tree41ff940cce47b6d8ba9aef701205dd0ea6707c6f /include/base.h
parent8ab1381e8d277152d99a72f33f3d1c0564060fee (diff)
Add Inspircd::AddServices
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12135 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/include/base.h b/include/base.h
index bc096b85b..8324d6347 100644
--- a/include/base.h
+++ b/include/base.h
@@ -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
{
@@ -197,4 +197,35 @@ class CoreExport ModuleException : public CoreException
typedef const reference<Module> ModuleRef;
+enum ServiceType {
+ /** is a Command */
+ SERVICE_COMMAND,
+ /** is a channel ModeHandler */
+ SERVICE_CMODE,
+ /** is a user ModeHandler */
+ SERVICE_UMODE,
+ /** 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 providerbase : 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;
+ providerbase(Module* Creator, const std::string& Name, ServiceType Type)
+ : creator(Creator), name(Name), service(Type) {}
+ virtual ~providerbase();
+};
+
+
#endif