Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > ed376d6842ea322c25405e7c23b3bc12 > files > 271

libcommoncpp-devel-1.8.0-5.1mdv2010.1.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>GNU CommonC++: ost::MutexCounter 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="index.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>Classes</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>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</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="navpath"><a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a>
  </div>
</div>
<div class="contents">
<h1>ost::MutexCounter Class Reference</h1><!-- doxytag: class="ost::MutexCounter" --><!-- doxytag: inherits="ost::Mutex" -->
<p>The <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">Mutex</a> <a class="el" href="classost_1_1_counter.html" title="The counter template is used for generic objects which act as automatic counters...">Counter</a> is a counter variable which can safely be incremented or decremented by multiple threads.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="thread_8h_source.html">thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ost::MutexCounter:</div>
<div class="dynsection">
 <div class="center">
  <img src="classost_1_1_mutex_counter.png" usemap="#ost::MutexCounter_map" alt=""/>
  <map id="ost::MutexCounter_map" name="ost::MutexCounter_map">
<area href="classost_1_1_mutex.html" alt="ost::Mutex" shape="rect" coords="0,0,113,24"/>
</map>
 </div>
</div>

<p><a href="classost_1_1_mutex_counter-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#abdb64adac3f0fd69aa92ccd6e024d738">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="#abdb64adac3f0fd69aa92ccd6e024d738"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#a9387a4385d82748ae177b911f7e45cdb">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="#a9387a4385d82748ae177b911f7e45cdb"></a><br/></td></tr>
<tr><td colspan="2"><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#a0754dcfbe827bd1b7ae959c7bacc984f">operator++</a> (<a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;mc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_counter.html#acc43c1e80dc6c081b9579ce112af5519">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>
<p>The <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">Mutex</a> <a class="el" href="classost_1_1_counter.html" title="The counter template is used for generic objects which act as automatic counters...">Counter</a> is a counter variable which can safely be incremented or decremented by multiple threads. </p>
<p>A <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">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 class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; <a class="el" href="classost_1_1_thread.html" title="Every thread of execution in an application is created by instantiating an object...">Thread</a> protected integer counter. </dd></dl>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abdb64adac3f0fd69aa92ccd6e024d738"></a><!-- doxytag: member="ost::MutexCounter::MutexCounter" ref="abdb64adac3f0fd69aa92ccd6e024d738" args="(const char *id=NULL)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::MutexCounter::MutexCounter </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>id</em> = <code>NULL</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create and optionally name a mutex protected counter. </p>
<dl><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>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9387a4385d82748ae177b911f7e45cdb"></a><!-- doxytag: member="ost::MutexCounter::MutexCounter" ref="a9387a4385d82748ae177b911f7e45cdb" args="(int initial, const char *id=NULL)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::MutexCounter::MutexCounter </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>initial</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>id</em> = <code>NULL</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create and optionally name a mutex protected counter with an initial value. </p>
<dl><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>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a0754dcfbe827bd1b7ae959c7bacc984f"></a><!-- doxytag: member="ost::MutexCounter::operator++" ref="a0754dcfbe827bd1b7ae959c7bacc984f" args="(MutexCounter &amp;mc)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int operator++ </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>mc</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="acc43c1e80dc6c081b9579ce112af5519"></a><!-- doxytag: member="ost::MutexCounter::operator&#45;&#45;" ref="acc43c1e80dc6c081b9579ce112af5519" args="(MutexCounter &amp;mc)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int operator-- </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classost_1_1_mutex_counter.html">MutexCounter</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>mc</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<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></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Nov 12 09:55:47 2010 for GNU CommonC++ 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>