X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fcull_list.h;h=8c38276429c15490be501f93093754528848acf1;hb=db7cc57f444a82df65f47b4f7058560e645e35cf;hp=113a0cd619c63e4fd561cea43d675639ca939856;hpb=9904b03fdd72f357729103774a7f4bba6ec3b0bc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/cull_list.h b/include/cull_list.h index 113a0cd61..8c3827642 100644 --- a/include/cull_list.h +++ b/include/cull_list.h @@ -2,12 +2,9 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2005 ChatSpike-Dev. - * E-mail: - * - * + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * - * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see * the file COPYING for details. * @@ -17,38 +14,27 @@ #ifndef __CULLLIST_H__ #define __CULLLIST_H__ -// include the common header files - -#include -#include -#include -#include -#include -#include -#include "users.h" -#include "channels.h" - -class CullItem +/** + * The CullList class is used to delete objects at the end of the main loop to + * avoid problems with references to deleted pointers if an object were deleted + * during execution. + */ +class CoreExport CullList : public classbase { private: - userrec* user; - std::string reason; + std::vector list; + public: - CullItem(userrec* u, std::string r); - userrec* GetUser(); - std::string GetReason(); -}; + CullList() {} + /** Adds an item to the cull list + */ + void AddItem(classbase* item) { list.push_back(item); } -class CullList -{ - private: - std::vector list; - std::map exempt; - public: - CullList(); - void AddItem(userrec* user, std::string reason); - int Apply(); + /** Applies the cull list (deletes the contents) + */ + void Apply(); }; #endif +