]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove unneeded Extensible inheritance and remove "age" field from classbase
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:46:11 +0000 (00:46 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:46:11 +0000 (00:46 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11611 e03df62e-2008-0410-955e-edbf42e46eb7

17 files changed:
include/base.h
include/channelmanager.h
include/channels.h
include/configreader.h
include/mode.h
include/snomasks.h
include/socketengine.h
include/threadengines/threadengine_pthread.h
include/threadengines/threadengine_win32.h
include/timer.h
include/users.h
src/base.cpp
src/modules/m_ident.cpp
src/modules/m_spanningtree/treeserver.cpp
src/modules/m_spanningtree/treeserver.h
src/modules/m_spanningtree/treesocket.h
src/modules/m_spanningtree/treesocket1.cpp

index fa4e5c0028d593d7646ddcb1fc91d1b6444e444b..6bcf7681711fdc1d2a16ea75dd8a35f43fc7604c 100644 (file)
@@ -29,10 +29,6 @@ typedef std::map<std::string,char*> ExtensibleStore;
 class CoreExport classbase
 {
  public:
-       /** Time that the object was instantiated (used for TS calculation etc)
-       */
-       time_t age;
-
        /** Constructor.
         * Sets the object's time
         */
index ea2c602822e14fdf06fa6f1e72f831f012e5e1f2..a4a56b63201493c63fef382219308a392862d892 100644 (file)
@@ -18,7 +18,7 @@
  * the container which holds them. For some reason, nobody finished this.
  * TODO: Finish in future release!
  */
-class CoreExport ChannelManager : public Extensible
+class CoreExport ChannelManager
 {
  private:
        InspIRCd *ServerInstance;
index 9b4bfb1a58fc9b77220a8cac49ef866b40f67ec7..e471e30cbe91dc3099cefaff55c43bfd3150864c 100644 (file)
@@ -136,6 +136,10 @@ class CoreExport Channel : public Extensible
         */
        std::string name; /* CHANMAX */
 
+       /** Time that the object was instantiated (used for TS calculation etc)
+       */
+       time_t age;
+
        /** Modes for the channel.
         * This is not a null terminated string! It is a bitset where
         * each item in it represents if a mode is set. For example
index b5e6a887b4925e6709db13dfc2144192eb712f0a..e70a1478a05f8e7bb0ea97c82bdb1afd6779b416 100644 (file)
@@ -42,7 +42,7 @@ typedef std::map<irc::string,std::string> opertype_t;
 
 /** Holds an oper class.
  */
-struct operclass_data : public Extensible
+struct operclass_data : public classbase
 {
        /** Command list for the class
         */
@@ -68,7 +68,7 @@ typedef std::map<irc::string, operclass_data> operclass_t;
 /** Defines the server's length limits on various length-limited
  * items such as topics, nicknames, channel names etc.
  */
-class ServerLimits : public Extensible
+class ServerLimits
 {
  public:
        /** Maximum nickname length */
@@ -119,7 +119,7 @@ class ServerLimits : public Extensible
  * and storage of the configuration data needed to run the ircd, such as
  * the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
  */
-class CoreExport ServerConfig : public Extensible
+class CoreExport ServerConfig : public classbase
 {
   private:
        /** Creator/owner pointer
index cbb9b9e949ce624864fd92792a43c78c718e829f..a5a51036748c51a04f55a5be6c79fafeaf713392 100644 (file)
@@ -91,7 +91,7 @@ typedef std::pair<bool,std::string> ModePair;
  * mode is expected to have a parameter, then this is
  * equivalent to returning MODEACTION_DENY.
  */
-class CoreExport ModeHandler : public Extensible
+class CoreExport ModeHandler : public classbase
 {
  protected:
        /**
@@ -345,7 +345,7 @@ class CoreExport SimpleChannelModeHandler : public ModeHandler
  * and attach it to the mode using Server::AddModeWatcher and Server::DelModeWatcher.
  * A ModeWatcher will be called both before and after the mode change.
  */
-class CoreExport ModeWatcher : public Extensible
+class CoreExport ModeWatcher : public classbase
 {
  protected:
        /**
index e1af1a1099c998484d780e7a2cd657e0b35478dd..c35fc92b7235d5ef5534ea6621c9efcfd9d7b758 100644 (file)
@@ -49,7 +49,7 @@ typedef std::map<char, Snomask *> SnoList;
  * Modules and the core can enable and disable snomask characters. If they do,
  * then sending snomasks using these characters becomes possible.
  */
-class CoreExport SnomaskManager : public Extensible
+class CoreExport SnomaskManager
 {
  private:
        /** Creator/owner
index 16913972d8d578e9cd881beff1e87346a0e6b5af..a191ff12d7c00fd6db2b317037feab1b157c5ac7 100644 (file)
@@ -174,7 +174,7 @@ class CoreExport EventHandler : public Extensible
  * have to be aware of which SocketEngine derived
  * class they are using.
  */
-class CoreExport SocketEngine : public Extensible
+class CoreExport SocketEngine
 {
 protected:
        /** Owner/Creator
index bad263d1845fd7e37c51a8645da5db555a5ea56d..79b00e62935428c9ee243b9b69b39b3b04981777 100644 (file)
@@ -31,7 +31,7 @@ class Thread;
  * access non-threadsafe code from a Thread, use the Mutex class to wrap
  * access to the code carefully.
  */
-class CoreExport ThreadEngine : public Extensible
+class CoreExport ThreadEngine
 {
  public:
 
index 6bd1c2c005dd2765de1df279a61dfeabaf8d33c8..64ad87ab879d43c2c19b2c2c88d26a0b32513d85 100644 (file)
@@ -30,7 +30,7 @@ class Thread;
  * access non-threadsafe code from a Thread, use the Mutex class to wrap
  * access to the code carefully.
  */
-class CoreExport ThreadEngine : public Extensible
+class CoreExport ThreadEngine
 {
  public:
 
index 85755d6542f40cc77be056db8721fa4a818dc12b..05ce136d2b52eedc940b66057c59e7a740d6c2f8 100644 (file)
@@ -26,7 +26,7 @@
  * your object (which you should override) will be called
  * at the given time.
  */
-class CoreExport Timer : public Extensible
+class CoreExport Timer
 {
  private:
        /** The triggering time
@@ -111,7 +111,7 @@ class CoreExport Timer : public Extensible
  * This will ensure timers are not missed, as well as removing timers that have
  * expired and allowing the addition of new ones.
  */
-class CoreExport TimerManager : public Extensible
+class CoreExport TimerManager
 {
  protected:
        /** A list of all pending timers
index 9023d7728b24cbc9f6f6e22aa5fb485c90317ede..19d78ec23c37314d2b24f0cddbc98edb7c93c396 100644 (file)
@@ -339,6 +339,10 @@ class CoreExport User : public EventHandler
         */
        time_t lastping;
 
+       /** Time that the object was instantiated (used for TS calculation etc)
+       */
+       time_t age;
+
        /** Time the connection was created, set in the constructor. This
         * may be different from the time the user's classbase object was
         * created.
index b24646ab818e116f193999c649732ff41dab4070..7e0cf482a065797a2c72b4d9f438e382797d51cd 100644 (file)
@@ -23,7 +23,6 @@ const int inverted_bitfields[]  =       {~1,~2,~4,~8,~16,~32,~64,~128};
 
 classbase::classbase()
 {
-       this->age = time(NULL);
 }
 
 bool Extensible::Shrink(const std::string &key)
index 80f2c0b996ab847ae31578578b1da65984b08d45..8d21d5cc898eeb63e4cdad8e63272b9b5ee5ef04 100644 (file)
@@ -79,9 +79,11 @@ class IdentRequestSocket : public EventHandler
        bool done;                      /* True if lookup is finished */
        std::string result;             /* Holds the ident string if done */
  public:
+       time_t age;
 
        IdentRequestSocket(InspIRCd *Server, User* u) : user(u), ServerInstance(Server), result(u->ident)
        {
+               age = ServerInstance->Time();
                socklen_t size = 0;
 
                SetFd(socket(user->server_sa.sa.sa_family, SOCK_STREAM, 0));
index b6ec7a3055577691c669c3a9dbaee2b732525867..97aab72661351b28b2b4fad6cdf53663b903065a 100644 (file)
@@ -30,6 +30,7 @@
 TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id)
                                                : ServerInstance(Instance), ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util)
 {
+       age = Instance->Time();
        bursting = false;
        Parent = NULL;
        VersionString.clear();
@@ -50,6 +51,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
 TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide)
        : ServerInstance(Instance), Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util), Hidden(Hide)
 {
+       age = Instance->Time();
        bursting = true;
        VersionString.clear();
        ServerUserCount = ServerOperCount = 0;
index f39778eb0c6d0cb034f32dd4155e45c8c2392b41..e8db09cdf1946e433bf3bba02161c55e46788e01 100644 (file)
@@ -52,6 +52,7 @@ class TreeServer : public classbase
        void SetID(const std::string &id);
 
  public:
+       time_t age;
 
        bool Warned;                            /* True if we've warned opers about high latency on this server */
        bool bursting;                          /* whether or not this server is bursting */
index 6d99c2a767beedf254a94124c6bbf9dbd956d73d..3c736b341efff0578a4d01f826ab6bf19ee3ad41 100644 (file)
@@ -93,6 +93,7 @@ class TreeSocket : public BufferedSocket
        bool auth_challenge;                    /* Did we auth using challenge/response */
  public:
        HandshakeTimer* hstimer;                /* Handshake timer, needed to work around I/O hook buffering */
+       time_t age;
 
        /** Because most of the I/O gubbins are encapsulated within
         * BufferedSocket, we just call the superclass constructor for
index 46f2657ff7fb7c71e715b6284a40c4ff68447a8b..9706271bfef523a5da61ccb0849a2d3e621a62a8 100644 (file)
@@ -39,6 +39,7 @@
 TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string shost, int iport, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Module* HookMod)
        : BufferedSocket(SI, shost, iport, maxtime, bindto), Utils(Util), Hook(HookMod)
 {
+       age = SI->Time();
        myhost = ServerName;
        theirchallenge.clear();
        ourchallenge.clear();
@@ -56,6 +57,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string sh
 TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Module* HookMod)
        : BufferedSocket(SI, newfd, ip), Utils(Util), Hook(HookMod)
 {
+       age = SI->Time();
        this->LinkState = WAIT_AUTH_1;
        theirchallenge.clear();
        ourchallenge.clear();