<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/> <title>Async: AsyncTimer.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_d583404e3b046262ade615a4e7154c3b.html">include</a> </div> </div> <div class="contents"> <h1>AsyncTimer.h</h1><a href="AsyncTimer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00037"></a>00037 <span class="preprocessor">#ifndef ASYNC_TIMER_INCLUDED</span> <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define ASYNC_TIMER_INCLUDED</span> <a name="l00039"></a>00039 <span class="preprocessor"></span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="comment">/****************************************************************************</span> <a name="l00042"></a>00042 <span class="comment"> *</span> <a name="l00043"></a>00043 <span class="comment"> * System Includes</span> <a name="l00044"></a>00044 <span class="comment"> *</span> <a name="l00045"></a>00045 <span class="comment"> ****************************************************************************/</span> <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="preprocessor">#include <sigc++/sigc++.h></span> <a name="l00048"></a>00048 <a name="l00049"></a>00049 <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="comment">/****************************************************************************</span> <a name="l00052"></a>00052 <span class="comment"> *</span> <a name="l00053"></a>00053 <span class="comment"> * Project Includes</span> <a name="l00054"></a>00054 <span class="comment"> *</span> <a name="l00055"></a>00055 <span class="comment"> ****************************************************************************/</span> <a name="l00056"></a>00056 <a name="l00057"></a>00057 <a name="l00058"></a>00058 <a name="l00059"></a>00059 <span class="comment">/****************************************************************************</span> <a name="l00060"></a>00060 <span class="comment"> *</span> <a name="l00061"></a>00061 <span class="comment"> * Local Includes</span> <a name="l00062"></a>00062 <span class="comment"> *</span> <a name="l00063"></a>00063 <span class="comment"> ****************************************************************************/</span> <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="comment">/****************************************************************************</span> <a name="l00068"></a>00068 <span class="comment"> *</span> <a name="l00069"></a>00069 <span class="comment"> * Forward declarations</span> <a name="l00070"></a>00070 <span class="comment"> *</span> <a name="l00071"></a>00071 <span class="comment"> ****************************************************************************/</span> <a name="l00072"></a>00072 <a name="l00073"></a>00073 <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="comment">/****************************************************************************</span> <a name="l00076"></a>00076 <span class="comment"> *</span> <a name="l00077"></a>00077 <span class="comment"> * Namespace</span> <a name="l00078"></a>00078 <span class="comment"> *</span> <a name="l00079"></a>00079 <span class="comment"> ****************************************************************************/</span> <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keyword">namespace </span>Async <a name="l00082"></a>00082 { <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="comment">/****************************************************************************</span> <a name="l00085"></a>00085 <span class="comment"> *</span> <a name="l00086"></a>00086 <span class="comment"> * Defines & typedefs</span> <a name="l00087"></a>00087 <span class="comment"> *</span> <a name="l00088"></a>00088 <span class="comment"> ****************************************************************************/</span> <a name="l00089"></a>00089 <a name="l00090"></a>00090 <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="comment">/****************************************************************************</span> <a name="l00093"></a>00093 <span class="comment"> *</span> <a name="l00094"></a>00094 <span class="comment"> * Exported Global Variables</span> <a name="l00095"></a>00095 <span class="comment"> *</span> <a name="l00096"></a>00096 <span class="comment"> ****************************************************************************/</span> <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a name="l00099"></a>00099 <a name="l00100"></a>00100 <span class="comment">/****************************************************************************</span> <a name="l00101"></a>00101 <span class="comment"> *</span> <a name="l00102"></a>00102 <span class="comment"> * Class definitions</span> <a name="l00103"></a>00103 <span class="comment"> *</span> <a name="l00104"></a>00104 <span class="comment"> ****************************************************************************/</span> <a name="l00105"></a>00105 <a name="l00116"></a><a class="code" href="classAsync_1_1Timer.html">00116</a> <span class="keyword">class </span><a class="code" href="classAsync_1_1Timer.html" title="A class that produces timer events.">Timer</a> : <span class="keyword">public</span> SigC::Object <a name="l00117"></a>00117 { <a name="l00118"></a>00118 <span class="keyword">public</span>: <a name="l00122"></a><a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4">00122</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00123"></a>00123 { <a name="l00124"></a><a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4ab0979d53c709ad785cbd670b01048203">00124</a> <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4ab0979d53c709ad785cbd670b01048203" title="A timer that expires once.">TYPE_ONESHOT</a>, <a name="l00125"></a><a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4a2fc5ee9add40fddebecf2a009d91255a">00125</a> <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4a2fc5ee9add40fddebecf2a009d91255a" title="A timer that restarts itself every time it expires.">TYPE_PERIODIC</a> <a name="l00126"></a>00126 } <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4" title="The type of the timer.">Type</a>; <a name="l00127"></a>00127 <a name="l00138"></a>00138 <a class="code" href="classAsync_1_1Timer.html#a92d48c80063aa06e7b1b897d8248b76a" title="Constructor.">Timer</a>(<span class="keywordtype">int</span> timeout_ms = 0, <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4" title="The type of the timer.">Type</a> <a class="code" href="classAsync_1_1Timer.html#a6a96c384703dd9dd14c7e2cb30faaf43" title="Return the type of this timer.">type</a> = <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4ab0979d53c709ad785cbd670b01048203" title="A timer that expires once.">TYPE_ONESHOT</a>); <a name="l00139"></a>00139 <a name="l00143"></a>00143 <a class="code" href="classAsync_1_1Timer.html#a2003cbca6220d0067e145190b9e257f0" title="Destructor.">~Timer</a>(<span class="keywordtype">void</span>); <a name="l00144"></a>00144 <a name="l00149"></a><a class="code" href="classAsync_1_1Timer.html#a6a96c384703dd9dd14c7e2cb30faaf43">00149</a> <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4" title="The type of the timer.">Type</a> <a class="code" href="classAsync_1_1Timer.html#a6a96c384703dd9dd14c7e2cb30faaf43" title="Return the type of this timer.">type</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_type; } <a name="l00150"></a>00150 <a name="l00160"></a>00160 <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1Timer.html#a76f34ef1d8de22424ad46683dac07e8d" title="Set (change) the timeout value.">setTimeout</a>(<span class="keywordtype">int</span> timeout_ms); <a name="l00161"></a>00161 <a name="l00166"></a><a class="code" href="classAsync_1_1Timer.html#a2446fb78b6a7f271aaeda61d7b19fbea">00166</a> <span class="keywordtype">int</span> <a class="code" href="classAsync_1_1Timer.html#a2446fb78b6a7f271aaeda61d7b19fbea" title="Return the setting of the timeout value.">timeout</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_timeout_ms; } <a name="l00167"></a>00167 <a name="l00173"></a>00173 <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1Timer.html#ad2b6f5e24b9619c354e2ecf1e21241bc" title="Enable or disable the timer.">setEnable</a>(<span class="keywordtype">bool</span> do_enable); <a name="l00174"></a>00174 <a name="l00180"></a><a class="code" href="classAsync_1_1Timer.html#a9d54660cdc9f40ccf336472b4930dbbe">00180</a> <span class="keywordtype">bool</span> <a class="code" href="classAsync_1_1Timer.html#a9d54660cdc9f40ccf336472b4930dbbe" title="Check if the timer is enabled.">isEnabled</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_is_enabled; } <a name="l00181"></a>00181 <a name="l00190"></a>00190 <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1Timer.html#aa839ecf5ba0f52c25138a034597b59c2" title="Reset (restart) the timer.">reset</a>(<span class="keywordtype">void</span>); <a name="l00191"></a>00191 <a name="l00200"></a><a class="code" href="classAsync_1_1Timer.html#a5ecea935e5b236d595bdd2314280b992">00200</a> SigC::Signal1<void, Timer *> <a class="code" href="classAsync_1_1Timer.html#a5ecea935e5b236d595bdd2314280b992" title="A signal that is emitted when the timer expires.">expired</a>; <a name="l00201"></a>00201 <a name="l00202"></a>00202 <a name="l00203"></a>00203 <span class="keyword">protected</span>: <a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="keyword">private</span>: <a name="l00206"></a>00206 <a class="code" href="classAsync_1_1Timer.html#a113ca6dbd092d592fa10e224f3f99ce4" title="The type of the timer.">Type</a> m_type; <a name="l00207"></a>00207 <span class="keywordtype">int</span> m_timeout_ms; <a name="l00208"></a>00208 <span class="keywordtype">bool</span> m_is_enabled; <a name="l00209"></a>00209 <a name="l00210"></a>00210 }; <span class="comment">/* class Timer */</span> <a name="l00211"></a>00211 <a name="l00212"></a>00212 <a name="l00213"></a>00213 } <span class="comment">/* namespace */</span> <a name="l00214"></a>00214 <a name="l00215"></a>00215 <span class="preprocessor">#endif </span><span class="comment">/* ASYNC_TIMER_INCLUDED */</span> <a name="l00216"></a>00216 <a name="l00217"></a>00217 <a name="l00218"></a>00218 <a name="l00219"></a>00219 <span class="comment">/*</span> <a name="l00220"></a>00220 <span class="comment"> * This file has not been truncated</span> <a name="l00221"></a>00221 <span class="comment"> */</span> <a name="l00222"></a>00222 </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>