X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fxline.h;h=1d458ae6811e044502c1e9af7283f697620d2fa5;hb=d3ca6510fa23308481d10da0bb7770d251fb659b;hp=e349c28d787e038c6aa0ba2940d4327f5fa99ddf;hpb=a59d08fffd3dc8a9850ce34c9928fb6382b9b37f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/xline.h b/include/xline.h index e349c28d7..1d458ae68 100644 --- a/include/xline.h +++ b/include/xline.h @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see @@ -14,10 +14,6 @@ #ifndef __XLINE_H #define __XLINE_H -//#include -//#include -//#include - /** XLine is the base class for ban lines such as G lines and K lines. * Modules may derive from this, and their xlines will automatically be * handled as expected by any protocol modules (e.g. m_spanningtree will @@ -355,10 +351,6 @@ class CoreExport QLine : public XLine std::string nick; }; -/** Contains an ident and host split into two strings - */ -typedef std::pair IdentHostPair; - /** XLineFactory is used to generate an XLine pointer, given just the * pattern, timing information and type of line to create. This is used * for example in the spanningtree module which will call an XLineFactory @@ -402,36 +394,6 @@ class CoreExport XLineFactory virtual ~XLineFactory() { } }; -/* Required forward declarations - */ -class ServerConfig; - -class GLineFactory; -class ELineFactory; -class QLineFactory; -class ZLineFactory; -class KLineFactory; - -/** A map of xline factories - */ -typedef std::map XLineFactMap; - -/** A map of XLines indexed by string - */ -typedef std::map XLineLookup; - -/** A map of XLineLookup maps indexed by string - */ -typedef std::map XLineContainer; - -/** An iterator in an XLineContainer - */ -typedef XLineContainer::iterator ContainerIter; - -/** An interator in an XLineLookup - */ -typedef XLineLookup::iterator LookupIter; - /** XLineManager is a class used to manage glines, klines, elines, zlines and qlines, * or any other line created by a module. It also manages XLineFactory classes which * can generate a specialized XLine for use by another module. @@ -447,16 +409,6 @@ class CoreExport XLineManager */ XLineFactMap line_factory; - /** Core xline factories for G/E/K/Q/Z lines - * (These generate GLine, ELine, KLine, QLine and ZLine - * respectively) - */ - GLineFactory* GFact; - ELineFactory* EFact; - KLineFactory* KFact; - QLineFactory* QFact; - ZLineFactory* ZFact; - /** Container of all lines, this is a map of maps which * allows for fast lookup for add/remove of a line, and * the shortest possible timed O(n) for checking a user @@ -577,82 +529,4 @@ class CoreExport XLineManager void InvokeStats(const std::string &type, int numeric, User* user, string_list &results); }; -/** An XLineFactory specialized to generate GLine* pointers - */ -class CoreExport GLineFactory : public XLineFactory -{ - public: - GLineFactory() : XLineFactory("G") { } - - /** Generate a GLine - */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) - { - IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask); - return new GLine(set_time, duration, source, reason, ih.first, ih.second); - } -}; - -/** An XLineFactory specialized to generate ELine* pointers - */ -class CoreExport ELineFactory : public XLineFactory -{ - public: - ELineFactory() : XLineFactory("E") { } - - /** Generate an ELine - */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) - { - IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask); - return new ELine(set_time, duration, source, reason, ih.first, ih.second); - } -}; - -/** An XLineFactory specialized to generate KLine* pointers - */ -class CoreExport KLineFactory : public XLineFactory -{ - public: - KLineFactory() : XLineFactory("K") { } - - /** Generate a KLine - */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) - { - IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask); - return new KLine(set_time, duration, source, reason, ih.first, ih.second); - } -}; - -/** An XLineFactory specialized to generate QLine* pointers - */ -class CoreExport QLineFactory : public XLineFactory -{ - public: - QLineFactory() : XLineFactory("Q") { } - - /** Generate a QLine - */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) - { - return new QLine(set_time, duration, source, reason, xline_specific_mask); - } -}; - -/** An XLineFactory specialized to generate ZLine* pointers - */ -class CoreExport ZLineFactory : public XLineFactory -{ - public: - ZLineFactory() : XLineFactory("Z") { } - - /** Generate a ZLine - */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) - { - return new ZLine(set_time, duration, source, reason, xline_specific_mask); - } -}; - #endif