this class for use by ByteQueue only
| 6 | |
| 7 | // this class for use by ByteQueue only |
| 8 | class ByteQueueNode |
| 9 | { |
| 10 | public: |
| 11 | ByteQueueNode(unsigned int maxSize); |
| 12 | |
| 13 | unsigned int CurrentSize() const |
| 14 | {return tail-head;} |
| 15 | unsigned int UsedUp() const |
| 16 | {return (head==MaxSize());} |
| 17 | |
| 18 | unsigned int Put(byte inByte); |
| 19 | unsigned int Put(const byte *inString, unsigned int length); |
| 20 | |
| 21 | unsigned int Get(byte &outByte); |
| 22 | unsigned int Get(byte *outString, unsigned int getMax); |
| 23 | |
| 24 | unsigned int Peek(byte &outByte) const; |
| 25 | |
| 26 | void CopyTo(BufferedTransformation &target) const |
| 27 | {target.Put(buf+head, tail-head);} |
| 28 | void CopyTo(byte *target) const |
| 29 | {memcpy(target, buf+head, tail-head);} |
| 30 | |
| 31 | byte operator[](unsigned int i) const |
| 32 | {return buf[i-head];} |
| 33 | |
| 34 | ByteQueueNode *next; |
| 35 | |
| 36 | private: |
| 37 | unsigned int MaxSize() const {return buf.size;} |
| 38 | |
| 39 | SecByteBlock buf; |
| 40 | unsigned int head, tail; |
| 41 | }; |
| 42 | |
| 43 | |
| 44 | ByteQueueNode::ByteQueueNode(unsigned int maxSize) |
nothing calls this directly
no outgoing calls
no test coverage detected