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

📄 classpdelaychannel.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>PDelayChannel 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>PDelayChannel Class Reference</h1><code>#include &lt;<a class="el" href="delaychan_8h-source.html">delaychan.h</a>&gt;</code><p><p>Inheritance diagram for PDelayChannel:<p><center><img src="classPDelayChannel.png" usemap="#PDelayChannel_map" border="0" alt=""></center><map name="PDelayChannel_map"><area href="classPIndirectChannel.html" alt="PIndirectChannel" shape="rect" coords="0,112,109,136"><area href="classPChannel.html" alt="PChannel" shape="rect" coords="0,56,109,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,109,24"><area href="classPVXMLChannel.html" alt="PVXMLChannel" shape="rect" coords="0,224,109,248"></map><a href="classPDelayChannel-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Construction</h2></td></tr><tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#z475_0">Mode</a> { <a class="el" href="classPDelayChannel.html#z475_0s0">DelayReadsOnly</a>, <a class="el" href="classPDelayChannel.html#z475_0s1">DelayWritesOnly</a>, <a class="el" href="classPDelayChannel.html#z475_0s2">DelayReadsAndWrites</a> }</td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#z475_1">PDelayChannel</a> (<a class="el" href="classPDelayChannel.html#z475_0">Mode</a> <a class="el" href="classPDelayChannel.html#n0">mode</a>, unsigned <a class="el" href="classPDelayChannel.html#n1">frameDelay</a>, PINDEX <a class="el" href="classPDelayChannel.html#n2">frameSize</a>=0, unsigned <a class="el" href="classPDelayChannel.html#n3">maximumSlip</a>=250, unsigned <a class="el" href="classPDelayChannel.html#n4">minimumDelay</a>=10)</td></tr><tr><td colspan=2><br><h2>Public Types</h2></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></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="classPDelayChannel.html#z477_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="classPDelayChannel.html#z477_1">Write</a> (const void *buf, PINDEX len)</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#b0">Wait</a> (PINDEX count, <a class="el" href="classPTimeInterval.html">PTimeInterval</a> &amp;nextTick)</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPDelayChannel.html#z475_0">Mode</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n0">mode</a></td></tr><tr><td nowrap align=right valign=top>unsigned&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n1">frameDelay</a></td></tr><tr><td nowrap align=right valign=top>PINDEX&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n2">frameSize</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPTimeInterval.html">PTimeInterval</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n3">maximumSlip</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPTimeInterval.html">PTimeInterval</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n4">minimumDelay</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPTimeInterval.html">PTimeInterval</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n5">nextReadTick</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPTimeInterval.html">PTimeInterval</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDelayChannel.html#n6">nextWriteTick</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Class for implementing a "delay line" channel. This indirect channel can be placed in a channel I/O chain to limit the speed of I/O. This can be useful if blocking is not available and buffers could be overwritten if the I/O occurs at full speed.<p>There are two modes of operation. In stream more, data can be read/written no faster than a fixed time for a fixed number of bytes. So, for example, you can say than 320 bytes must take 20 milliseconds, and thus if the application writes 640 byets it will delay 40 milliseconds before the next write.<p>In frame mode, the rate limiting applies to individual read or write operations. So you can say that each read takes 30 milliseconds even if on 4 bytes is read, and the same time if 24 bytes are read. <p><hr><h2>Member Enumeration Documentation</h2><a name="z475_0" doxytag="PDelayChannel::Mode"></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"> enum PDelayChannel::Mode      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a name="z475_0s0" doxytag="DelayReadsOnly"></a><em>DelayReadsOnly</em></em>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="z475_0s1" doxytag="DelayWritesOnly"></a><em>DelayWritesOnly</em></em>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="z475_0s2" doxytag="DelayReadsAndWrites"></a><em>DelayReadsAndWrites</em></em>&nbsp;</td><td></td></tr></table></dl>    </td>  </tr></table><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z475_1" doxytag="PDelayChannel::PDelayChannel"></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"> PDelayChannel::PDelayChannel </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classPDelayChannel.html#z475_0">Mode</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>mode</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>unsigned&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>frameDelay</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>PINDEX&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>frameSize</em> = 0, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>unsigned&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>maximumSlip</em> = 250, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>unsigned&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>minimumDelay</em> = 10</td>        </tr>        <tr>          <td></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 a new delay channel with the specified delays. A value of zero for the numBytes parameter indicates that the delay is in frame mode.<p>The maximum skip time is the number of milliseconds that the delay may "catch up" by using zero delays. This is caused by the <a class="el" href="classPDelayChannel.html#z477_0">Read()</a> or <a class="el" href="classPDelayChannel.html#z477_1">Write()</a> not being called for a time by external factors. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>frameDelay</em>&nbsp;</td><td>Mode for delay channel </td></tr><tr><td valign=top><em>frameSize</em>&nbsp;</td><td>Delay time in milliseconds </td></tr><tr><td valign=top><em>maximumSlip</em>&nbsp;</td><td>Bytes to apply to the delay time. </td></tr><tr><td valign=top><em>minimumDelay</em>&nbsp;</td><td>Maximum slip time in milliseconds Minimim delay (usually OS time slice) </td></tr></table></dl>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="z477_0" doxytag="PDelayChannel::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 PDelayChannel::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>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Low level read from the file channel. The read timeout is ignored for file I/O. The <a class="el" href="classPChannel.html#z49_3">GetLastReadCount()</a> function returns the actual number of bytes read.<p>The <a class="el" href="classPChannel.html#z55_2">GetErrorCode()</a> function should be consulted after <a class="el" href="classPDelayChannel.html#z477_0">Read()</a> returns FALSE to determine what caused the failure.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE indicates that at least one character was read from the channel. FALSE means no bytes were read due to timeout or some other I/O error. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>len</em>&nbsp;</td><td>Pointer to a block of memory to receive the read bytes. Maximum number of bytes to read into the buffer. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPIndirectChannel.html#z157_3">PIndirectChannel</a>.<p>Reimplemented in <a class="el" href="classPVXMLChannel.html#a5">PVXMLChannel</a>.    </td>  </tr></table><a name="b0" doxytag="PDelayChannel::Wait"></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 void PDelayChannel::Wait </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>count</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classPTimeInterval.html">PTimeInterval</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>nextTick</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [protected, virtual]</code></td>        </tr>      </table>    </td>

⌨️ 快捷键说明

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