Struct rbuffer

Struct Documentation

struct rbuffer

Ringbuffer data structure. Implemented using a fixed-size array.

Public Members

void (*printe)(const void *const e)

For printing an element. Can be NULL. If NULL, calling rbuffer_print() is undefined.

int (*cmpe)(const void *const e1, const void *const e2)

For comparing elements. Can be NULL. If NULL, calling rbuffer_index_query() is undefined.

struct ds_iterator iter
dptr_t *elements

The actual data.

size_t current

Current # of elements in buffer.

size_t max_elts

Maximum number of elements in buffer.

size_t elt_size

Size of an element in bytes

size_t start

Next element insert index.

uint32_t flags

Run-time configuration flags.

Valid flags are:

All other flags are ignored.