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

📄 channel_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00146 <span class="comment"> * Documentation.</span>00147 <span class="comment"> *</span>00148 <span class="comment"> * Revision 1.7  1994/08/23  11:32:52  robertj</span>00149 <span class="comment"> * Oops</span>00150 <span class="comment"> *</span>00151 <span class="comment"> * Revision 1.6  1994/08/22  00:46:48  robertj</span>00152 <span class="comment"> * Added pragma fro GNU C++ compiler.</span>00153 <span class="comment"> *</span>00154 <span class="comment"> * Revision 1.5  1994/08/21  23:43:02  robertj</span>00155 <span class="comment"> * Moved meta-string transmitter from PModem to PChannel.</span>00156 <span class="comment"> * Added common entry point to convert OS error to PChannel error.</span>00157 <span class="comment"> *</span>00158 <span class="comment"> * Revision 1.4  1994/07/17  10:46:06  robertj</span>00159 <span class="comment"> * Unix support changes.</span>00160 <span class="comment"> *</span>00161 <span class="comment"> * Revision 1.3  1994/07/02  03:03:49  robertj</span>00162 <span class="comment"> * Changed to allow for platform dependent part.</span>00163 <span class="comment"> *</span>00164 <span class="comment"> * Revision 1.2  1994/06/25  11:55:15  robertj</span>00165 <span class="comment"> * Unix version synchronisation.</span>00166 <span class="comment"> *</span>00167 <span class="comment"> * Revision 1.1  1994/04/20  12:17:44  robertj</span>00168 <span class="comment"> * Initial revision</span>00169 <span class="comment"> *</span>00170 <span class="comment"> */</span>00171 00172 <span class="preprocessor">#ifndef _PCHANNEL</span>00173 <span class="preprocessor"></span><span class="preprocessor">#define _PCHANNEL</span>00174 <span class="preprocessor"></span>00175 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00176 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00177 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00178 <span class="preprocessor"></span>00179 <span class="preprocessor">#include &lt;<a class="code" href="mutex_8h.html">ptlib/mutex.h</a>&gt;</span>00180 00182 <span class="comment">// I/O Channels</span>00183 00184 <span class="keyword">class </span><a class="code" href="classPChannel.html">PChannel</a>;00185 00186 <span class="comment">/* Buffer class used in PChannel stream.</span>00187 <span class="comment">This class is necessary for implementing the standard C++ iostream interface</span>00188 <span class="comment">on #PChannel# classes and its descendents. It is an internal class and</span>00189 <span class="comment">should not ever be used by application writers.</span>00190 <span class="comment">*/</span><a name="l00191"></a><a class="code" href="classPChannelStreamBuffer.html">00191</a> <span class="keyword">class </span><a class="code" href="classPChannelStreamBuffer.html">PChannelStreamBuffer</a> : <span class="keyword">public</span> streambuf {00192 00193   <span class="keyword">protected</span>:00194     <span class="comment">/* Construct the streambuf for standard streams on a channel. This is used</span>00195 <span class="comment">       internally by the #PChannel# class.</span>00196 <span class="comment">     */</span>00197     <a class="code" href="classPChannelStreamBuffer.html#b0">PChannelStreamBuffer</a>(00198       <a class="code" href="classPChannel.html">PChannel</a> * chan   <span class="comment">// Channel the buffer operates on.</span>00199     );00200 00201     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPChannelStreamBuffer.html#b1">overflow</a>(<span class="keywordtype">int</span>=EOF);00202     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPChannelStreamBuffer.html#b2">underflow</a>();00203     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPChannelStreamBuffer.html#b3">sync</a>();00204 <span class="preprocessor">#if __USE_STL__</span>00205 <span class="preprocessor"></span>    <span class="keyword">virtual</span> pos_type <a class="code" href="classPChannelStreamBuffer.html#b4">seekoff</a>(off_type, ios_base::seekdir, ios_base::openmode = ios_base::in | ios_base::out);00206     <span class="keyword">virtual</span> pos_type seekpos(pos_type, ios_base::openmode = ios_base::in | ios_base::out);00207 <span class="preprocessor">#else</span>00208 <span class="preprocessor"></span>    <span class="keyword">virtual</span> streampos <a class="code" href="classPChannelStreamBuffer.html#b4">seekoff</a>(streamoff, ios::seek_dir, <span class="keywordtype">int</span>);00209 <span class="preprocessor">#endif</span>00210 <span class="preprocessor"></span>00211     BOOL <a class="code" href="classPChannelStreamBuffer.html#b5">SetBufferSize</a>(00212       PINDEX newSize00213     );00214 00215   <span class="keyword">private</span>:00216     <span class="comment">// Member variables</span>00217     <a class="code" href="classPChannel.html">PChannel</a> * channel;00218     <a class="code" href="classPCharArray.html">PCharArray</a> input, output;00219 00220   <span class="keyword">public</span>:00221     <a class="code" href="classPChannelStreamBuffer.html#b0">PChannelStreamBuffer</a>(<span class="keyword">const</span> <a class="code" href="classPChannelStreamBuffer.html">PChannelStreamBuffer</a> &amp; sbuf);00222     <a class="code" href="classPChannelStreamBuffer.html">PChannelStreamBuffer</a> &amp; <a class="code" href="classPChannelStreamBuffer.html#a1">operator=</a>(<span class="keyword">const</span> <a class="code" href="classPChannelStreamBuffer.html">PChannelStreamBuffer</a> &amp; sbuf);00223 <a name="l00224"></a><a class="code" href="classPChannelStreamBuffer.html#l0">00224</a>   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classPChannel.html">PChannel</a>;00225 };00226 00227 <a name="l00249"></a><a class="code" href="classPChannel.html">00249</a> <span class="keyword">class </span><a class="code" href="classPChannel.html">PChannel</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>, <span class="keyword">public</span> iostream {00250   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPChannel.html">PChannel</a>, <a class="code" href="classPObject.html">PObject</a>);00251 00252   <span class="keyword">public</span>:00255 00256     <a class="code" href="classPChannel.html#z43_0">PChannel</a>();00257 00259     <a class="code" href="classPChannel.html#z43_1">~PChannel</a>();00261 00273     <span class="keyword">virtual</span> <a class="code" href="classPObject.html#z199_0">Comparison</a> <a class="code" href="classPChannel.html#z45_0">Compare</a>(00274       <span class="keyword">const</span> <a class="code" href="classPObject.html">PObject</a> &amp; obj   00275     ) <span class="keyword">const</span>;00276 00290     <span class="keyword">virtual</span> PINDEX <a class="code" href="classPChannel.html#z45_1">HashFunction</a>() <span class="keyword">const</span>;00292 00302     <span class="keyword">virtual</span> BOOL <a class="code" href="classPChannel.html#z47_0">IsOpen</a>() <span class="keyword">const</span>;00303 00309     <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPChannel.html#z47_1">GetName</a>() <span class="keyword">const</span>;00310 00316     <span class="keywordtype">int</span> <a class="code" href="classPChannel.html#z47_2">GetHandle</a>() <span class="keyword">const</span>;00317 00327     <span class="keyword">virtual</span> <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPChannel.html#z47_3">GetBaseReadChannel</a>() <span class="keyword">const</span>;00328 00338     <span class="keyword">virtual</span> <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPChannel.html#z47_4">GetBaseWriteChannel</a>() <span class="keyword">const</span>;00340 00350     <span class="keywordtype">void</span> <a class="code" href="classPChannel.html#z49_0">SetReadTimeout</a>(00351       <span class="keyword">const</span> <a class="code" href="classPTimeInterval.html">PTimeInterval</a> &amp; time  00352     );00353 00360     <a class="code" href="classPTimeInterval.html">PTimeInterval</a> <a class="code" href="classPChannel.html#z49_1">GetReadTimeout</a>() <span class="keyword">const</span>;00361 00374     <span class="keyword">virtual</span> BOOL <a class="code" href="classPChannel.html#z49_2">Read</a>(00375       <span class="keywordtype">void</span> * buf,   00376       PINDEX len    00377     );00378 00393     <span class="keyword">virtual</span> PINDEX <a class="code" href="classPChannel.html#z49_3">GetLastReadCount</a>() <span class="keyword">const</span>;00394 00402     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPChannel.html#z49_4">ReadChar</a>();00403 00412     BOOL <a class="code" href="classPChannel.html#z49_5">ReadBlock</a>(00413       <span class="keywordtype">void</span> * buf,   00414       PINDEX len    00415     );00416 00424     <a class="code" href="classPString.html">PString</a> <a class="code" href="classPChannel.html#z49_6">ReadString</a>(PINDEX len);00425 00437     <span class="keyword">virtual</span> BOOL <a class="code" href="classPChannel.html#z49_7">ReadAsync</a>(00438       <span class="keywordtype">void</span> * buf,   00439       PINDEX len    00440     );00441 00446     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPChannel.html#z49_8">OnReadComplete</a>(00447       <span class="keywordtype">void</span> * buf, 00448       PINDEX len  00449     );00451 00461     <span class="keywordtype">void</span> <a class="code" href="classPChannel.html#z51_0">SetWriteTimeout</a>(00462       <span class="keyword">const</span> <a class="code" href="classPTimeInterval.html">PTimeInterval</a> &amp; time 00463     );00464 00472     <a class="code" href="classPTimeInterval.html">PTimeInterval</a> <a class="code" href="classPChannel.html#z51_1">GetWriteTimeout</a>() <span class="keyword">const</span>;00473 00485     <span class="keyword">virtual</span> BOOL <a class="code" href="classPChannel.html#z51_2">Write</a>(00486       <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, 00487       PINDEX len        00488     );00489 00502     <span class="keyword">virtual</span> PINDEX <a class="code" href="classPChannel.html#z51_3">GetLastWriteCount</a>() <span class="keyword">const</span>;00503 00512     BOOL <a class="code" href="classPChannel.html#z51_4">WriteChar</a>(<span class="keywordtype">int</span> c);00513 

⌨️ 快捷键说明

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