From eef472fb62c299d4900baf0339e0eaf08648dcf1 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 9 Jul 2014 15:14:30 +0200 Subject: core_whowas Change the FIFO to be an intrusive list --- include/commands/cmd_whowas.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h index 5c2bb62ee..021e9e3b7 100644 --- a/include/commands/cmd_whowas.h +++ b/include/commands/cmd_whowas.h @@ -34,7 +34,7 @@ namespace WhoWas { /** Everything known about one nick */ - struct Nick + struct Nick : public intrusive_list_node { /** Container where each element has information about one occurrence of this nick */ @@ -56,16 +56,16 @@ namespace WhoWas */ ~Nick(); }; + + /** Order in which the users were added into the map, used to remove oldest nick + */ + typedef intrusive_list_tail FIFO; } /** Sets of users in the whowas system */ typedef std::map whowas_users; -/** Sets of time and users in whowas list - */ -typedef std::deque > whowas_users_fifo; - /** Handle /WHOWAS. These command handlers can be reloaded by the core, * and handle basic RFC1459 commands. Commands within modules work * the same way, however, they can be fully unloaded, where these @@ -80,7 +80,7 @@ class CommandWhowas : public Command /** List of nicknames in the order they were inserted into the map */ - whowas_users_fifo whowas_fifo; + WhoWas::FIFO whowas_fifo; public: /** Max number of WhoWas entries per user. -- cgit v1.3.1-10-gc9f91