#include <cull_list.h>
Collaboration diagram for CullList:
Public Member Functions | |
CullList () | |
Constructor. | |
void | AddItem (userrec *user, std::string reason) |
Adds a user to the cull list for later removal via QUIT. | |
int | Apply () |
Applies the cull list, quitting all the users on the list with their quit reasons all at once. | |
Private Attributes | |
std::vector< CullItem > | list |
Holds a list of users being quit. | |
std::map< userrec *, int > | exempt |
A list of users who have already been placed on the list, as a map for fast reference. |
This is faster than quitting them within the loop, as the loops become tighter with little or no comparisons within them. The CullList class operates by allowing the programmer to push users onto the list, each with a seperate quit reason, and then, once the list is complete, call a method to flush the list, quitting all the users upon it. A CullList may hold local or remote users, but it may only hold each user once. If you attempt to add the same user twice, then the second attempt will be ignored.
Definition at line 75 of file cull_list.h.
|
Constructor. Clears the CullList::list and CullList::exempt items. |
|
Adds a user to the cull list for later removal via QUIT.
|
|
Applies the cull list, quitting all the users on the list with their quit reasons all at once. This is a very fast operation compared to iterating the user list and comparing each one, especially if there are multiple comparisons to be done, or recursion.
|
|
A list of users who have already been placed on the list, as a map for fast reference.
Definition at line 87 of file cull_list.h. |
|
Holds a list of users being quit. See the information for CullItem for more information. Definition at line 82 of file cull_list.h. |