📄 indchan_8h-source.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>indchan.h Source File</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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>indchan.h</h1><a href="indchan_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * indchan.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Indirect I/O channel class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: indchan.h,v $</span>00030 <span class="comment"> * Revision 1.9 2002/09/16 01:08:59 robertj</span>00031 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00032 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.8 2001/09/10 02:51:22 robertj</span>00035 <span class="comment"> * Major change to fix problem with error codes being corrupted in a</span>00036 <span class="comment"> * PChannel when have simultaneous reads and writes in threads.</span>00037 <span class="comment"> *</span>00038 <span class="comment"> * Revision 1.7 2001/05/22 12:49:32 robertj</span>00039 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00040 <span class="comment"> * stupid GNU compiler warning about braces not matching.</span>00041 <span class="comment"> *</span>00042 <span class="comment"> * Revision 1.6 2000/11/14 08:25:25 robertj</span>00043 <span class="comment"> * Added function to propagate the error text through to indirect channel.</span>00044 <span class="comment"> *</span>00045 <span class="comment"> * Revision 1.5 1999/06/17 13:38:11 robertj</span>00046 <span class="comment"> * Fixed race condition on indirect channel close, mutex needed in PIndirectChannel.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.4 1999/03/09 02:59:49 robertj</span>00049 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.3 1999/02/16 08:12:00 robertj</span>00052 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00053 <span class="comment"> *</span>00054 <span class="comment"> * Revision 1.2 1998/09/23 06:20:41 robertj</span>00055 <span class="comment"> * Added open source copyright license.</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.1 1996/09/14 13:00:56 robertj</span>00058 <span class="comment"> * Initial revision</span>00059 <span class="comment"> *</span>00060 <span class="comment"> */</span>00061 00062 <span class="preprocessor">#ifndef _PINDIRECTCHANNEL</span>00063 <span class="preprocessor"></span><span class="preprocessor">#define _PINDIRECTCHANNEL</span>00064 <span class="preprocessor"></span>00065 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00066 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00067 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00068 <span class="preprocessor"></span>00069 <a name="l00075"></a><a class="code" href="classPIndirectChannel.html">00075</a> <span class="keyword">class </span><a class="code" href="classPIndirectChannel.html">PIndirectChannel</a> : <span class="keyword">public</span> <a class="code" href="classPChannel.html">PChannel</a>00076 {00077 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPIndirectChannel.html">PIndirectChannel</a>, <a class="code" href="classPChannel.html">PChannel</a>);00078 00079 <span class="keyword">public</span>:00086 <a class="code" href="classPIndirectChannel.html#z153_0">PIndirectChannel</a>();00087 00089 <a class="code" href="classPIndirectChannel.html#z153_1">~PIndirectChannel</a>();00091 00092 00101 <a class="code" href="classPObject.html#z199_0">Comparison</a> <a class="code" href="classPIndirectChannel.html#z155_0">Compare</a>(00102 <span class="keyword">const</span> <a class="code" href="classPObject.html">PObject</a> & obj 00103 ) <span class="keyword">const</span>;00105 00106 00116 <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIndirectChannel.html#z157_0">GetName</a>() <span class="keyword">const</span>;00117 00124 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#z157_1">Close</a>();00125 00133 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#z157_2">IsOpen</a>() <span class="keyword">const</span>;00134 00150 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#z157_3">Read</a>(00151 <span class="keywordtype">void</span> * buf, 00152 PINDEX len 00153 );00154 00169 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#z157_4">Write</a>(00170 <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, 00171 PINDEX len 00172 );00173 00182 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#z157_5">Shutdown</a>(00183 <a class="code" href="classPChannel.html#z53_0">ShutdownValue</a> option 00184 );00185 00186 00195 <span class="keyword">virtual</span> <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#z157_6">GetBaseReadChannel</a>() <span class="keyword">const</span>;00196 00205 <span class="keyword">virtual</span> <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#z157_7">GetBaseWriteChannel</a>() <span class="keyword">const</span>;00206 00212 <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIndirectChannel.html#z157_8">GetErrorText</a>(00213 <a class="code" href="classPChannel.html#z55_1">ErrorGroup</a> group = <a class="code" href="classPChannel.html#z55_1s21">NumErrorGroups</a> 00214 ) <span class="keyword">const</span>;00216 00226 BOOL <a class="code" href="classPIndirectChannel.html#z159_0">Open</a>(00227 <a class="code" href="classPChannel.html">PChannel</a> & channel00229 );00230 00241 BOOL <a class="code" href="classPIndirectChannel.html#z159_0">Open</a>(00242 <a class="code" href="classPChannel.html">PChannel</a> * channel,00244 BOOL autoDelete = TRUE 00245 );00246 00258 BOOL <a class="code" href="classPIndirectChannel.html#z159_0">Open</a>(00259 <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#n0">readChannel</a>,00260 <span class="comment">// Channel to be used for both read operations.</span>00261 <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#n2">writeChannel</a>,00262 <span class="comment">// Channel to be used for both write operations.</span>00263 BOOL autoDeleteRead = TRUE, <span class="comment">// Automatically delete the read channel</span>00264 BOOL autoDeleteWrite = TRUE <span class="comment">// Automatically delete the write channel</span>00265 );00266 00272 <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#z159_3">GetReadChannel</a>() <span class="keyword">const</span>;00273 00279 BOOL <a class="code" href="classPIndirectChannel.html#z159_4">SetReadChannel</a>(00280 <a class="code" href="classPChannel.html">PChannel</a> * channel,00282 BOOL autoDelete = TRUE 00283 );00284 00290 <a class="code" href="classPChannel.html">PChannel</a> * <a class="code" href="classPIndirectChannel.html#z159_5">GetWriteChannel</a>() <span class="keyword">const</span>;00291 00297 BOOL <a class="code" href="classPIndirectChannel.html#z159_6">SetWriteChannel</a>(00298 <a class="code" href="classPChannel.html">PChannel</a> * channel,00300 BOOL autoDelete = TRUE 00301 );00303 00304 00305 <span class="keyword">protected</span>:00315 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIndirectChannel.html#b0">OnOpen</a>();00316 00317 00318 <span class="comment">// Member variables</span><a name="l00320"></a><a class="code" href="classPIndirectChannel.html#n0">00320</a> <span class="comment"> PChannel * readChannel;</span>00321 <a name="l00323"></a><a class="code" href="classPIndirectChannel.html#n1">00323</a> BOOL <a class="code" href="classPIndirectChannel.html#n1">readAutoDelete</a>;00324 <a name="l00326"></a><a class="code" href="classPIndirectChannel.html#n2">00326</a> <a class="code" href="classPChannel.html">PChannel</a> * writeChannel;00327 <a name="l00329"></a><a class="code" href="classPIndirectChannel.html#n3">00329</a> BOOL <a class="code" href="classPIndirectChannel.html#n3">writeAutoDelete</a>;00330 <a name="l00332"></a><a class="code" href="classPIndirectChannel.html#n4">00332</a> <a class="code" href="classPReadWriteMutex.html">PReadWriteMutex</a> <a class="code" href="classPIndirectChannel.html#n4">channelPointerMutex</a>;00333 };00334 00335 00336 <span class="preprocessor">#endif // _PINDIRECTCHANNEL</span>00337 <span class="preprocessor"></span>00338 00339 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:10 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 + -