};
// must be defined after class BanCacheHit.
+#ifndef WIN32
typedef nspace::hash_map<std::string, BanCacheHit *, nspace::hash<std::string> > BanCacheHash;
+#else
+typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash_compare<string, less<string> > > BanCacheHash;
+#endif
class CoreExport BanCacheManager : public classbase
{
BanCacheHit *GetHit(const std::string &ip);
bool RemoveHit(BanCacheHit *b);
+ /** Removes all entries of a given type, either positive or negative. Returns the number of hits removed.
+ * @param type The type of bancache entries to remove (e.g. 'G')
+ * @param positive Remove either positive (true) or negative (false) hits.
+ */
+ int RemoveEntries(const std::string &type, bool positive);
+
BanCacheManager(InspIRCd *Instance)
{
this->ServerInstance = Instance;
this->BanHash = new BanCacheHash();
}
+
+ void RehashCache();
};
#endif