summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-29 15:23:20 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-29 15:23:20 +0000
commit71247cc2f120b67302271937b887de95c8bcc623 (patch)
treedb20427b07c3c7caa310887c5ab00aaf99409f1d /include/base.h
parent71e6de4b88c3d51bfa59fed44049a4d1ea6d26a1 (diff)
Added 'Extensible' class which allows modules to store custom data in objects
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@750 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/base.h b/include/base.h
index b0e264bac..dbe4588e9 100644
--- a/include/base.h
+++ b/include/base.h
@@ -1,15 +1,17 @@
/*
-
-
+Defines the base classes used by InspIRCd
*/
-#include "inspircd_config.h"
-#include <time.h>
-
#ifndef __BASE_H__
#define __BASE_H__
+#include "inspircd_config.h"
+#include <time.h>
+#include <map>
+#include <string>
+typedef void* VoidPointer;
+
/** The base class for all inspircd classes
*/
class classbase
@@ -26,5 +28,19 @@ class classbase
~classbase() { }
};
+/** class Extensible is the parent class of many classes such as userrec and chanrec.
+ * class Extensible implements a system which allows modules to 'extend' the class by attaching data within
+ * a map associated with the object. In this way modules can store their own custom information within user
+ * objects, channel objects and server objects, without breaking other modules (this is more sensible than using
+ * a flags variable, and each module defining bits within the flag as 'theirs' as it is less prone to conflict and
+ * supports arbitary data storage).
+ */
+class Extensible : public classbase
+{
+ /** Private data store
+ */
+ std::map<std::string,VoidPointer> Extension_Items;
+};
+
#endif