00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _dualchannelstream_h
00018 #define _dualchannelstream_h
00019
00020 #include <spl/io/Stream.h>
00021
00028 class DualChannelStream;
00029 typedef RefCountPtrCast<DualChannelStream, spl::IStream, spl::IStreamPtr> DualChannelStreamPtr;
00030 typedef WeakReference<DualChannelStream, spl::IStreamPtr> DualChannelStreamRef;
00031
00032 REGISTER_TYPEOF(86, DualChannelStreamPtr);
00033 REGISTER_TYPEOF( 451, DualChannelStreamRef );
00034
00038 class DualChannelStream : public spl::IStream
00039 {
00040 protected:
00041 spl::IStreamPtr m_in;
00042 spl::IStreamPtr m_out;
00043
00044 public:
00045 DualChannelStream(spl::IStreamPtr input, spl::IStreamPtr output, bool canClose = false);
00046 virtual ~DualChannelStream();
00047
00048 virtual void Close();
00049 virtual void Flush();
00050 virtual int Read(Array<byte>& buffer, const int offset, int count);
00051 virtual int ReadByte();
00052 virtual long Seek(const long offset, const SeekOrigin origin);
00053 virtual void Write(const Array<byte>& buffer, const int offset, const int count);
00054 virtual void WriteByte(byte value);
00055
00056 virtual bool CanRead() const;
00057 virtual bool CanSeek() const;
00058 virtual bool CanWrite() const;
00059
00060 virtual long Length() const;
00061 virtual long Position() const;
00062
00063 #ifdef DEBUG
00064 virtual void ValidateMem() const;
00065 virtual void CheckMem() const;
00066 #endif
00067 };
00068
00069 REGISTER_TYPEOF(88, DualChannelStream);
00070
00073 #endif