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

📄 classpqueuechannel.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>PQueueChannel 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>PQueueChannel Class Reference</h1><code>#include &lt;<a class="el" href="qchannel_8h-source.html">qchannel.h</a>&gt;</code><p><p>Inheritance diagram for PQueueChannel:<p><center><img src="classPQueueChannel.png" usemap="#PQueueChannel_map" border="0" alt=""></center><map name="PQueueChannel_map"><area href="classPChannel.html" alt="PChannel" shape="rect" coords="0,56,105,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,105,24"></map><a href="classPQueueChannel-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 colspan="2"><div class="groupHeader">Construction</div></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z499_0">PQueueChannel</a> (PINDEX <a class="el" href="classPQueueChannel.html#n2">queueSize</a>=0)</td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z499_1">~PQueueChannel</a> ()</td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PChannel</div></td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z501_0">Read</a> (void *buf, PINDEX len)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z501_1">Write</a> (const void *buf, PINDEX len)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z501_2">Close</a> ()</td></tr><tr><td colspan="2"><div class="groupHeader">Queue manipulation functions</div></td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z503_0">Open</a> (PINDEX <a class="el" href="classPQueueChannel.html#n2">queueSize</a>)</td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z503_1">GetSize</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get the queue size.</em> <a href="#z503_1"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#z503_2">GetLength</a> () const</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get the current queue length.</em> <a href="#z503_2"></a><em></em></font><br><br></td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPMutex.html">PMutex</a>&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n0">mutex</a></td></tr><tr><td nowrap align=right valign=top>BYTE *&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n1">queueBuffer</a></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n2">queueSize</a></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n3">queueLength</a></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n4">enqueuePos</a></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n5">dequeuePos</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPSyncPoint.html">PSyncPoint</a>&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n6">unempty</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPSyncPoint.html">PSyncPoint</a>&nbsp;</td><td valign=bottom><a class="el" href="classPQueueChannel.html#n7">unfull</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Class for implementing a serial queue channel in memory. This implements a simple memory based First In First Out queue. Data written to an instance of the class may be read from the same instance at some later time.<p>The queue will block the read for the Read Timeout if the queue is empty. Similarly a write will be clocked for Write Timeout if the queue is full.<p>If there is any data to be read then it returns immediately with those bytes, so you must check the <a class="el" href="classPChannel.html#z49_3">GetLastReadCount()</a> to determine the actual number of bytes read and not rely on the count being passed into the read function. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z499_0" doxytag="PQueueChannel::PQueueChannel"></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"> PQueueChannel::PQueueChannel </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>queueSize</em> = 0          </td>          <td class="md" valign="top">)&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 a new queue channel with the specified maximum size. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>queueSize</em>&nbsp;</td><td>Queue size </td></tr></table></dl>    </td>  </tr></table><a name="z499_1" doxytag="PQueueChannel::~PQueueChannel"></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"> PQueueChannel::~PQueueChannel </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></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Delete queue and release memory used.     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="z501_2" doxytag="PQueueChannel::Close"></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"> virtual BOOL PQueueChannel::Close </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> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Close the file channel. <dl compact><dt><b>Returns: </b></dt><dd>TRUE if close was OK. </dl><p>Reimplemented from <a class="el" href="classPChannel.html#z53_1">PChannel</a>.    </td>  </tr></table><a name="z503_2" doxytag="PQueueChannel::GetLength"></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"> PINDEX PQueueChannel::GetLength </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>Get the current queue length.<p>    </td>  </tr></table><a name="z503_1" doxytag="PQueueChannel::GetSize"></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"> PINDEX PQueueChannel::GetSize </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>Get the queue size.<p>    </td>  </tr></table><a name="z503_0" doxytag="PQueueChannel::Open"></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"> virtual BOOL PQueueChannel::Open </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>queueSize</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Open a queue, allocating the queueSize bytes. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>queueSize</em>&nbsp;</td><td>Queue size </td></tr></table></dl>    </td>  </tr></table><a name="z501_0" doxytag="PQueueChannel::Read"></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"> virtual BOOL PQueueChannel::Read </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>PINDEX&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>len</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>

⌨️ 快捷键说明

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