mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
/* +------------------------------------+
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
* +------------------------------------+
|
|
*
|
|
* InspIRCd: (C) 2002-2010 InspIRCd Development Team
|
|
* See: http://wiki.inspircd.org/Credits
|
|
*
|
|
* This program is free but copyrighted software; see
|
|
* the file COPYING for details.
|
|
*
|
|
* ---------------------------------------------------
|
|
*/
|
|
|
|
#ifndef __CULLLIST_H__
|
|
#define __CULLLIST_H__
|
|
|
|
/**
|
|
* 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
|
|
{
|
|
std::vector<classbase*> list;
|
|
|
|
public:
|
|
/** 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 CoreExport ActionList
|
|
{
|
|
std::vector<HandlerBase0<void>*> list;
|
|
|
|
public:
|
|
/** Adds an item to the list
|
|
*/
|
|
void AddAction(HandlerBase0<void>* item) { list.push_back(item); }
|
|
|
|
/** Runs the items
|
|
*/
|
|
void Run();
|
|
|
|
};
|
|
|
|
#endif
|
|
|