diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 21:55:21 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 21:55:21 +0000 |
commit | 3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d (patch) | |
tree | 431e66fceef85d577d360865b3b878dc9132afc2 /include/users.h | |
parent | 7aa5e059a8f66d91bd8b69c58c657ceb70b4baff (diff) |
Add explicit reference-counting base class
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11785 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/users.h')
-rw-r--r-- | include/users.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/include/users.h b/include/users.h index 76337b2c3..31c1c641d 100644 --- a/include/users.h +++ b/include/users.h @@ -62,7 +62,7 @@ class UserResolver; /** Holds information relevent to <connect allow> and <connect deny> tags in the config file. */ -struct CoreExport ConnectClass : public classbase +struct CoreExport ConnectClass : public refcountbase { /** Type of line, either CC_ALLOW or CC_DENY */ @@ -127,12 +127,6 @@ struct CoreExport ConnectClass : public classbase */ unsigned long limit; - /** Reference counter. - * This will be 1 if no users are connected, as long as it is a valid connect block - * When it reaches 0, the object should be deleted - */ - unsigned long RefCount; - /** Create a new connect class with no settings. */ ConnectClass(char type, const std::string& mask); @@ -206,7 +200,7 @@ typedef std::vector< std::pair<irc::string, time_t> > InvitedList; /** Holds a complete list of all allow and deny tags from the configuration file (connection classes) */ -typedef std::vector<ConnectClass*> ClassVector; +typedef std::vector<reference<ConnectClass> > ClassVector; /** Typedef for the list of user-channel records for a user */ @@ -274,9 +268,8 @@ class CoreExport User : public StreamSocket static LocalStringExt OperQuit; /** Contains a pointer to the connect class a user is on from - this will be NULL for remote connections. - * The pointer is guarenteed to *always* be valid. :) */ - ConnectClass *MyClass; + reference<ConnectClass> MyClass; /** Hostname of connection. * This should be valid as per RFC1035. @@ -869,7 +862,7 @@ class CoreExport User : public StreamSocket /** Default destructor */ virtual ~User(); - virtual void cull(); + virtual bool cull(); }; /** Derived from Resolver, and performs user forward/reverse lookups. |