From ad9950c7e5252e994984bc4d00079e48c3bed685 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Jun 2007 14:10:34 +0000 Subject: [PATCH] Extra comments git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7368 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/base.h | 26 +++++++++++++++++------ include/channels.h | 53 +++++++++++++++++++++++++++++++--------------- 2 files changed, 56 insertions(+), 23 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 #include +/** Do we use this? -- Brain */ typedef void* VoidPointer; + +/** A private data store for an Extensible class */ typedef std::map 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 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 + diff --git a/include/channels.h b/include/channels.h index 20454e0b9..b4fa1ca30 100644 --- a/include/channels.h +++ b/include/channels.h @@ -24,16 +24,17 @@ /** RFC1459 channel modes */ enum ChannelModes { - CM_TOPICLOCK = 't'-65, - CM_NOEXTERNAL = 'n'-65, - CM_INVITEONLY = 'i'-65, - CM_MODERATED = 'm'-65, - CM_SECRET = 's'-65, - CM_PRIVATE = 'p'-65, - CM_KEY = 'k'-65, - CM_LIMIT = 'l'-65 + CM_TOPICLOCK = 't'-65, /* +t: Only operators can change topic */ + CM_NOEXTERNAL = 'n'-65, /* +n: Only users in the channel can message it */ + CM_INVITEONLY = 'i'-65, /* +i: Invite only */ + CM_MODERATED = 'm'-65, /* +m: Only voices and above can talk */ + CM_SECRET = 's'-65, /* +s: Secret channel */ + CM_PRIVATE = 'p'-65, /* +p: Private channel */ + CM_KEY = 'k'-65, /* +k: Keyed channel */ + CM_LIMIT = 'l'-65 /* +l: Maximum user limit */ }; +/* Forward declarations - needed */ class userrec; class chanrec; @@ -87,11 +88,12 @@ typedef std::map CustomModeList; /** used to hold a channel and a users modes on that channel, e.g. +v, +h, +o */ enum UserChannelModes { - UCMODE_OP = 1, - UCMODE_VOICE = 2, - UCMODE_HOP = 4 + UCMODE_OP = 1, /* Opped user */ + UCMODE_VOICE = 2, /* Voiced user */ + UCMODE_HOP = 4 /* Halfopped user */ }; +/* Forward declaration -- required */ class InspIRCd; /** A stored prefix and its rank @@ -126,6 +128,9 @@ class CoreExport chanrec : public Extensible */ void SetDefaultModes(); + /** A list of prefixes associated with each user in the channel + * (e.g. &%+ etc) + */ prefixlist prefixes; /** Maximum number of bans (cached) @@ -133,7 +138,7 @@ class CoreExport chanrec : public Extensible int maxbans; public: - /** The channels name. + /** The channel's name. */ char name[CHANMAX]; @@ -145,26 +150,36 @@ class CoreExport chanrec : public Extensible */ char modes[64]; - /** User lists + /** User lists. * There are four user lists, one for * all the users, one for the ops, one for * the halfops and another for the voices. */ CUList internal_userlist; - /** Opped users + /** Opped users. + * There are four user lists, one for + * all the users, one for the ops, one for + * the halfops and another for the voices. */ CUList internal_op_userlist; - /** Halfopped users + /** Halfopped users. + * There are four user lists, one for + * all the users, one for the ops, one for + * the halfops and another for the voices. */ CUList internal_halfop_userlist; - /** Voiced users + /** Voiced users. + * There are four user lists, one for + * all the users, one for the ops, one for + * the halfops and another for the voices. */ CUList internal_voice_userlist; - /** Parameters for custom modes + /** Parameters for custom modes. + * One for each custom mode letter. */ CustomModeList custom_mode_params; @@ -172,13 +187,17 @@ class CoreExport chanrec : public Extensible * If this is an empty string, no channel topic is set. */ char topic[MAXTOPIC]; + /** Creation time. + * This is a timestamp (TS) value. */ time_t created; + /** Time topic was set. * If no topic was ever set, this will be equal to chanrec::created */ time_t topicset; + /** The last user to set the topic. * If this member is an empty string, no topic was ever set. */ -- 2.39.2