-class CullItem
-{
- private:
- userrec* user;
- std::string reason;
- public:
- CullItem(userrec* u, std::string r)
- {
- this->user = u;
- this->reason = r;
- }
-
- userrec* GetUser()
- {
- return this->user;
- }
-
- std::string GetReason()
- {
- return this->reason;
- }
-};
-
-
-class CullList
-{
- private:
- std::vector<CullItem> list;
- char exempt[65535];
- public:
- CullList()
- {
- memset(exempt,0,65535);
- line = ltype;
- }
-
- AddItem(userrec* user, std::string reason)
- {
- if ((user->fd > -1) && (exempt[user->fd] == 0))
- {
- CullItem item(user,reason);
- list.push_back(item);
- exempt[user->fd] = 1;
- }
- }
-
- Apply()
- {
- while (list.size())
- {
- std::vector<CullItem>::iterator a = list.begin();
- userrec* u = a->GetUser();
- std::string reason = a->GetReason();
- kill_link(u,reason);
- list.erase(list.begin());
- }
- }
-}
-