Add peek method to circular buffer.
This commit is contained in:
parent
17fa6bfd9a
commit
d6cba83322
2 changed files with 6 additions and 0 deletions
|
@ -127,6 +127,11 @@ circular_buffer::dequeue(void *dst) {
|
|||
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
circular_buffer::peek() {
|
||||
return &_buffer[_next];
|
||||
}
|
||||
|
||||
bool
|
||||
circular_buffer::is_empty() {
|
||||
return _unread == 0;
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
void transfer(void *dst);
|
||||
void enqueue(void *src);
|
||||
void dequeue(void *dst);
|
||||
uint8_t *peek();
|
||||
bool is_empty();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue