]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classCullList.html
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2578 e03df62e-2008...
[user/henk/code/inspircd.git] / docs / module-doc / classCullList.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: CullList Class Reference</title>
4 <link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.4.4-20050815 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <h1>CullList Class Reference</h1><!-- doxytag: class="CullList" -->The CullList class can be used by modules, and is used by the core, to compile large lists of users in preperation to quitting them all at once.  
9 <a href="#_details">More...</a>
10 <p>
11 <code>#include &lt;<a class="el" href="cull__list_8h-source.html">cull_list.h</a>&gt;</code>
12 <p>
13 Collaboration diagram for CullList:<p><center><img src="classCullList__coll__graph.gif" border="0" usemap="#CullList__coll__map" alt="Collaboration graph"></center>
14 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classCullList-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
15 <tr><td></td></tr>
16 <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
17 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCullList.html#CullList_28_29">CullList</a> ()</td></tr>
18
19 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#CullList_28_29"></a><br></td></tr>
20 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCullList.html#AddItem_28userrec_20_2Auser_2C_20std_3A_3Astring_20reason_29">AddItem</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="namespaceirc.html#string">std::string</a> reason)</td></tr>
21
22 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds a user to the cull list for later removal via QUIT.  <a href="#AddItem_28userrec_20_2Auser_2C_20std_3A_3Astring_20reason_29"></a><br></td></tr>
23 <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCullList.html#Apply_28_29">Apply</a> ()</td></tr>
24
25 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Applies the cull list, quitting all the users on the list with their quit reasons all at once.  <a href="#Apply_28_29"></a><br></td></tr>
26 <tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
27 <tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector&lt; <a class="el" href="classCullItem.html">CullItem</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCullList.html#list">list</a></td></tr>
28
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds a list of users being quit.  <a href="#list"></a><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align="right" valign="top">std::map&lt; <a class="el" href="classuserrec.html">userrec</a> *, int &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCullList.html#exempt">exempt</a></td></tr>
31
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A list of users who have already been placed on the list, as a map for fast reference.  <a href="#exempt"></a><br></td></tr>
33 </table>
34 <hr><a name="_details"></a><h2>Detailed Description</h2>
35 The CullList class can be used by modules, and is used by the core, to compile large lists of users in preperation to quitting them all at once. 
36 <p>
37 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.
38 <p>
39
40 <p>
41 Definition at line <a class="el" href="cull__list_8h-source.html#l00075">75</a> of file <a class="el" href="cull__list_8h-source.html">cull_list.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
42 <a class="anchor" name="CullList_28_29"></a><!-- doxytag: member="CullList::CullList" ref="CullList_28_29" args="()" --><p>
43 <table class="mdTable" cellpadding="2" cellspacing="0">
44   <tr>
45     <td class="mdRow">
46       <table cellpadding="0" cellspacing="0" border="0">
47         <tr>
48           <td class="md" nowrap valign="top">CullList::CullList           </td>
49           <td class="md" valign="top">(&nbsp;</td>
50           <td class="mdname1" valign="top" nowrap>          </td>
51           <td class="md" valign="top">&nbsp;)&nbsp;</td>
52           <td class="md" nowrap></td>
53         </tr>
54       </table>
55     </td>
56   </tr>
57 </table>
58 <table cellspacing="5" cellpadding="0" border="0">
59   <tr>
60     <td>
61       &nbsp;
62     </td>
63     <td>
64
65 <p>
66 Constructor. 
67 <p>
68 Clears the <a class="el" href="classCullList.html#list">CullList::list</a> and <a class="el" href="classCullList.html#exempt">CullList::exempt</a> items.    </td>
69   </tr>
70 </table>
71 <hr><h2>Member Function Documentation</h2>
72 <a class="anchor" name="AddItem_28userrec_20_2Auser_2C_20std_3A_3Astring_20reason_29"></a><!-- doxytag: member="CullList::AddItem" ref="AddItem_28userrec_20_2Auser_2C_20std_3A_3Astring_20reason_29" args="(userrec *user, std::string reason)" --><p>
73 <table class="mdTable" cellpadding="2" cellspacing="0">
74   <tr>
75     <td class="mdRow">
76       <table cellpadding="0" cellspacing="0" border="0">
77         <tr>
78           <td class="md" nowrap valign="top">void CullList::AddItem           </td>
79           <td class="md" valign="top">(&nbsp;</td>
80           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
81           <td class="mdname" nowrap> <em>user</em>, </td>
82         </tr>
83         <tr>
84           <td class="md" nowrap align="right"></td>
85           <td class="md"></td>
86           <td class="md" nowrap><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td>
87           <td class="mdname" nowrap> <em>reason</em></td>
88         </tr>
89         <tr>
90           <td class="md"></td>
91           <td class="md">)&nbsp;</td>
92           <td class="md" colspan="2"></td>
93         </tr>
94       </table>
95     </td>
96   </tr>
97 </table>
98 <table cellspacing="5" cellpadding="0" border="0">
99   <tr>
100     <td>
101       &nbsp;
102     </td>
103     <td>
104
105 <p>
106 Adds a user to the cull list for later removal via QUIT. 
107 <p>
108 <dl compact><dt><b>Parameters:</b></dt><dd>
109   <table border="0" cellspacing="2" cellpadding="0">
110     <tr><td valign="top"></td><td valign="top"><em>user</em>&nbsp;</td><td>The user to add </td></tr>
111     <tr><td valign="top"></td><td valign="top"><em>reason</em>&nbsp;</td><td>The quit reason of the user being added</td></tr>
112   </table>
113 </dl>
114     </td>
115   </tr>
116 </table>
117 <a class="anchor" name="Apply_28_29"></a><!-- doxytag: member="CullList::Apply" ref="Apply_28_29" args="()" --><p>
118 <table class="mdTable" cellpadding="2" cellspacing="0">
119   <tr>
120     <td class="mdRow">
121       <table cellpadding="0" cellspacing="0" border="0">
122         <tr>
123           <td class="md" nowrap valign="top">int CullList::Apply           </td>
124           <td class="md" valign="top">(&nbsp;</td>
125           <td class="mdname1" valign="top" nowrap>          </td>
126           <td class="md" valign="top">&nbsp;)&nbsp;</td>
127           <td class="md" nowrap></td>
128         </tr>
129       </table>
130     </td>
131   </tr>
132 </table>
133 <table cellspacing="5" cellpadding="0" border="0">
134   <tr>
135     <td>
136       &nbsp;
137     </td>
138     <td>
139
140 <p>
141 Applies the cull list, quitting all the users on the list with their quit reasons all at once. 
142 <p>
143 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. <dl compact><dt><b>Returns:</b></dt><dd>The number of users removed from IRC.</dd></dl>
144     </td>
145   </tr>
146 </table>
147 <hr><h2>Member Data Documentation</h2>
148 <a class="anchor" name="exempt"></a><!-- doxytag: member="CullList::exempt" ref="exempt" args="" --><p>
149 <table class="mdTable" cellpadding="2" cellspacing="0">
150   <tr>
151     <td class="mdRow">
152       <table cellpadding="0" cellspacing="0" border="0">
153         <tr>
154           <td class="md" nowrap valign="top">std::map&lt;<a class="el" href="classuserrec.html">userrec</a>*,int&gt; <a class="el" href="classCullList.html#exempt">CullList::exempt</a><code> [private]</code>          </td>
155         </tr>
156       </table>
157     </td>
158   </tr>
159 </table>
160 <table cellspacing="5" cellpadding="0" border="0">
161   <tr>
162     <td>
163       &nbsp;
164     </td>
165     <td>
166
167 <p>
168 A list of users who have already been placed on the list, as a map for fast reference. 
169 <p>
170
171 <p>
172 Definition at line <a class="el" href="cull__list_8h-source.html#l00087">87</a> of file <a class="el" href="cull__list_8h-source.html">cull_list.h</a>.    </td>
173   </tr>
174 </table>
175 <a class="anchor" name="list"></a><!-- doxytag: member="CullList::list" ref="list" args="" --><p>
176 <table class="mdTable" cellpadding="2" cellspacing="0">
177   <tr>
178     <td class="mdRow">
179       <table cellpadding="0" cellspacing="0" border="0">
180         <tr>
181           <td class="md" nowrap valign="top">std::vector&lt;<a class="el" href="classCullItem.html">CullItem</a>&gt; <a class="el" href="classCullList.html#list">CullList::list</a><code> [private]</code>          </td>
182         </tr>
183       </table>
184     </td>
185   </tr>
186 </table>
187 <table cellspacing="5" cellpadding="0" border="0">
188   <tr>
189     <td>
190       &nbsp;
191     </td>
192     <td>
193
194 <p>
195 Holds a list of users being quit. 
196 <p>
197 See the information for <a class="el" href="classCullItem.html">CullItem</a> for more information.
198 <p>
199 Definition at line <a class="el" href="cull__list_8h-source.html#l00082">82</a> of file <a class="el" href="cull__list_8h-source.html">cull_list.h</a>.    </td>
200   </tr>
201 </table>
202 <hr>The documentation for this class was generated from the following file:<ul>
203 <li><a class="el" href="cull__list_8h-source.html">cull_list.h</a></ul>
204 <hr size="1"><address style="align: right;"><small>Generated on Mon Dec 19 18:02:15 2005 for InspIRCd by&nbsp;
205 <a href="http://www.doxygen.org/index.html">
206 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
207 </body>
208 </html>