]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/cull_list.h
Allow SASL messages to be targeted at the services server
[user/henk/code/inspircd.git] / include / cull_list.h
index 113a0cd619c63e4fd561cea43d675639ca939856..5a74aa72470c9f2396f9e0247361a69175866442 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
+ *  InspIRCd: (C) 2002-2010 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.
  *
 #ifndef __CULLLIST_H__
 #define __CULLLIST_H__
 
-// include the common header files
-
-#include <typeinfo>
-#include <iostream>
-#include <string>
-#include <deque>
-#include <sstream>
-#include <vector>
-#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
 {
- private:
-        userrec* user;
-        std::string reason;
+       std::vector<classbase*> list;
+
  public:
-        CullItem(userrec* u, std::string r);
-        userrec* GetUser();
-        std::string GetReason();
-};
+       /** Adds an item to the cull list
+        */
+       void AddItem(classbase* item) { list.push_back(item); }
 
+       /** Applies the cull list (deletes the contents)
+        */
+       void Apply();
+};
 
-class CullList
+class CoreExport ActionList
 {
- private:
-         std::vector<CullItem> list;
-        std::map<userrec*,int> exempt;
+       std::vector<HandlerBase0<void>*> list;
+
  public:
-         CullList();
-         void AddItem(userrec* user, std::string reason);
-         int Apply();
+       /** Adds an item to the list
+        */
+       void AddAction(HandlerBase0<void>* item) { list.push_back(item); }
+
+       /** Runs the items
+        */
+       void Run();
+
 };
 
 #endif
+