| 10 | class ByteQueueNode; |
| 11 | |
| 12 | class ByteQueue : public BufferedTransformation |
| 13 | { |
| 14 | public: |
| 15 | ByteQueue(unsigned int nodeSize=256); |
| 16 | ByteQueue(const ByteQueue ©); |
| 17 | ~ByteQueue(); |
| 18 | |
| 19 | // how many bytes currently stored |
| 20 | unsigned long CurrentSize() const; |
| 21 | unsigned long MaxRetrieveable() |
| 22 | {return CurrentSize();} |
| 23 | |
| 24 | void Put(byte inByte); |
| 25 | void Put(const byte *inString, unsigned int length); |
| 26 | |
| 27 | // both functions returns the number of bytes actually retrived |
| 28 | unsigned int Get(byte &outByte); |
| 29 | unsigned int Get(byte *outString, unsigned int getMax); |
| 30 | |
| 31 | unsigned int Peek(byte &outByte) const; |
| 32 | |
| 33 | void CopyTo(BufferedTransformation &target) const; |
| 34 | void CopyTo(byte *target) const; |
| 35 | |
| 36 | ByteQueue & operator=(const ByteQueue &rhs); |
| 37 | bool operator==(const ByteQueue &rhs) const; |
| 38 | byte operator[](unsigned long i) const; |
| 39 | |
| 40 | private: |
| 41 | void CopyFrom(const ByteQueue ©); |
| 42 | void Destroy(); |
| 43 | |
| 44 | unsigned int nodeSize; |
| 45 | ByteQueueNode *head, *tail; |
| 46 | }; |
| 47 | |
| 48 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected