00001 /* 00002 * This file is part of the Standard Portable Library (SPL). 00003 * 00004 * SPL is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * SPL is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with SPL. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 #ifndef _threadedpacketstream_h 00018 #define _threadedpacketstream_h 00019 00020 #include <spl/io/Stream.h> 00021 #include <spl/net/Packet.h> 00022 00029 class ThreadedPacketStream; 00030 typedef RefCountPtr<ThreadedPacketStream> ThreadedPacketStreamPtr; 00031 00032 REGISTER_TYPEOF(144, ThreadedPacketStreamPtr); 00033 00038 class ThreadedPacketStream : public IMemoryValidate 00039 { 00040 protected: 00041 PacketBuilder m_builder; 00042 StreamReadPump m_conn; 00043 00044 public: 00045 ThreadedPacketStream(IPacketListener *listener, spl::IStreamPtr conn); 00046 virtual ~ThreadedPacketStream(); 00047 00048 #if defined(DEBUG) || defined(_DEBUG) 00049 virtual void CheckMem() const; 00050 virtual void ValidateMem() const; 00051 #endif 00052 }; 00053 00054 REGISTER_TYPEOF(146, ThreadedPacketStream); 00055 00058 #endif