From 6c31213a38a5f136bebe4cdbc9dea66031e9b26c Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 30 Mar 2008 14:47:29 +0000 Subject: More docs on data structures git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9226 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_watch.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 40c055979..d94796a20 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -15,6 +15,32 @@ /* $ModDesc: Provides support for the /WATCH command */ + +/* + * Okay, it's nice that this was documented and all, but I at least understood very little + * of it, so I'm going to attempt to explain the data structures in here a bit more. + * + * For efficiency, many data structures are kept. + * + * The first is a global list `watchentries': + * hash_map > + * + * That is, if nick 'w00t' is being watched by user pointer 'Brain' and 'Om', + * will be in the watchentries list. + * + * The second is that each user has a per-user data structure attached to their user record via Extensible: + * std::map watchlist; + * So, in the above example with w00t watched by Brain and Om, we'd have: + * Brain- + * `- w00t + * Om- + * `- w00t + * + * Hopefully this helps any brave soul that ventures into this file other than me. :-) + * -- w00t (mar 30, 2008) + */ + + /* This module has been refactored to provide a very efficient (in terms of cpu time) * implementation of /WATCH. * -- cgit v1.2.3