1 #ifndef UPTANE_DEQUEUE_BUFFER_H_ 2 #define UPTANE_DEQUEUE_BUFFER_H_ 46 static constexpr
int kSentinel = 1337161494;
51 size_t written_bytes_{0};
52 std::array<char, 4096> buffer_{};
54 int sentinel_{kSentinel};
57 #endif // UPTANE_DEQUEUE_BUFFER_H_ void HaveEnqueued(size_t bytes)
Call to indicate that bytes have been written in the range Tail() ...
char * Head()
A pointer to the first element that has not been Consumed().
size_t Size() const
The number of elements that are valid (have been written) after Head()
void Consume(size_t bytes)
Called after bytes have been read from Head().
size_t TailSpace()
The number of bytes beyond Tail() that are allocated and may be written to.
A dequeue based on a contiguous buffer in memory.
char * Tail()
A pointer to the next place to write data to.