PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
indchan.h
Go to the documentation of this file.
1 /*
2  * indchan.h
3  *
4  * Indirect I/O channel class.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25  * All Rights Reserved.
26  *
27  * Contributor(s): ______________________________________.
28  *
29  * $Revision: 31181 $
30  * $Author: rjongbloed $
31  * $Date: 2014-01-14 11:45:41 +1100 (Tue, 14 Jan 2014) $
32  */
33 
34 #ifndef PTLIB_INDIRECTCHANNEL_H
35 #define PTLIB_INDIRECTCHANNEL_H
36 
37 #ifdef P_USE_PRAGMA
38 #pragma interface
39 #endif
40 
41 #include <ptlib/channel.h>
42 #include <ptlib/syncthrd.h>
43 
49 class PIndirectChannel : public PChannel
50 {
51  PCLASSINFO(PIndirectChannel, PChannel);
52 
53  public:
61 
65 
66 
76  const PObject & obj
77  ) const;
79 
80 
90  virtual PString GetName() const;
91 
97  virtual P_INT_PTR GetHandle() const;
98 
105  virtual PBoolean Close();
106 
114  virtual PBoolean IsOpen() const;
115 
131  virtual PBoolean Read(
132  void * buf,
133  PINDEX len
134  );
135 
147  virtual int ReadChar();
148 
163  virtual PBoolean Write(
164  const void * buf,
165  PINDEX len
166  );
167 
176  virtual PBoolean Shutdown(
177  ShutdownValue option
178  );
179 
187  virtual bool SetLocalEcho(
188  bool localEcho
189  );
190 
191 
200  virtual PChannel * GetBaseReadChannel() const;
201 
210  virtual PChannel * GetBaseWriteChannel() const;
211 
217  virtual PString GetErrorText(
218  ErrorGroup group = NumErrorGroups
219  ) const;
221 
231  PBoolean Open(
232  PChannel & channel
233  );
234 
245  PBoolean Open(
246  PChannel * channel,
247  PBoolean autoDelete = true
248  );
249 
261  PBoolean Open(
264  PBoolean autoDeleteRead = true,
265  PBoolean autoDeleteWrite = true
266  );
267 
275  PChannel * Detach(
277  );
278 
284  PChannel * GetReadChannel() const;
285 
291  bool SetReadChannel(
292  PChannel * channel,
293  bool autoDelete = true,
294  bool closeExisting = false
295  );
296 
302  PChannel * GetWriteChannel() const;
303 
310  PChannel * channel,
311  bool autoDelete = true,
312  bool closeExisting = false
313  );
315 
316 
317  protected:
327  virtual PBoolean OnOpen();
328 
329 
330  // Member variables
333 
336 
339 
342 
345 };
346 
347 
348 #endif // PTLIB_INDIRECTCHANNEL_H
349 
350 
351 // End Of File ///////////////////////////////////////////////////////////////