summaryrefslogtreecommitdiff
path: root/docs/module-doc/classCullList.html
blob: f6c40f379241ac8322f5750b18935e76c9719bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: CullList Class Reference</title>
<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4-20050815 -->
<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>
<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.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="cull__list_8h-source.html">cull_list.h</a>&gt;</code>
<p>
Collaboration diagram for CullList:<p><center><img src="classCullList__coll__graph.gif" border="0" usemap="#CullList__coll__map" alt="Collaboration graph"></center>
<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">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<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>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#CullList_28_29"></a><br></td></tr>
<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>

<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>
<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>

<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>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<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>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds a list of users being quit.  <a href="#list"></a><br></td></tr>
<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>

<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>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
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. 
<p>
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.
<p>

<p>
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>
<a class="anchor" name="CullList_28_29"></a><!-- doxytag: member="CullList::CullList" ref="CullList_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">CullList::CullList           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor. 
<p>
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>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<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>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void CullList::AddItem           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>user</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="namespaceirc.html#string">std::string</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>reason</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Adds a user to the cull list for later removal via QUIT. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>user</em>&nbsp;</td><td>The user to add </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>reason</em>&nbsp;</td><td>The quit reason of the user being added</td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="Apply_28_29"></a><!-- doxytag: member="CullList::Apply" ref="Apply_28_29" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">int CullList::Apply           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Applies the cull list, quitting all the users on the list with their quit reasons all at once. 
<p>
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>
    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="exempt"></a><!-- doxytag: member="CullList::exempt" ref="exempt" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <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>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A list of users who have already been placed on the list, as a map for fast reference. 
<p>

<p>
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>
  </tr>
</table>
<a class="anchor" name="list"></a><!-- doxytag: member="CullList::list" ref="list" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <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>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Holds a list of users being quit. 
<p>
See the information for <a class="el" href="classCullItem.html">CullItem</a> for more information.
<p>
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>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="cull__list_8h-source.html">cull_list.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Dec 19 18:05:21 2005 for InspIRCd by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
</body>
</html>