MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / ByteQueue

Class ByteQueue

src/cryptlib/queue.h:12–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10class ByteQueueNode;
11
12class ByteQueue : public BufferedTransformation
13{
14public:
15 ByteQueue(unsigned int nodeSize=256);
16 ByteQueue(const ByteQueue &copy);
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
40private:
41 void CopyFrom(const ByteQueue &copy);
42 void Destroy();
43
44 unsigned int nodeSize;
45 ByteQueueNode *head, *tail;
46};
47
48#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected