00001 #ifndef SXPACKETQUEUE_H_INCLUDED 00002 #define SXPACKETQUEUE_H_INCLUDED 00003 00004 #include "sxGlobal.h" 00005 00006 class sxPacket; 00007 00011 class SX_SDKEXPORT sxPacketQueue 00012 { 00013 public: 00014 virtual ~sxPacketQueue(); 00015 explicit sxPacketQueue(size_t cap = 0); 00016 00017 bool Enqueue(sxPacket * packet); 00018 sxPacket * Dequeue(); 00019 sxPacket * Read(); 00020 size_t Size() const; 00021 size_t Capacity() const; 00022 bool IsEmpty() const; 00023 bool IsFull() const; 00024 void Reserve(size_t cap); 00025 void Resize(size_t cap); 00026 00027 bool Open(); 00028 void Close(); 00029 void Clear(); 00030 bool IsOpen() const; 00031 private: 00032 SX_DISABLE_COPY(sxPacketQueue) 00033 00034 class PrivateData; 00035 PrivateData * d_p; 00036 }; 00037 00038 00039 #endif // SXPACKETQUEUE_H_INCLUDED