Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 229

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>GNU CommonC++: ost::MutexCounter Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a></div>
<h1>ost::MutexCounter Class Reference</h1><!-- doxytag: class="ost::MutexCounter" --><!-- doxytag: inherits="ost::Mutex" -->The <a class="el" href="classost_1_1_mutex.html">Mutex</a> <a class="el" href="classost_1_1_counter.html">Counter</a> is a counter variable which can safely be incremented or decremented by multiple <a class="el" href="namespaceost.html#1a3b6738f6f759fcb52b544a4787cbb2">threads.Thread</a> protected integer counter.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thread_8h-source.html">thread.h</a>&gt;</code>
<p>
<p>Inheritance diagram for ost::MutexCounter:
<p><center><img src="classost_1_1_mutex_counter.png" usemap="#ost::MutexCounter_map" border="0" alt=""></center>
<map name="ost::MutexCounter_map">
<area href="classost_1_1_mutex.html" alt="ost::Mutex" shape="rect" coords="0,0,113,24">
</map>
<a href="classost_1_1_mutex_counter-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#bdb64adac3f0fd69aa92ccd6e024d738">MutexCounter</a> (const char *id=NULL)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create and optionally name a mutex protected counter.  <a href="#bdb64adac3f0fd69aa92ccd6e024d738"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#9387a4385d82748ae177b911f7e45cdb">MutexCounter</a> (int initial, const char *id=NULL)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create and optionally name a mutex protected counter with an initial value.  <a href="#9387a4385d82748ae177b911f7e45cdb"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__EXPORT int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#492dd40022f552e2a876a2024a911311">operator++</a> (<a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;mc)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">__EXPORT int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#05e6a8049e92770f04bdd47d435931cc">operator--</a> (<a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;mc)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The <a class="el" href="classost_1_1_mutex.html">Mutex</a> <a class="el" href="classost_1_1_counter.html">Counter</a> is a counter variable which can safely be incremented or decremented by multiple <a class="el" href="namespaceost.html#1a3b6738f6f759fcb52b544a4787cbb2">threads.Thread</a> protected integer counter. 
<p>
A <a class="el" href="classost_1_1_mutex.html">Mutex</a> is used to protect access to the counter variable (an integer). An initial value can be specified for the counter, and it can be manipulated with the ++ and -- operators.<p>
<dl compact><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dd></dl>

<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="bdb64adac3f0fd69aa92ccd6e024d738"></a><!-- doxytag: member="ost::MutexCounter::MutexCounter" ref="bdb64adac3f0fd69aa92ccd6e024d738" args="(const char *id=NULL)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::MutexCounter::MutexCounter           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em> = <code>NULL</code>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create and optionally name a mutex protected counter. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>name for mutex counter, optional for deadlock testing. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="9387a4385d82748ae177b911f7e45cdb"></a><!-- doxytag: member="ost::MutexCounter::MutexCounter" ref="9387a4385d82748ae177b911f7e45cdb" args="(int initial, const char *id=NULL)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::MutexCounter::MutexCounter           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname" nowrap> <em>initial</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>id</em> = <code>NULL</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create and optionally name a mutex protected counter with an initial value. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>initial</em>&nbsp;</td><td>value of counter. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>name of counter, optional for deadlock testing. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr><h2>Friends And Related Function Documentation</h2>
<a class="anchor" name="492dd40022f552e2a876a2024a911311"></a><!-- doxytag: member="ost::MutexCounter::operator++" ref="492dd40022f552e2a876a2024a911311" args="(MutexCounter &amp;mc)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">__EXPORT int operator++           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>mc</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [friend]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a class="anchor" name="05e6a8049e92770f04bdd47d435931cc"></a><!-- doxytag: member="ost::MutexCounter::operator--" ref="05e6a8049e92770f04bdd47d435931cc" args="(MutexCounter &amp;mc)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">__EXPORT int operator--           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>mc</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [friend]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="thread_8h-source.html">thread.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 19 10:50:57 2006 for GNU CommonC++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>