]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/base.h
Added new announceinvite setting i discussed briefly with w00t and i like myself:
[user/henk/code/inspircd.git] / include / base.h
index bea7075a02e7e506dab3c148d135be7dc8356b74..e769e93b16dde1b05a6dc7f28a54aef6c4a929f7 100644 (file)
 #include <deque>
 #include <string>
 
+/** Do we use this? -- Brain */
 typedef void* VoidPointer;
+
+/** A private data store for an Extensible class */
 typedef std::map<std::string,char*> ExtensibleStore;
 
+/** Needed */
 class InspIRCd;
 
-/** The base class for all inspircd classes
+/** The base class for all inspircd classes.
+ * Wherever possible, all classes you create should inherit from this,
+ * giving them the ability to be passed to various core functions
+ * as 'anonymous' classes.
 */ 
-class classbase
+class CoreExport classbase
 {
  public:
        /** Time that the object was instantiated (used for TS calculation etc)
        */
        time_t age;
 
-       /** Constructor,
+       /** Constructor.
         * Sets the object's time
         */
        classbase();
-       ~classbase() { }
+
+       /** Destructor.
+        * Does sweet FA.
+        */
+       virtual ~classbase() { }
 };
 
 /** class Extensible is the parent class of many classes such as userrec and chanrec.
@@ -48,9 +59,10 @@ class classbase
  * 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
+class CoreExport Extensible : public classbase
 {
-       /** Private data store
+       /** Private data store.
+        * Holds all extensible metadata for the class.
         */
        ExtensibleStore Extension_Items;
        
@@ -115,15 +127,15 @@ public:
         */
        template<typename T> bool GetExt(const std::string &key, T* &p)
        {
-               ExtensibleStore::iterator iter = this->Extension_Items.find(key);
+               ExtensibleStore::iterator iter = this->Extension_Items.find(key); /* Find the item */
                if(iter != this->Extension_Items.end())
                {
-                       p = (T*)iter->second;
+                       p = (T*)iter->second;   /* Item found */
                        return true;
                }
                else
                {
-                       p = NULL;       
+                       p = NULL;               /* Item not found */
                        return false;
                }
        }
@@ -153,8 +165,9 @@ public:
  * Use BoolSet::Set and BoolSet::Get to set and get bools in the bitmask,
  * and Unset and Invert for special operations upon them.
  */
-class BoolSet : public classbase
+class CoreExport BoolSet : public classbase
 {
+       /** Actual bit values */
        char bits;
 
  public:
@@ -212,3 +225,4 @@ class BoolSet : public classbase
 
 
 #endif
+