-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleList_8h_source.html
242 lines (240 loc) · 39.8 KB
/
SimpleList_8h_source.html
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TaskSched: SimpleList.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">TaskSched
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">SimpleList.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="SimpleList_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef SIMPLE_LIST_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define SIMPLE_LIST_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>  </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="keyword">template</span><<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="classSimpleList.html"> 11</a></span> <span class="keyword">class </span><a class="code" href="classSimpleList.html">SimpleList</a> {</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="keyword">private</span>:</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  <span class="keyword">struct </span>Node {</div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  T data; </div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  Node* next; </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  Node(<span class="keyword">const</span> T& value) : data(value), next(<span class="keyword">nullptr</span>) {}</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  };</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  Node* head; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  Node* tail; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keyword">mutable</span> Node* read_position; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordtype">size_t</span> size; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">public</span>:</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classSimpleList.html#aa152563df888020b167cb79a466438fe"> 37</a></span>  <a class="code" href="classSimpleList.html#aa152563df888020b167cb79a466438fe">SimpleList</a>() : head(nullptr), tail(nullptr), read_position(nullptr), size(0) {}</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classSimpleList.html#a9bca7f13518a50bfd0e68efe0e19148a"> 42</a></span>  <a class="code" href="classSimpleList.html#a9bca7f13518a50bfd0e68efe0e19148a">~SimpleList</a>() {</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="classSimpleList.html#ad3994e1a7ea53736544a19b579882032">clear</a>();</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  }</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classSimpleList.html#a02211bf8584c6f0f4c802d46edd08691"> 51</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimpleList.html#a02211bf8584c6f0f4c802d46edd08691">push_back</a>(<span class="keyword">const</span> T& value) {</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  Node* new_node = <span class="keyword">new</span> Node(value);</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">if</span> (!head) {</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  head = tail = read_position = new_node;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  tail->next = new_node;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  tail = new_node;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  ++size;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  }</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classSimpleList.html#a6139229999e698847399b0e4b9a31874"> 65</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimpleList.html#a6139229999e698847399b0e4b9a31874">pop_front</a>() {</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">if</span> (head) {</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  Node* temp = head;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  head = head->next;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keywordflow">if</span> (read_position == temp) {</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  read_position = head;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  }</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keyword">delete</span> temp;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  --size;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (!head) {</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  tail = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  read_position = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  }</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  }</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classSimpleList.html#ab5bae80a06c4850a218bcafc89a5cf9f"> 86</a></span>  T <a class="code" href="classSimpleList.html#ab5bae80a06c4850a218bcafc89a5cf9f">read</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">if</span> (read_position) {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  T value = read_position->data;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  read_position = read_position->next;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">return</span> value;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  }</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">return</span> T(); <span class="comment">// Return empty T</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  }</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classSimpleList.html#a88f576c0568402eada731527cb3deda8"> 98</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimpleList.html#a88f576c0568402eada731527cb3deda8">rewind</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  read_position = head;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  </div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classSimpleList.html#a235920658b87922c5db6a6d002ec8425"> 107</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classSimpleList.html#a235920658b87922c5db6a6d002ec8425">is_exhausted</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">return</span> read_position == <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  }</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classSimpleList.html#a0e9a7d85cd9b5143badc1c00aee71dd6"> 116</a></span>  <span class="keywordtype">size_t</span> <a class="code" href="classSimpleList.html#a0e9a7d85cd9b5143badc1c00aee71dd6">get_size</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">return</span> size;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classSimpleList.html#ad3994e1a7ea53736544a19b579882032"> 123</a></span>  <span class="keywordtype">void</span> <a class="code" href="classSimpleList.html#ad3994e1a7ea53736544a19b579882032">clear</a>() {</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">while</span> (head) {</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  Node* temp = head;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  head = head->next;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keyword">delete</span> temp;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  }</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  tail = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  read_position = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  size = 0;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  }</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  </div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html"> 137</a></span>  <span class="keyword">class </span><a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a> {</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keyword">const</span> Node* current; </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a036e5241645845592f9d7b6c3baed7a6"> 145</a></span>  <a class="code" href="classSimpleList_1_1const__iterator.html#a036e5241645845592f9d7b6c3baed7a6">const_iterator</a>() : current(nullptr) {}</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a94e7e30cdf9e352210546b305552f067"> 152</a></span>  <span class="keyword">explicit</span> <a class="code" href="classSimpleList_1_1const__iterator.html#a94e7e30cdf9e352210546b305552f067">const_iterator</a>(<span class="keyword">const</span> Node* node) : current(node) {}</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a2b8ff021883473c10850ad18723138ef"> 159</a></span>  <span class="keyword">const</span> T& <a class="code" href="classSimpleList_1_1const__iterator.html#a2b8ff021883473c10850ad18723138ef">operator*</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current->data; }</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  </div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a4225910b9844d1c598965acaaa4097ca"> 166</a></span>  <span class="keyword">const</span> T* <a class="code" href="classSimpleList_1_1const__iterator.html#a4225910b9844d1c598965acaaa4097ca">operator-></a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> &current->data; }</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  </div>
<div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#afe5fd3320138bec1ec8007470d0499a5"> 173</a></span>  <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a>& <a class="code" href="classSimpleList_1_1const__iterator.html#afe5fd3320138bec1ec8007470d0499a5">operator++</a>() { <span class="keywordflow">if</span> (current) current = current->next; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a795a5e7b8fda9c6916fe59995b3f09f9"> 180</a></span>  <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classSimpleList_1_1const__iterator.html#a795a5e7b8fda9c6916fe59995b3f09f9">operator++</a>(<span class="keywordtype">int</span>) { <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a> tmp = *<span class="keyword">this</span>; ++(*this); <span class="keywordflow">return</span> tmp; }</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  </div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#a31e6257aae23d28aa91536a47abc22d9"> 188</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classSimpleList_1_1const__iterator.html#a31e6257aae23d28aa91536a47abc22d9">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current != other.current; }</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  </div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="classSimpleList_1_1const__iterator.html#ad856d69271894bcefd5940fb47b47168"> 196</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classSimpleList_1_1const__iterator.html#ad856d69271894bcefd5940fb47b47168">operator==</a>(<span class="keyword">const</span> <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current == other.current; }</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  };</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  </div>
<div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="classSimpleList.html#a3b387d4f811d1f5317cf201d5e5b6548"> 204</a></span>  <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classSimpleList.html#a3b387d4f811d1f5317cf201d5e5b6548">cbegin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a>(head); }</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  </div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="classSimpleList.html#adbf5dc4e7de1e9ddc370f60c07dcb451"> 211</a></span>  <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a> <a class="code" href="classSimpleList.html#adbf5dc4e7de1e9ddc370f60c07dcb451">cend</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classSimpleList_1_1const__iterator.html">const_iterator</a>(<span class="keyword">nullptr</span>); }</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html"> 213</a></span>  <span class="keyword">class </span><a class="code" href="classSimpleList_1_1iterator.html">iterator</a> {</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  Node* current; </div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  </div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a16eb08e50f91f351f9e4e5ebf0d2b299"> 221</a></span>  <a class="code" href="classSimpleList_1_1iterator.html#a16eb08e50f91f351f9e4e5ebf0d2b299">iterator</a>() : current(nullptr) {}</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  </div>
<div class="line"><a name="l00228"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a1529bf0def4edacbe98917138b6e6412"> 228</a></span>  <a class="code" href="classSimpleList_1_1iterator.html#a1529bf0def4edacbe98917138b6e6412">iterator</a>(Node* node) : current(node) {}</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a27bfddb190934c0277da148eedc65c1b"> 235</a></span>  T& <a class="code" href="classSimpleList_1_1iterator.html#a27bfddb190934c0277da148eedc65c1b">operator*</a>() { <span class="keywordflow">return</span> current->data; }</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#aba01f9e797324592f34fa6bf52025b9f"> 242</a></span>  T* <a class="code" href="classSimpleList_1_1iterator.html#aba01f9e797324592f34fa6bf52025b9f">operator-></a>() { <span class="keywordflow">return</span> &current->data; }</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  </div>
<div class="line"><a name="l00249"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a4f976a98d4621a6eea5a31ddb21378d6"> 249</a></span>  <a class="code" href="classSimpleList_1_1iterator.html">iterator</a>& <a class="code" href="classSimpleList_1_1iterator.html#a4f976a98d4621a6eea5a31ddb21378d6">operator++</a>() { <span class="keywordflow">if</span> (current) current = current->next; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div>
<div class="line"><a name="l00257"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a2e1cd83e5cb65cd4c4d6e0e3e59c8122"> 257</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classSimpleList_1_1iterator.html#a2e1cd83e5cb65cd4c4d6e0e3e59c8122">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSimpleList_1_1iterator.html">iterator</a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current != other.current; }</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  </div>
<div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="classSimpleList_1_1iterator.html#a06cc6563fbf5658b3033085e8f9c4a61"> 265</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classSimpleList_1_1iterator.html#a06cc6563fbf5658b3033085e8f9c4a61">operator==</a>(<span class="keyword">const</span> <a class="code" href="classSimpleList_1_1iterator.html">iterator</a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> current == other.current; }</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  };</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  </div>
<div class="line"><a name="l00273"></a><span class="lineno"><a class="line" href="classSimpleList.html#a70b225796579f3c9edc799abf2f63b8e"> 273</a></span>  <a class="code" href="classSimpleList_1_1iterator.html">iterator</a> <a class="code" href="classSimpleList.html#a70b225796579f3c9edc799abf2f63b8e">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classSimpleList_1_1iterator.html">iterator</a>(head); }</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  </div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classSimpleList.html#ae7f774f3a9d6f673e2286c21970d8209"> 280</a></span>  <a class="code" href="classSimpleList_1_1iterator.html">iterator</a> <a class="code" href="classSimpleList.html#ae7f774f3a9d6f673e2286c21970d8209">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classSimpleList_1_1iterator.html">iterator</a>(<span class="keyword">nullptr</span>); }</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span> };</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  </div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span> <span class="preprocessor">#endif </span><span class="comment">// SIMPLE_LIST_H</span></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html">SimpleList::const_iterator</a></div><div class="ttdoc">Iterator class for SimpleList.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00137">SimpleList.h:137</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a036e5241645845592f9d7b6c3baed7a6"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a036e5241645845592f9d7b6c3baed7a6">SimpleList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator()</div><div class="ttdoc">Construct a new const_iterator object.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00145">SimpleList.h:145</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a2b8ff021883473c10850ad18723138ef"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a2b8ff021883473c10850ad18723138ef">SimpleList::const_iterator::operator*</a></div><div class="ttdeci">const T & operator*() const</div><div class="ttdoc">Dereference operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00159">SimpleList.h:159</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a31e6257aae23d28aa91536a47abc22d9"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a31e6257aae23d28aa91536a47abc22d9">SimpleList::const_iterator::operator!=</a></div><div class="ttdeci">bool operator!=(const const_iterator &other) const</div><div class="ttdoc">Inequality comparison operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00188">SimpleList.h:188</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a4225910b9844d1c598965acaaa4097ca"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a4225910b9844d1c598965acaaa4097ca">SimpleList::const_iterator::operator-></a></div><div class="ttdeci">const T * operator->() const</div><div class="ttdoc">Arrow operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00166">SimpleList.h:166</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a795a5e7b8fda9c6916fe59995b3f09f9"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a795a5e7b8fda9c6916fe59995b3f09f9">SimpleList::const_iterator::operator++</a></div><div class="ttdeci">const_iterator operator++(int)</div><div class="ttdoc">Postfix increment operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00180">SimpleList.h:180</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_a94e7e30cdf9e352210546b305552f067"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#a94e7e30cdf9e352210546b305552f067">SimpleList::const_iterator::const_iterator</a></div><div class="ttdeci">const_iterator(const Node *node)</div><div class="ttdoc">Construct a new const_iterator object.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00152">SimpleList.h:152</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_ad856d69271894bcefd5940fb47b47168"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#ad856d69271894bcefd5940fb47b47168">SimpleList::const_iterator::operator==</a></div><div class="ttdeci">bool operator==(const const_iterator &other) const</div><div class="ttdoc">Equality comparison operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00196">SimpleList.h:196</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1const__iterator_html_afe5fd3320138bec1ec8007470d0499a5"><div class="ttname"><a href="classSimpleList_1_1const__iterator.html#afe5fd3320138bec1ec8007470d0499a5">SimpleList::const_iterator::operator++</a></div><div class="ttdeci">const_iterator & operator++()</div><div class="ttdoc">Prefix increment operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00173">SimpleList.h:173</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html"><div class="ttname"><a href="classSimpleList_1_1iterator.html">SimpleList::iterator</a></div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00213">SimpleList.h:213</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a06cc6563fbf5658b3033085e8f9c4a61"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a06cc6563fbf5658b3033085e8f9c4a61">SimpleList::iterator::operator==</a></div><div class="ttdeci">bool operator==(const iterator &other) const</div><div class="ttdoc">Equality comparison operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00265">SimpleList.h:265</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a1529bf0def4edacbe98917138b6e6412"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a1529bf0def4edacbe98917138b6e6412">SimpleList::iterator::iterator</a></div><div class="ttdeci">iterator(Node *node)</div><div class="ttdoc">Construct a new iterator object.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00228">SimpleList.h:228</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a16eb08e50f91f351f9e4e5ebf0d2b299"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a16eb08e50f91f351f9e4e5ebf0d2b299">SimpleList::iterator::iterator</a></div><div class="ttdeci">iterator()</div><div class="ttdoc">Construct a new iterator object.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00221">SimpleList.h:221</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a27bfddb190934c0277da148eedc65c1b"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a27bfddb190934c0277da148eedc65c1b">SimpleList::iterator::operator*</a></div><div class="ttdeci">T & operator*()</div><div class="ttdoc">Dereference operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00235">SimpleList.h:235</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a2e1cd83e5cb65cd4c4d6e0e3e59c8122"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a2e1cd83e5cb65cd4c4d6e0e3e59c8122">SimpleList::iterator::operator!=</a></div><div class="ttdeci">bool operator!=(const iterator &other) const</div><div class="ttdoc">Inequality comparison operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00257">SimpleList.h:257</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_a4f976a98d4621a6eea5a31ddb21378d6"><div class="ttname"><a href="classSimpleList_1_1iterator.html#a4f976a98d4621a6eea5a31ddb21378d6">SimpleList::iterator::operator++</a></div><div class="ttdeci">iterator & operator++()</div><div class="ttdoc">Prefix increment operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00249">SimpleList.h:249</a></div></div>
<div class="ttc" id="aclassSimpleList_1_1iterator_html_aba01f9e797324592f34fa6bf52025b9f"><div class="ttname"><a href="classSimpleList_1_1iterator.html#aba01f9e797324592f34fa6bf52025b9f">SimpleList::iterator::operator-></a></div><div class="ttdeci">T * operator->()</div><div class="ttdoc">Arrow operator.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00242">SimpleList.h:242</a></div></div>
<div class="ttc" id="aclassSimpleList_html"><div class="ttname"><a href="classSimpleList.html">SimpleList</a></div><div class="ttdoc">A simple linked list implementation.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00011">SimpleList.h:11</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a02211bf8584c6f0f4c802d46edd08691"><div class="ttname"><a href="classSimpleList.html#a02211bf8584c6f0f4c802d46edd08691">SimpleList::push_back</a></div><div class="ttdeci">void push_back(const T &value)</div><div class="ttdoc">Add a new element to the end of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00051">SimpleList.h:51</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a0e9a7d85cd9b5143badc1c00aee71dd6"><div class="ttname"><a href="classSimpleList.html#a0e9a7d85cd9b5143badc1c00aee71dd6">SimpleList::get_size</a></div><div class="ttdeci">size_t get_size() const</div><div class="ttdoc">Get the number of elements in the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00116">SimpleList.h:116</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a235920658b87922c5db6a6d002ec8425"><div class="ttname"><a href="classSimpleList.html#a235920658b87922c5db6a6d002ec8425">SimpleList::is_exhausted</a></div><div class="ttdeci">bool is_exhausted() const</div><div class="ttdoc">Check if all elements have been read.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00107">SimpleList.h:107</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a3b387d4f811d1f5317cf201d5e5b6548"><div class="ttname"><a href="classSimpleList.html#a3b387d4f811d1f5317cf201d5e5b6548">SimpleList::cbegin</a></div><div class="ttdeci">const_iterator cbegin() const</div><div class="ttdoc">Get a const_iterator pointing to the beginning of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00204">SimpleList.h:204</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a6139229999e698847399b0e4b9a31874"><div class="ttname"><a href="classSimpleList.html#a6139229999e698847399b0e4b9a31874">SimpleList::pop_front</a></div><div class="ttdeci">void pop_front()</div><div class="ttdoc">Remove the first element from the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00065">SimpleList.h:65</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a70b225796579f3c9edc799abf2f63b8e"><div class="ttname"><a href="classSimpleList.html#a70b225796579f3c9edc799abf2f63b8e">SimpleList::begin</a></div><div class="ttdeci">iterator begin() const</div><div class="ttdoc">Get an iterator pointing to the beginning of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00273">SimpleList.h:273</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a88f576c0568402eada731527cb3deda8"><div class="ttname"><a href="classSimpleList.html#a88f576c0568402eada731527cb3deda8">SimpleList::rewind</a></div><div class="ttdeci">void rewind() const</div><div class="ttdoc">Reset the read position to the beginning of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00098">SimpleList.h:98</a></div></div>
<div class="ttc" id="aclassSimpleList_html_a9bca7f13518a50bfd0e68efe0e19148a"><div class="ttname"><a href="classSimpleList.html#a9bca7f13518a50bfd0e68efe0e19148a">SimpleList::~SimpleList</a></div><div class="ttdeci">~SimpleList()</div><div class="ttdoc">Destroy the SimpleList object and free all allocated memory.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00042">SimpleList.h:42</a></div></div>
<div class="ttc" id="aclassSimpleList_html_aa152563df888020b167cb79a466438fe"><div class="ttname"><a href="classSimpleList.html#aa152563df888020b167cb79a466438fe">SimpleList::SimpleList</a></div><div class="ttdeci">SimpleList()</div><div class="ttdoc">Construct a new empty SimpleList object.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00037">SimpleList.h:37</a></div></div>
<div class="ttc" id="aclassSimpleList_html_ab5bae80a06c4850a218bcafc89a5cf9f"><div class="ttname"><a href="classSimpleList.html#ab5bae80a06c4850a218bcafc89a5cf9f">SimpleList::read</a></div><div class="ttdeci">T read() const</div><div class="ttdoc">Read the current element and move the read position to the next element.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00086">SimpleList.h:86</a></div></div>
<div class="ttc" id="aclassSimpleList_html_ad3994e1a7ea53736544a19b579882032"><div class="ttname"><a href="classSimpleList.html#ad3994e1a7ea53736544a19b579882032">SimpleList::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Remove all elements from the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00123">SimpleList.h:123</a></div></div>
<div class="ttc" id="aclassSimpleList_html_adbf5dc4e7de1e9ddc370f60c07dcb451"><div class="ttname"><a href="classSimpleList.html#adbf5dc4e7de1e9ddc370f60c07dcb451">SimpleList::cend</a></div><div class="ttdeci">const_iterator cend() const</div><div class="ttdoc">Get a const_iterator pointing to the end of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00211">SimpleList.h:211</a></div></div>
<div class="ttc" id="aclassSimpleList_html_ae7f774f3a9d6f673e2286c21970d8209"><div class="ttname"><a href="classSimpleList.html#ae7f774f3a9d6f673e2286c21970d8209">SimpleList::end</a></div><div class="ttdeci">iterator end() const</div><div class="ttdoc">Get an iterator pointing to the end of the list.</div><div class="ttdef"><b>Definition:</b> <a href="SimpleList_8h_source.html#l00280">SimpleList.h:280</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>