2001-10-06 14:13:28 +00:00
|
|
|
#ifndef CINPUTPACKETSTREAM_H
|
|
|
|
#define CINPUTPACKETSTREAM_H
|
|
|
|
|
|
|
|
#include "CInputStreamFilter.h"
|
|
|
|
#include "CBufferedInputStream.h"
|
|
|
|
#include "CMutex.h"
|
|
|
|
|
|
|
|
class CInputPacketStream : public CInputStreamFilter {
|
|
|
|
public:
|
|
|
|
CInputPacketStream(IInputStream*, bool adoptStream = true);
|
|
|
|
~CInputPacketStream();
|
|
|
|
|
|
|
|
// manipulators
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
|
|
|
|
// IInputStream overrides
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual void close();
|
|
|
|
virtual UInt32 read(void*, UInt32 maxCount);
|
|
|
|
virtual UInt32 getSize() const;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
private:
|
2001-10-14 16:58:01 +00:00
|
|
|
UInt32 getSizeNoLock() const;
|
|
|
|
bool hasFullMessage() const;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
CMutex m_mutex;
|
|
|
|
mutable UInt32 m_size;
|
|
|
|
mutable CBufferedInputStream m_buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|