Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 4f5f2dc0f55b453456458df885792b0b > files > 71

ucommon-doc-5.0.4-1mdv2010.2.i586.rpm

<!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>ucommon: ucommon::Conditional Class Reference</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.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="a00208.html">ucommon</a>::<a class="el" href="a00036.html">Conditional</a>
  </div>
</div>
<div class="contents">
<h1>ucommon::Conditional Class Reference</h1><!-- doxytag: class="ucommon::Conditional" -->
<p>The conditional is a common base for other thread synchronizing classes.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00202_source.html">thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ucommon::Conditional:</div>
<div class="dynsection">
<div class="center"><img src="a00360.png" border="0" usemap="#ucommon_1_1_conditional_inherit__map" alt="Inheritance graph"/></div>
<map name="ucommon_1_1_conditional_inherit__map" id="ucommon_1_1_conditional_inherit__map">
<area shape="rect" id="node3" href="a00024.html" title="A portable implimentation of &quot;barrier&quot; thread sychronization." alt="" coords="328,56,509,83"/><area shape="rect" id="node5" href="a00026.html" title="A thread&#45;safe buffer for serializing and streaming class data." alt="" coords="333,107,504,133"/><area shape="rect" id="node9" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks." alt="" coords="277,157,560,184"/><area shape="rect" id="node19" href="a00065.html" title="Linked allocator helper for linked_allocator template." alt="" coords="288,208,549,235"/><area shape="rect" id="node23" href="a00111.html" title="Manage a thread&#45;safe queue of objects through reference pointers." alt="" coords="337,259,500,285"/><area shape="rect" id="node27" href="a00114.html" title="Portable recursive exclusive lock." alt="" coords="293,309,544,336"/><area shape="rect" id="node29" href="a00115.html" title="Class for resource bound memory pools between threads." alt="" coords="277,360,560,387"/><area shape="rect" id="node43" href="a00119.html" title="A portable counting semaphore class." alt="" coords="317,411,520,437"/><area shape="rect" id="node45" href="a00145.html" title="Manage a thread&#45;safe stack of objects through reference pointers." alt="" coords="337,461,500,488"/><area shape="rect" id="node7" href="a00027.html" title="A templated typed class for buffering of objects." alt="" coords="648,5,891,32"/><area shape="rect" id="node11" href="a00038.html" title="An optimized and convertable shared lock." alt="" coords="639,56,900,83"/><area shape="rect" id="node13" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object." alt="" coords="648,107,891,133"/><area shape="rect" id="node17" href="a00157.html" title="A generic and portable implimentation of Read/Write locking." alt="" coords="664,157,875,184"/><area shape="rect" id="node15" href="a00124.html" title="Templated shared pointer for singleton shared objects of specific type." alt="" coords="980,107,1281,133"/><area shape="rect" id="node21" href="a00061.html" title="Linked allocator template to gather linked objects." alt="" coords="608,208,931,235"/><area shape="rect" id="node25" href="a00112.html" title="A templated typed class for thread&#45;safe queue of object pointers." alt="" coords="653,259,885,285"/><area shape="rect" id="node31" href="a00016.html" title="An array of reusable objects." alt="" coords="664,309,875,336"/><area shape="rect" id="node35" href="a00078.html" title="Map a reusable allocator over a named shared memory segment." alt="" coords="659,360,880,387"/><area shape="rect" id="node39" href="a00106.html" title="A mempager source of reusable objects." alt="" coords="664,411,875,437"/><area shape="rect" id="node33" href="a00015.html" title="An array of reusable types." alt="" coords="995,309,1267,336"/><area shape="rect" id="node37" href="a00075.html" title="Template class to map typed reusable objects into shared memory heap." alt="" coords="989,360,1272,387"/><area shape="rect" id="node41" href="a00102.html" title="A reusable private pool of reusable types." alt="" coords="995,411,1267,437"/><area shape="rect" id="node47" href="a00146.html" title="A templated typed class for thread&#45;safe stack of object pointers." alt="" coords="653,461,885,488"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a8de2cf280ade43c8dbe686efe584acac">gettimeout</a> (<a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout, struct timespec *hires)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert a millisecond timeout into use for high resolution conditional timers.  <a href="#a8de2cf280ade43c8dbe686efe584acac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static pthread_condattr_t *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#ac9ac29dd41a11b01d4f113216dd8fa7e">initializer</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Support function for getting conditional attributes for realtime scheduling.  <a href="#ac9ac29dd41a11b01d4f113216dd8fa7e"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ababd9cfbaefcb76bbc878c8d84d70629"></a><!-- doxytag: member="ucommon::Conditional::broadcast" ref="ababd9cfbaefcb76bbc878c8d84d70629" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#ababd9cfbaefcb76bbc878c8d84d70629">broadcast</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signal the conditional to release all waiting threads. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a73fb73f91e51f9ee533132f3f532fafd"></a><!-- doxytag: member="ucommon::Conditional::Conditional" ref="a73fb73f91e51f9ee533132f3f532fafd" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a73fb73f91e51f9ee533132f3f532fafd">Conditional</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize and construct conditional. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa56be71c5eb39203a07ed50e2ea28e17"></a><!-- doxytag: member="ucommon::Conditional::lock" ref="aa56be71c5eb39203a07ed50e2ea28e17" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17">lock</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Lock the conditional's supporting mutex. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af3f181206c9da93092cb7efd66f3b401"></a><!-- doxytag: member="ucommon::Conditional::signal" ref="af3f181206c9da93092cb7efd66f3b401" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#af3f181206c9da93092cb7efd66f3b401">signal</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signal the conditional to release one waiting thread. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7172831c0cb9b490017157f37ab9ca6c"></a><!-- doxytag: member="ucommon::Conditional::unlock" ref="a7172831c0cb9b490017157f37ab9ca6c" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a7172831c0cb9b490017157f37ab9ca6c">unlock</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unlock the conditional's supporting mutex. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32b09f4b5196eeef1a7ba7066ec06cc4"></a><!-- doxytag: member="ucommon::Conditional::wait" ref="a32b09f4b5196eeef1a7ba7066ec06cc4" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4">wait</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wait (block) until signalled. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a7d50e40a9317740f188276df063fcb50">wait</a> (struct timespec *timeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a> wait for signal on timespec timeout.  <a href="#a7d50e40a9317740f188276df063fcb50"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#a9e5e1ae6d270a630f2b1eeded43dc8a4">wait</a> (<a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a> wait for signal on millisecond timeout.  <a href="#a9e5e1ae6d270a630f2b1eeded43dc8a4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeb4f48b80f5b9e60dac126af533410c8"></a><!-- doxytag: member="ucommon::Conditional::~Conditional" ref="aeb4f48b80f5b9e60dac126af533410c8" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00036.html#aeb4f48b80f5b9e60dac126af533410c8">~Conditional</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy conditional, release any blocked threads. <br/></td></tr>
<tr><td colspan="2"><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d41133ad1245e77ceac163329c024f6"></a><!-- doxytag: member="ucommon::Conditional::ConditionalAccess" ref="a8d41133ad1245e77ceac163329c024f6" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><b>ConditionalAccess</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e2baa3e939d2a97c38571681903fb98"></a><!-- doxytag: member="ucommon::Conditional::TimedEvent" ref="a0e2baa3e939d2a97c38571681903fb98" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><b>TimedEvent</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The conditional is a common base for other thread synchronizing classes. </p>
<p>Many of the complex sychronization objects, including barriers, semaphores, and various forms of read/write locks are all built from the conditional. This assures that the minimum functionality to build higher order thread synchronizing objects is a pure conditional, and removes dependencies on what may be optional features or functions that may have different behaviors on different pthread implimentations and platforms. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="a00202_source.html#l00086">86</a> of file <a class="el" href="a00202_source.html">thread.h</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a8de2cf280ade43c8dbe686efe584acac"></a><!-- doxytag: member="ucommon::Conditional::gettimeout" ref="a8de2cf280ade43c8dbe686efe584acac" args="(timeout_t timeout, struct timespec *hires)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void ucommon::Conditional::gettimeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="paramname"> <em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timespec *&nbsp;</td>
          <td class="paramname"> <em>hires</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convert a millisecond timeout into use for high resolution conditional timers. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>to convert. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>hires</em>&nbsp;</td><td>timespec representation to fill. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="a00037.html#af41903213fb4b76183f6c4fb5d39479b">ucommon::ConditionalAccess</a>.</p>

</div>
</div>
<a class="anchor" id="ac9ac29dd41a11b01d4f113216dd8fa7e"></a><!-- doxytag: member="ucommon::Conditional::initializer" ref="ac9ac29dd41a11b01d4f113216dd8fa7e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static pthread_condattr_t* ucommon::Conditional::initializer </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Support function for getting conditional attributes for realtime scheduling. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>attributes to use for creating realtime conditionals. </dd></dl>

<p>Definition at line <a class="el" href="a00202_source.html#l00193">193</a> of file <a class="el" href="a00202_source.html">thread.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7d50e40a9317740f188276df063fcb50"></a><!-- doxytag: member="ucommon::Conditional::wait" ref="a7d50e40a9317740f188276df063fcb50" args="(struct timespec *timeout)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ucommon::Conditional::wait </td>
          <td>(</td>
          <td class="paramtype">struct timespec *&nbsp;</td>
          <td class="paramname"> <em>timeout</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a> wait for signal on timespec timeout. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>as a high resolution timespec. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if signalled, false if timer expired. </dd></dl>

</div>
</div>
<a class="anchor" id="a9e5e1ae6d270a630f2b1eeded43dc8a4"></a><!-- doxytag: member="ucommon::Conditional::wait" ref="a9e5e1ae6d270a630f2b1eeded43dc8a4" args="(timeout_t timeout)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ucommon::Conditional::wait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="paramname"> <em>timeout</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a> wait for signal on millisecond timeout. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if signalled, false if timer expired. </dd></dl>

<p>Reimplemented in <a class="el" href="a00024.html#a49613aed25b771b470700aa0f59325e1">ucommon::barrier</a>, and <a class="el" href="a00119.html#a2f8beb2adca6e787007c56abc53c0811">ucommon::Semaphore</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00202_source.html">thread.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:39:32 2011 for ucommon by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>