⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpatomicinteger.html

📁 pwlib开发文档
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PAtomicInteger class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>PAtomicInteger Class Reference</h1><code>#include &lt;<a class="el" href="critsec_8h-source.html">critsec.h</a>&gt;</code><p><a href="classPAtomicInteger-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 Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a0">PAtomicInteger</a> (long v=0)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a1">IsZero</a> () const</td></tr><tr><td nowrap align=right valign=top>long&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a2">operator++</a> ()</td></tr><tr><td nowrap align=right valign=top>long&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a3">operator--</a> ()</td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a4">operator long</a> () const</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#a5">SetValue</a> (long v)</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top>long&nbsp;</td><td valign=bottom><a class="el" href="classPAtomicInteger.html#n0">value</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class implements an integer that can be atomically  incremented and decremented in a thread-safe manner. On Windows, the integer is of type long and this class is implemented using InterlockedIncrement and InterlockedDecrement integer is of type long. On Unix systems with GNU std++ support for EXCHANGE_AND_ADD, the integer is of type _Atomic_word (normally int) On all other systems, this class is implemented using <a class="el" href="classPCriticalSection.html">PCriticalSection</a> and the integer is of type int. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="PAtomicInteger::PAtomicInteger"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PAtomicInteger::PAtomicInteger </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">long&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>v</em> = 0          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a PAtomicInteger with the specified initial value     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a1" doxytag="PAtomicInteger::IsZero"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PAtomicInteger::IsZero </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Test if an atomic integer has a zero value. Note that this is a non-atomic test - use the return value of the <a class="el" href="classPAtomicInteger.html#a2">operator++()</a> or <a class="el" href="classPAtomicInteger.html#a3">operator--()</a> tests to perform atomic operations<p><dl compact><dt><b>Returns: </b></dt><dd>TRUE if the integer has a value of zero </dl>    </td>  </tr></table><a name="a4" doxytag="PAtomicInteger::operator long"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PAtomicInteger::operator long </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Returns: </b></dt><dd>Returns the value of the integer </dl>    </td>  </tr></table><a name="a2" doxytag="PAtomicInteger::operator++"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> long PAtomicInteger::operator++ </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>atomically increment the integer value<p><dl compact><dt><b>Returns: </b></dt><dd>Returns the value of the integer after the increment </dl>    </td>  </tr></table><a name="a3" doxytag="PAtomicInteger::operator--"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> long PAtomicInteger::operator-- </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>atomically decrement the integer value<p><dl compact><dt><b>Returns: </b></dt><dd>Returns the value of the integer after the decrement </dl>    </td>  </tr></table><a name="a5" doxytag="PAtomicInteger::SetValue"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PAtomicInteger::SetValue </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">long&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>v</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Set the value of the integer     </td>  </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PAtomicInteger::value"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> long PAtomicInteger::value<code> [protected]</code>      </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="critsec_8h-source.html">critsec.h</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:14 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -