diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-17 14:10:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-17 14:10:34 +0000 |
commit | ad9950c7e5252e994984bc4d00079e48c3bed685 (patch) | |
tree | f0250c78e3edb59167f18d4b8ba68be14270982e /include/base.h | |
parent | a307d212b7acddf1e944a83ce2623820c9a67794 (diff) |
Extra comments
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7368 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/base.h')
-rw-r--r-- | include/base.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/include/base.h b/include/base.h index 2259953b8..ba8184c3c 100644 --- a/include/base.h +++ b/include/base.h @@ -20,12 +20,19 @@ #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 CoreExport classbase { @@ -34,10 +41,14 @@ class CoreExport classbase */ time_t age; - /** Constructor, + /** Constructor. * Sets the object's time */ classbase(); + + /** Destructor. + * Does sweet FA. + */ ~classbase() { } }; @@ -50,7 +61,8 @@ class CoreExport 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; } } @@ -155,6 +167,7 @@ public: */ class CoreExport BoolSet : public classbase { + /** Actual bit values */ char bits; public: @@ -212,3 +225,4 @@ class CoreExport BoolSet : public classbase #endif + |