#ifndef __CIRCULARBUFFER_H__ /* (C) 2003 XDA Developers itsme@xs4all.nl * * $Header$ */ #include #include "vectorutils.h" class CircularBuffer { public: CircularBuffer(int max); ~CircularBuffer(); int Get(ByteVector& buf, int timeout); bool Put(const ByteVector& buf); private: ByteVector::iterator m_head; ByteVector::iterator m_tail; int m_size; int m_overflows; ByteVector m_buf; CRITICAL_SECTION m_lock; HANDLE m_hEvent; }; #define __CIRCULARBUFFER_H__ #endif