etk/class_etk__Fifo.html

138 lines
6.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>etk Library</title>
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="menu.css">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<h1><a href="index.html">etk library</a></h1>
<h4><a href="http://github.com/heeroyui/etk/">&nbsp;&nbsp;&nbsp;[ sources ]</a></h4>
<h3>API:</h3> <div id="menu">
<ul class="niveau1">
<li class="sousmenu"><a href="namespace_etk.html">etk</a>
<ul class="niveau2">
<li><a href="namespace_etk__color.html">color</a>
</li>
<li><a href="namespace_etk__tool.html">tool</a>
</li>
<li><a href="namespace_etk__archive.html">archive</a>
</li>
<li><a href="namespace_etk__theme.html">theme</a>
</li>
</ul>
</li>
<li><a href="namespace_u32char.html">u32char</a>
</li>
<li><a href="namespace_utf8.html">utf8</a>
</li>
<li><a href="namespace_std.html">std</a>
</li>
<li><a href="namespace_debug.html">debug</a>
</li>
</ul>
</div>
<br/><h3>Associate libraries:</h3><div id="menu">
<ul class="niveau1"><li><a href="../ewol/index.html">ewol</a></li>
</ul><ul class="niveau1"><li><a href="../ejson/index.html">ejson</a></li>
</ul><ul class="niveau1"><li><a href="../egami/index.html">egami</a></li>
</ul><ul class="niveau1"><li><a href="../ege/index.html">ege</a></li>
</ul><ul class="niveau1"><li><a href="../esvg/index.html">esvg</a></li>
</ul><ul class="niveau1"><li><a href="../exml/index.html">exml</a></li>
</ul></div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
</div>
<div class="container" id="content">
<h1>class: etk::Fifo</h1><hr/><h2>Description:</h2>
Fifo tamplate is a simple messaged fifo element to
transfer data message from a thead to an other.<br/><ul>
<table class="parameter-list">
<td><b>Parameter [input]:</b></td><td><span class="code-argument">MY_TYPE</span> </td><td> Type of the fifo message are tranfered.</td></tr>
</table>
</ul>
<br/>
<h2>Constructor and Destructor:</h2>
<pre>
+ <a class="code-function" href="#9061">Fifo</a> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/>+ <a class="code-function" href="#9063">~Fifo</a> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
<br/>
<h2>Synopsis:</h2>
<pre>
+ <span class="code-type" >bool</span> <a class="code-function" href="#9065">wait</a> (MY_TYPE & <span class="code-argument">_data</span>);<br/>+ <span class="code-type" >bool</span> <a class="code-function" href="#9067">wait</a> (MY_TYPE & <span class="code-argument">_data</span>,<br/> <span class="code-type" >uint32_t</span> <span class="code-argument">_timeOutInUs</span>);<br/>+ <span class="code-type" >int32_t</span> <a class="code-function" href="#9070">count</a> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/>+ <span class="code-type" >void</span> <a class="code-function" href="#9072">post</a> (MY_TYPE & <span class="code-argument">_data</span>);<br/>+ <span class="code-type" >void</span> <a class="code-function" href="#9074">clean</a> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
<br/>
<h2>Detail:</h2>
<a id="9061"/><a id="9063"/><h3>Fifo</h3><pre>
+ <span class="code-function">Fifo</span> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
Create a fifo with no message.<br/>
<br/>
<hr/>
<a id="9065"/><h3>~Fifo</h3><pre>
+ <span class="code-function">~Fifo</span> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
Remove the fifo and all message inside.<br/>
<br/>
<hr/>
<a id="9067"/><h3>wait</h3><pre>
+ <span class="code-type" >bool</span> <span class="code-function">wait</span> (MY_TYPE & <span class="code-argument">_data</span>);<br/></pre>
Wait a message from the other thread. (no timeout set)<br/><ul>
<table class="parameter-list">
<td><b>Parameter [output]:</b></td><td><span class="code-argument">_data</span> </td><td> Data find in the fifo.</td></tr>
<tr><td><b>Return: </b></td><td></td><td>true A data has been find.&lt;br/&gt;false No data found or closed fifo</td></tr></table>
</ul>
<br/>
<hr/>
<a id="9070"/><h3>wait</h3><pre>
+ <span class="code-type" >bool</span> <span class="code-function">wait</span> (MY_TYPE & <span class="code-argument">_data</span>,<br/> <span class="code-type" >uint32_t</span> <span class="code-argument">_timeOutInUs</span>);<br/></pre>
Wait a message from the other thread, with a specified timeout.<br/><ul>
<table class="parameter-list">
<td><b>Parameter [output]:</b></td><td><span class="code-argument">_data</span> </td><td> keeped data from the fifo.</td></tr>
<td><b>Parameter [input]:</b></td><td><span class="code-argument">_timeOutInUs</span> </td><td> Time-out to wait a message in the fifo. It mightbespecify in micro-second.</td></tr>
<tr><td><b>Return: </b></td><td></td><td>true We keep a massage.&lt;br/&gt;false No message found while time-out appear.</td></tr></table>
</ul>
<br/>
<hr/>
<a id="9072"/><h3>count</h3><pre>
+ <span class="code-type" >int32_t</span> <span class="code-function">count</span> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
Get the number of message in the fifo.<br/><ul>
<table class="parameter-list">
<tr><td><b>Return: </b></td><td></td><td>Number of message in the fifo.</td></tr></table>
</ul>
<br/>
<hr/>
<a id="9074"/><h3>post</h3><pre>
+ <span class="code-type" >void</span> <span class="code-function">post</span> (MY_TYPE & <span class="code-argument">_data</span>);<br/></pre>
Send a message at the other thread by setting a new message in the fifo.<br/><ul>
<table class="parameter-list">
<td><b>Parameter [input]:</b></td><td><span class="code-argument">_data</span> </td><td> New data to add at the fifo.</td></tr>
</table>
</ul>
<br/>
<hr/>
<h3>clean</h3><pre>
+ <span class="code-type" >void</span> <span class="code-function">clean</span> (<span class="code-type" >void</span> <span class="code-argument"></span>);<br/></pre>
Remove all the message in the fifo.<br/>
<br/>
<hr/>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46753803-1', 'heeroyui.github.io');
ga('send', 'pageview');
</script>
</body>
</html>