Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
DequeueBuffer Class Reference

A dequeue based on a contiguous buffer in memory. More...

#include <dequeue_buffer.h>

Public Member Functions

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(). More...
 
char * Tail ()
 A pointer to the next place to write data to.
 
size_t TailSpace ()
 The number of bytes beyond Tail() that are allocated and may be written to.
 
void HaveEnqueued (size_t bytes)
 Call to indicate that bytes have been written in the range Tail() ... More...
 

Detailed Description

A dequeue based on a contiguous buffer in memory.

Used for buffering data between recv() and ber_decode()

Definition at line 11 of file dequeue_buffer.h.

Member Function Documentation

◆ Consume()

void DequeueBuffer::Consume ( size_t  bytes)

Called after bytes have been read from Head().

Remove them from the head of the queue.

Definition at line 16 of file dequeue_buffer.cc.

◆ HaveEnqueued()

void DequeueBuffer::HaveEnqueued ( size_t  bytes)

Call to indicate that bytes have been written in the range Tail() ...

Tail() + TailSpace().

Definition at line 43 of file dequeue_buffer.cc.


The documentation for this class was generated from the following files: