]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/bancache.h
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / include / bancache.h
index 9266149fc1507dbb7e5f8bcd499a4ad1b6b99143..c9c469e4f8fa4a81bdac25dea41679b5ef7e210a 100644 (file)
@@ -23,8 +23,6 @@
  */
 class CoreExport BanCacheHit : public classbase
 {
- private:
-       InspIRCd *ServerInstance;
  public:
        /** Type of cached ban
         */
@@ -39,9 +37,8 @@ class CoreExport BanCacheHit : public classbase
         */
        time_t Expiry;
 
-       BanCacheHit(InspIRCd *Instance, const std::string &ip, const std::string &type, const std::string &reason)
+       BanCacheHit(const std::string &ip, const std::string &type, const std::string &reason)
        {
-               ServerInstance = Instance;
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
@@ -49,9 +46,8 @@ class CoreExport BanCacheHit : public classbase
        }
 
        // overridden to allow custom time
-       BanCacheHit(InspIRCd *Instance, const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
+       BanCacheHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
        {
-               ServerInstance = Instance;
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
@@ -62,10 +58,10 @@ class CoreExport BanCacheHit : public classbase
 /* A container of ban cache items.
  * must be defined after class BanCacheHit.
  */
-#ifndef WIN32
-typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash<std::string> > BanCacheHash;
-#else
+#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
 typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash_compare<std::string, std::less<std::string> > > BanCacheHash;
+#else
+typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash<std::string> > BanCacheHash;
 #endif
 
 /** A manager for ban cache, which allocates and deallocates and checks cached bans.
@@ -74,7 +70,6 @@ class CoreExport BanCacheManager : public classbase
 {
  private:
        BanCacheHash* BanHash;
-       InspIRCd* ServerInstance;
  public:
 
        /** Creates and adds a Ban Cache item.
@@ -95,11 +90,14 @@ class CoreExport BanCacheManager : public classbase
         */
        unsigned int RemoveEntries(const std::string &type, bool positive);
 
-       BanCacheManager(InspIRCd *Instance)
+       BanCacheManager()
        {
-               this->ServerInstance = Instance;
                this->BanHash = new BanCacheHash();
        }
+       ~BanCacheManager()
+       {
+               delete BanHash;
+       }
 
        void RehashCache();
 };