]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/cull_list.h
Change Extensible to use strongly typed entries
[user/henk/code/inspircd.git] / include / cull_list.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __CULLLIST_H__
15 #define __CULLLIST_H__
16
17 /**
18  * The CullList class is used to delete objects at the end of the main loop to
19  * avoid problems with references to deleted pointers if an object were deleted
20  * during execution.
21  */
22 class CoreExport CullList : public classbase
23 {
24  private:
25         std::vector<classbase*> list;
26
27  public:
28         CullList() {}
29
30         /** Adds an item to the cull list
31          */
32         void AddItem(classbase* item) { list.push_back(item); }
33
34         /** Applies the cull list (deletes the contents)
35          */
36         void Apply();
37 };
38
39 #endif
40