-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskSched_8h_source.html
223 lines (221 loc) · 39.2 KB
/
TaskSched_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
<!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: TaskSched.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">TaskSched.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="TaskSched_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 TASKSCHED_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define TASKSCHED_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> <span class="comment">//#define DEBUGA 1</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include "Arduino.h"</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">//#include <list></span></div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="TaskSched_8h.html#a83b2ce05d430d1a2f8a71ff58c91f768"> 7</a></span> <span class="preprocessor">#define TASK_SECOND 1000</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="TaskSched_8h.html#aa2f4a12f42676450df38b7081016160a"> 8</a></span> <span class="preprocessor">#define TASK_MINUTE 60*TASK_SECOND</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <<a class="code" href="SimpleList_8h.html">SimpleList.h</a>></span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="keyword">class </span><a class="code" href="classTask.html">Task</a>;</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  </div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// was typedef std::function<void(Task *)> voidFuncTypeWith;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  </div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classInitialState.html"> 21</a></span> <span class="keyword">class </span><a class="code" href="classInitialState.html">InitialState</a> {</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">public</span>:</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  </div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classInitialState.html#add03e0c816c38ed3477318ee51a649cf"> 27</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classInitialState.html#add03e0c816c38ed3477318ee51a649cf">mInterval</a>;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classInitialState.html#a0a23c5447f2dadf65baaff2cfa1a274f"> 31</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classInitialState.html#a0a23c5447f2dadf65baaff2cfa1a274f">mEnabled</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classInitialState.html#a31fee8f68667d2a32b5b884cc50aa2f7"> 36</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classInitialState.html#a31fee8f68667d2a32b5b884cc50aa2f7">mRunImmediately</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classInitialState.html#a25cd6538cde791f1897a86f322960293"> 41</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classInitialState.html#a25cd6538cde791f1897a86f322960293">mIterations</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> };</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="TaskSched_8h.html#af001bc1956cf8a883ac2ecb1ff6d8a5e"> 43</a></span> <span class="keyword">using</span> <a class="code" href="classInitialState.html">savedInitial</a> = <a class="code" href="classInitialState.html">InitialState</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classTask.html"> 80</a></span> <span class="keyword">class </span><a class="code" href="classTask.html">Task</a> {</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordtype">void</span> runIt();</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// make Sched a friend so it can call a private method, runIt</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classTask.html#a1c394471833feb83c62bedb9ee3c0c50"> 88</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classSched.html">Sched</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// Function pointer types</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classTask.html#a435853ebd95761dec95313b38bc5056e"> 92</a></span>  <span class="keyword">typedef</span> void (*<a class="code" href="classTask.html#a435853ebd95761dec95313b38bc5056e">TaskCallback</a>)(<a class="code" href="classTask.html">Task</a>*);</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classTask.html#a1670163c179fbfa1615666e79536567a"> 93</a></span>  <span class="keyword">typedef</span> void (*<a class="code" href="classTask.html#a1670163c179fbfa1615666e79536567a">VoidCallback</a>)();</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <a class="code" href="classTask.html#a6e716982f852ca3c0a6bed04fefc7503">Task</a>(<a class="code" href="classTask.html#a435853ebd95761dec95313b38bc5056e">TaskCallback</a> func, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> interval = 5000, <span class="keywordtype">bool</span> enabled = <span class="keyword">false</span>,</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">int</span> iterations = 0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = <span class="stringliteral">"Unk"</span>, <span class="keywordtype">bool</span> runImmediately = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="comment">// Constructor for callback without Task pointer</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="classTask.html#a6e716982f852ca3c0a6bed04fefc7503">Task</a>(<a class="code" href="classTask.html#a1670163c179fbfa1615666e79536567a">VoidCallback</a> func, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> interval = 5000, <span class="keywordtype">bool</span> enabled = <span class="keyword">false</span>,</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordtype">int</span> iterations = 0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = <span class="stringliteral">"Unk"</span>, <span class="keywordtype">bool</span> runImmediately = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <a class="code" href="classTask.html#a435853ebd95761dec95313b38bc5056e">TaskCallback</a> mProcWithTask;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <a class="code" href="classTask.html#a1670163c179fbfa1615666e79536567a">VoidCallback</a> mProcVoid;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordtype">bool</span> mWithTaskPtr;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mInterval;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordtype">bool</span> mEnabled;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mIterations;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  String mName;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordtype">bool</span> mRunImmediately;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mIterationCount;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordtype">bool</span> doShow=<span class="keyword">true</span>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mLastStartTime;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="code" href="classInitialState.html">savedInitial</a> mOrig;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordtype">bool</span> <a class="code" href="classTask.html#abe0b84aae9c9451e5f8fcc3b83db75da">isFirstIteration</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordtype">bool</span> <a class="code" href="classTask.html#a65d7536e356a090b5d19b53142827cd2">isLastIteration</a>(); </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classTask.html#a5d181709781ebfcce5a3a859e3040cb3"> 180</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classTask.html#a5d181709781ebfcce5a3a859e3040cb3">fRunImmediately</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#ace39d4e7795006d1f27d59f0b26d900c">restart</a>(); </div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#ae98967d438138cce890d6520e0b5426c">enable</a>(); </div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#ae1b427d535011c4535b2026d3cd180a9">disable</a>(); </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordtype">bool</span> <a class="code" href="classTask.html#a950d5e6b9cc7e5a6964d8a03f89eeae3">isEnabled</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#ac65cfa01bf9f5fb3c92b7a316e414a48">setCallback</a>(<span class="keyword">const</span> <a class="code" href="classTask.html#a435853ebd95761dec95313b38bc5056e">TaskCallback</a> &callback);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#ac65cfa01bf9f5fb3c92b7a316e414a48">setCallback</a>(<span class="keyword">const</span> <a class="code" href="classTask.html#a1670163c179fbfa1615666e79536567a">VoidCallback</a> &callback);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#a7d1481e4bdb6c9474eac146456a8b2fd">setName</a>(String);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#a44a50f64103623564e81c51a2a54986e">showInit</a>();</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  String <a class="code" href="classTask.html#a54091f59b9aa6f4904c77d8026ae8fd8">getName</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTask.html#a9e2b7786307cfd530dd35a846e003737">getIterationCount</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#a3d62f3a44f863443c9241850664ad25d">setInterval</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> newInterval);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#a40f9473dc1f08a4ea24f75aef59438c3">setIterations</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> newIterations);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordtype">void</span> <a class="code" href="classTask.html#aa2aaa91828a0a47f17fd2499cb495c45">setImmediately</a>(<span class="keywordtype">bool</span>);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  String <a class="code" href="classTask.html#aa3a146045d2a35793040ea93bc5d50f9">showTaskInfo</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTask.html#a1f44e7b1e173afdc8e3d1da6519d1bbe">getInterval</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keywordtype">bool</span> <a class="code" href="classTask.html#a0729a7fe456935706844b2e92f95dc16">getRunImmediately</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classTask.html#aa0f9009d1d4a1afe23245522e1e4d097">getLastStartTime</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keyword">static</span> String <a class="code" href="classTask.html#a6fea462a4230640e52b3d5a6bd4f04b1">formatMS</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> milliseconds);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> };</div>
<div class="line"><a name="l00279"></a><span class="lineno"><a class="line" href="classSched.html"> 279</a></span> <span class="keyword">class </span><a class="code" href="classSched.html">Sched</a></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span> {</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classSched.html#a5fabf124d2c8b0e39470191118c6780e">getSize</a>();</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <a class="code" href="classSched.html#ab0adb29d1a6b05cae3ec6238e8a8e562">Sched</a>();</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordtype">void</span> <a class="code" href="classSched.html#a76421d3e33bc7d6f64a0acc97f9a456d">begin</a>();</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordtype">void</span> <a class="code" href="classSched.html#aaf93c84f24063127d45584eaee3e0e98">addTask</a>(<a class="code" href="classTask.html">Task</a> *task);</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="keywordtype">void</span> <a class="code" href="classSched.html#a6b2336fbcd3680a8b6584dea99736b66">enable</a>();</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="keywordtype">void</span> <a class="code" href="classSched.html#ae3860f1f7ee002d7ced2c130db60f14d">disable</a>();</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordtype">bool</span> <a class="code" href="classSched.html#a4f2f56a7f6fda2d669c96a8dcd45f271">isEnabled</a>();</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keyword">const</span> <a class="code" href="classSimpleList.html">SimpleList<Task *></a>& <a class="code" href="classSched.html#a02d4d4d1d4e2084ead210f0fe1fbbb75">getTasks</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordtype">void</span> <a class="code" href="classSched.html#a95f8b9b08bd39d6a2e9380c0d149bcd4">run</a>();</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  </div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="comment">//SimpleList<Task*> tTasks;</span></div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> <span class="comment"></span> <a class="code" href="classSimpleList.html">SimpleList<Task *></a> tTasks;</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordtype">bool</span> mSchedEnabled;</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> };</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  </div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="comment">/* @param func Function to be called.</span></div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span> <span class="comment"> * @param interval Time between calls to func in milliseconds.</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span> <span class="comment"> * If intval is passed as a floating point number, e. g. 4.5 then it is treated as if it were a number of seconds otherwise the interval is treated as if it were a number of millisconds</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> <span class="comment"> * @param enabled Flag to be set if the task should start in an enabled state.</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span> <span class="comment"> * @param iterations Number of iterations the task will be run. Set to zero for infinited iterations.</span></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span> <span class="comment"> * @param name A String value of a name of the task.</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> <span class="comment"> * @param runImmediately A boolean flag that directs the scheduler to run the callback immediately rather than wait for the interval to expire. False says to wait for the interval to run the task.</span></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span> <span class="preprocessor">#endif</span></div>
<div class="ttc" id="aSimpleList_8h_html"><div class="ttname"><a href="SimpleList_8h.html">SimpleList.h</a></div></div>
<div class="ttc" id="aclassInitialState_html"><div class="ttname"><a href="classInitialState.html">InitialState</a></div><div class="ttdoc">This class holds the initial state of a task.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00021">TaskSched.h:21</a></div></div>
<div class="ttc" id="aclassInitialState_html_a0a23c5447f2dadf65baaff2cfa1a274f"><div class="ttname"><a href="classInitialState.html#a0a23c5447f2dadf65baaff2cfa1a274f">InitialState::mEnabled</a></div><div class="ttdeci">bool mEnabled</div><div class="ttdoc">saved enable flag</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00031">TaskSched.h:31</a></div></div>
<div class="ttc" id="aclassInitialState_html_a25cd6538cde791f1897a86f322960293"><div class="ttname"><a href="classInitialState.html#a25cd6538cde791f1897a86f322960293">InitialState::mIterations</a></div><div class="ttdeci">unsigned long mIterations</div><div class="ttdoc">saved run iterations count</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00041">TaskSched.h:41</a></div></div>
<div class="ttc" id="aclassInitialState_html_a31fee8f68667d2a32b5b884cc50aa2f7"><div class="ttname"><a href="classInitialState.html#a31fee8f68667d2a32b5b884cc50aa2f7">InitialState::mRunImmediately</a></div><div class="ttdeci">bool mRunImmediately</div><div class="ttdoc">saved run immediately flag</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00036">TaskSched.h:36</a></div></div>
<div class="ttc" id="aclassInitialState_html_add03e0c816c38ed3477318ee51a649cf"><div class="ttname"><a href="classInitialState.html#add03e0c816c38ed3477318ee51a649cf">InitialState::mInterval</a></div><div class="ttdeci">unsigned long mInterval</div><div class="ttdoc">This member holds the original interval value.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00027">TaskSched.h:27</a></div></div>
<div class="ttc" id="aclassSched_html"><div class="ttname"><a href="classSched.html">Sched</a></div><div class="ttdoc">This class runs the scheduled tasks.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00279">TaskSched.h:280</a></div></div>
<div class="ttc" id="aclassSched_html_a02d4d4d1d4e2084ead210f0fe1fbbb75"><div class="ttname"><a href="classSched.html#a02d4d4d1d4e2084ead210f0fe1fbbb75">Sched::getTasks</a></div><div class="ttdeci">const SimpleList< Task * > & getTasks() const</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00290">TaskSched.cpp:290</a></div></div>
<div class="ttc" id="aclassSched_html_a4f2f56a7f6fda2d669c96a8dcd45f271"><div class="ttname"><a href="classSched.html#a4f2f56a7f6fda2d669c96a8dcd45f271">Sched::isEnabled</a></div><div class="ttdeci">bool isEnabled()</div><div class="ttdoc">return true if the scheduler is enabled</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00259">TaskSched.cpp:259</a></div></div>
<div class="ttc" id="aclassSched_html_a5fabf124d2c8b0e39470191118c6780e"><div class="ttname"><a href="classSched.html#a5fabf124d2c8b0e39470191118c6780e">Sched::getSize</a></div><div class="ttdeci">unsigned long getSize()</div><div class="ttdoc">return the number of tasks in the run queue</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00233">TaskSched.cpp:233</a></div></div>
<div class="ttc" id="aclassSched_html_a6b2336fbcd3680a8b6584dea99736b66"><div class="ttname"><a href="classSched.html#a6b2336fbcd3680a8b6584dea99736b66">Sched::enable</a></div><div class="ttdeci">void enable()</div><div class="ttdoc">enable the scheduler</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00253">TaskSched.cpp:253</a></div></div>
<div class="ttc" id="aclassSched_html_a76421d3e33bc7d6f64a0acc97f9a456d"><div class="ttname"><a href="classSched.html#a76421d3e33bc7d6f64a0acc97f9a456d">Sched::begin</a></div><div class="ttdeci">void begin()</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00241">TaskSched.cpp:241</a></div></div>
<div class="ttc" id="aclassSched_html_a95f8b9b08bd39d6a2e9380c0d149bcd4"><div class="ttname"><a href="classSched.html#a95f8b9b08bd39d6a2e9380c0d149bcd4">Sched::run</a></div><div class="ttdeci">void run()</div><div class="ttdoc">called perodically to check if a task should be scheduled</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00265">TaskSched.cpp:265</a></div></div>
<div class="ttc" id="aclassSched_html_aaf93c84f24063127d45584eaee3e0e98"><div class="ttname"><a href="classSched.html#aaf93c84f24063127d45584eaee3e0e98">Sched::addTask</a></div><div class="ttdeci">void addTask(Task *task)</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00244">TaskSched.cpp:244</a></div></div>
<div class="ttc" id="aclassSched_html_ab0adb29d1a6b05cae3ec6238e8a8e562"><div class="ttname"><a href="classSched.html#ab0adb29d1a6b05cae3ec6238e8a8e562">Sched::Sched</a></div><div class="ttdeci">Sched()</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00238">TaskSched.cpp:238</a></div></div>
<div class="ttc" id="aclassSched_html_ae3860f1f7ee002d7ced2c130db60f14d"><div class="ttname"><a href="classSched.html#ae3860f1f7ee002d7ced2c130db60f14d">Sched::disable</a></div><div class="ttdeci">void disable()</div><div class="ttdoc">disable the scheduler</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00256">TaskSched.cpp:256</a></div></div>
<div class="ttc" id="aclassSimpleList_html"><div class="ttname"><a href="classSimpleList.html">SimpleList< Task * ></a></div></div>
<div class="ttc" id="aclassTask_html"><div class="ttname"><a href="classTask.html">Task</a></div><div class="ttdoc">Represents a schedulable task.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00080">TaskSched.h:80</a></div></div>
<div class="ttc" id="aclassTask_html_a0729a7fe456935706844b2e92f95dc16"><div class="ttname"><a href="classTask.html#a0729a7fe456935706844b2e92f95dc16">Task::getRunImmediately</a></div><div class="ttdeci">bool getRunImmediately(void) const</div><div class="ttdoc">return the run immediately flag</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00178">TaskSched.cpp:178</a></div></div>
<div class="ttc" id="aclassTask_html_a1670163c179fbfa1615666e79536567a"><div class="ttname"><a href="classTask.html#a1670163c179fbfa1615666e79536567a">Task::VoidCallback</a></div><div class="ttdeci">void(* VoidCallback)()</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00093">TaskSched.h:93</a></div></div>
<div class="ttc" id="aclassTask_html_a1f44e7b1e173afdc8e3d1da6519d1bbe"><div class="ttname"><a href="classTask.html#a1f44e7b1e173afdc8e3d1da6519d1bbe">Task::getInterval</a></div><div class="ttdeci">unsigned long getInterval(void) const</div><div class="ttdoc">return the task interval</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00183">TaskSched.cpp:183</a></div></div>
<div class="ttc" id="aclassTask_html_a3d62f3a44f863443c9241850664ad25d"><div class="ttname"><a href="classTask.html#a3d62f3a44f863443c9241850664ad25d">Task::setInterval</a></div><div class="ttdeci">void setInterval(unsigned long newInterval)</div><div class="ttdoc">function to set a new interval</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00173">TaskSched.cpp:173</a></div></div>
<div class="ttc" id="aclassTask_html_a40f9473dc1f08a4ea24f75aef59438c3"><div class="ttname"><a href="classTask.html#a40f9473dc1f08a4ea24f75aef59438c3">Task::setIterations</a></div><div class="ttdeci">void setIterations(unsigned long newIterations)</div><div class="ttdoc">function to set a new iterations value</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00168">TaskSched.cpp:168</a></div></div>
<div class="ttc" id="aclassTask_html_a435853ebd95761dec95313b38bc5056e"><div class="ttname"><a href="classTask.html#a435853ebd95761dec95313b38bc5056e">Task::TaskCallback</a></div><div class="ttdeci">void(* TaskCallback)(Task *)</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8h_source.html#l00092">TaskSched.h:92</a></div></div>
<div class="ttc" id="aclassTask_html_a44a50f64103623564e81c51a2a54986e"><div class="ttname"><a href="classTask.html#a44a50f64103623564e81c51a2a54986e">Task::showInit</a></div><div class="ttdeci">void showInit()</div><div class="ttdoc">display stuff</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00072">TaskSched.cpp:72</a></div></div>
<div class="ttc" id="aclassTask_html_a54091f59b9aa6f4904c77d8026ae8fd8"><div class="ttname"><a href="classTask.html#a54091f59b9aa6f4904c77d8026ae8fd8">Task::getName</a></div><div class="ttdeci">String getName() const</div><div class="ttdoc">return string containing name of task</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00050">TaskSched.cpp:50</a></div></div>
<div class="ttc" id="aclassTask_html_a5d181709781ebfcce5a3a859e3040cb3"><div class="ttname"><a href="classTask.html#a5d181709781ebfcce5a3a859e3040cb3">Task::fRunImmediately</a></div><div class="ttdeci">bool fRunImmediately()</div><div class="ttdoc">return true if the run immediately flag is set</div></div>
<div class="ttc" id="aclassTask_html_a65d7536e356a090b5d19b53142827cd2"><div class="ttname"><a href="classTask.html#a65d7536e356a090b5d19b53142827cd2">Task::isLastIteration</a></div><div class="ttdeci">bool isLastIteration()</div><div class="ttdoc">return true if this is the last iteration</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00055">TaskSched.cpp:55</a></div></div>
<div class="ttc" id="aclassTask_html_a6e716982f852ca3c0a6bed04fefc7503"><div class="ttname"><a href="classTask.html#a6e716982f852ca3c0a6bed04fefc7503">Task::Task</a></div><div class="ttdeci">Task(TaskCallback func, unsigned long interval=5000, bool enabled=false, int iterations=0, const char *name="Unk", bool runImmediately=false)</div><div class="ttdoc">Constructs a new Task.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00007">TaskSched.cpp:7</a></div></div>
<div class="ttc" id="aclassTask_html_a6fea462a4230640e52b3d5a6bd4f04b1"><div class="ttname"><a href="classTask.html#a6fea462a4230640e52b3d5a6bd4f04b1">Task::formatMS</a></div><div class="ttdeci">static String formatMS(unsigned long milliseconds)</div><div class="ttdoc">return a string with a formatted time</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00087">TaskSched.cpp:87</a></div></div>
<div class="ttc" id="aclassTask_html_a7d1481e4bdb6c9474eac146456a8b2fd"><div class="ttname"><a href="classTask.html#a7d1481e4bdb6c9474eac146456a8b2fd">Task::setName</a></div><div class="ttdeci">void setName(String)</div><div class="ttdoc">give the task a new name</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00159">TaskSched.cpp:159</a></div></div>
<div class="ttc" id="aclassTask_html_a950d5e6b9cc7e5a6964d8a03f89eeae3"><div class="ttname"><a href="classTask.html#a950d5e6b9cc7e5a6964d8a03f89eeae3">Task::isEnabled</a></div><div class="ttdeci">bool isEnabled() const</div><div class="ttdoc">return true if task is enabled</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00124">TaskSched.cpp:124</a></div></div>
<div class="ttc" id="aclassTask_html_a9e2b7786307cfd530dd35a846e003737"><div class="ttname"><a href="classTask.html#a9e2b7786307cfd530dd35a846e003737">Task::getIterationCount</a></div><div class="ttdeci">unsigned long getIterationCount() const</div><div class="ttdoc">return the iteration count, that is the number of iterations that the task has been run</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00193">TaskSched.cpp:193</a></div></div>
<div class="ttc" id="aclassTask_html_aa0f9009d1d4a1afe23245522e1e4d097"><div class="ttname"><a href="classTask.html#aa0f9009d1d4a1afe23245522e1e4d097">Task::getLastStartTime</a></div><div class="ttdeci">unsigned long getLastStartTime(void) const</div><div class="ttdoc">return the last start time flag</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00188">TaskSched.cpp:188</a></div></div>
<div class="ttc" id="aclassTask_html_aa2aaa91828a0a47f17fd2499cb495c45"><div class="ttname"><a href="classTask.html#aa2aaa91828a0a47f17fd2499cb495c45">Task::setImmediately</a></div><div class="ttdeci">void setImmediately(bool)</div><div class="ttdoc">function to set the run immediately flag</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00163">TaskSched.cpp:163</a></div></div>
<div class="ttc" id="aclassTask_html_aa3a146045d2a35793040ea93bc5d50f9"><div class="ttname"><a href="classTask.html#aa3a146045d2a35793040ea93bc5d50f9">Task::showTaskInfo</a></div><div class="ttdeci">String showTaskInfo() const</div><div class="ttdoc">function that displays task info</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00102">TaskSched.cpp:102</a></div></div>
<div class="ttc" id="aclassTask_html_abe0b84aae9c9451e5f8fcc3b83db75da"><div class="ttname"><a href="classTask.html#abe0b84aae9c9451e5f8fcc3b83db75da">Task::isFirstIteration</a></div><div class="ttdeci">bool isFirstIteration()</div><div class="ttdoc">return true if this is the first iteration</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00043">TaskSched.cpp:43</a></div></div>
<div class="ttc" id="aclassTask_html_ac65cfa01bf9f5fb3c92b7a316e414a48"><div class="ttname"><a href="classTask.html#ac65cfa01bf9f5fb3c92b7a316e414a48">Task::setCallback</a></div><div class="ttdeci">void setCallback(const TaskCallback &callback)</div><div class="ttdoc">Sets a new callback function for the task.</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00154">TaskSched.cpp:154</a></div></div>
<div class="ttc" id="aclassTask_html_ace39d4e7795006d1f27d59f0b26d900c"><div class="ttname"><a href="classTask.html#ace39d4e7795006d1f27d59f0b26d900c">Task::restart</a></div><div class="ttdeci">void restart()</div><div class="ttdoc">restart the task with the original parameters, Enable is not restored</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00137">TaskSched.cpp:137</a></div></div>
<div class="ttc" id="aclassTask_html_ae1b427d535011c4535b2026d3cd180a9"><div class="ttname"><a href="classTask.html#ae1b427d535011c4535b2026d3cd180a9">Task::disable</a></div><div class="ttdeci">void disable()</div><div class="ttdoc">disable the task</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00066">TaskSched.cpp:66</a></div></div>
<div class="ttc" id="aclassTask_html_ae98967d438138cce890d6520e0b5426c"><div class="ttname"><a href="classTask.html#ae98967d438138cce890d6520e0b5426c">Task::enable</a></div><div class="ttdeci">void enable()</div><div class="ttdoc">enable the task</div><div class="ttdef"><b>Definition:</b> <a href="TaskSched_8cpp_source.html#l00128">TaskSched.cpp:128</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>