High Performance OPC UA Server SDK
1.2.0.193
|
A queue that is implemented as a ring buffer. More...
Data Structures | |
struct | util_ringqueue |
Structure for the ringqueue, see also ringqueue. More... | |
Macros | |
#define | util_ringqueue_foreach(i, queue) for (i = util_ringqueue_index_first(queue); i != -1; i = util_ringqueue_index_next(queue, i)) |
Foreach loop for iterating through a ringqueue. | |
Functions | |
int | util_ringqueue_size (int num_elements) |
Computes the size in bytes for num_elements ringqueue entries. More... | |
void | util_ringqueue_init (struct util_ringqueue *queue, void *data, int size) |
Initializes a ringqueue. More... | |
void * | util_ringqueue_clear (struct util_ringqueue *queue) |
Clear the ringqueue queue . More... | |
unsigned int | util_ringqueue_count (struct util_ringqueue *queue) |
Get the current number of elements in a ringqueue. | |
bool | util_ringqueue_full (struct util_ringqueue *queue) |
Test if the ringqueue queue is full. More... | |
unsigned int | util_ringqueue_max (struct util_ringqueue *queue) |
Get the maximum capacity of a queue. | |
int | util_ringqueue_put_front (struct util_ringqueue *queue, void *data) |
Insert an element data at the front of the ringqueue queue . More... | |
int | util_ringqueue_put_end (struct util_ringqueue *queue, void *data) |
Insert an element data at the end of the ringqueue queue . More... | |
void * | util_ringqueue_pop_front (struct util_ringqueue *queue) |
Remove an element at the front of the ringqueue queue . More... | |
void * | util_ringqueue_pop_end (struct util_ringqueue *queue) |
Remove an element at the end of the ringqueue queue . More... | |
int | util_ringqueue_index_first (struct util_ringqueue *queue) |
Get the index to the first element of the queue. More... | |
int | util_ringqueue_index_next (struct util_ringqueue *queue, int idx) |
Get the index to the next element of the queue. More... | |
void * | util_ringqueue_get_index (struct util_ringqueue *queue, int idx) |
Get the element at a given index idx of the queue. More... | |
void * | util_ringqueue_get_front (struct util_ringqueue *queue) |
Get the element at the front of the queue. More... | |
void * | util_ringqueue_get_end (struct util_ringqueue *queue) |
Get the element at the end of the queue. More... | |
A queue that is implemented as a ring buffer.
Allows to store arbitrary number of elements, however internal buffer must be provided by user. It is possible to add and remove elements at front and back of the queue.
void* util_ringqueue_clear | ( | struct util_ringqueue * | queue | ) |
Clear the ringqueue queue
.
bool util_ringqueue_full | ( | struct util_ringqueue * | queue | ) |
Test if the ringqueue queue
is full.
void* util_ringqueue_get_end | ( | struct util_ringqueue * | queue | ) |
Get the element at the end of the queue.
void* util_ringqueue_get_front | ( | struct util_ringqueue * | queue | ) |
Get the element at the front of the queue.
void* util_ringqueue_get_index | ( | struct util_ringqueue * | queue, |
int | idx | ||
) |
Get the element at a given index idx
of the queue.
int util_ringqueue_index_first | ( | struct util_ringqueue * | queue | ) |
Get the index to the first element of the queue.
int util_ringqueue_index_next | ( | struct util_ringqueue * | queue, |
int | idx | ||
) |
Get the index to the next element of the queue.
void util_ringqueue_init | ( | struct util_ringqueue * | queue, |
void * | data, | ||
int | size | ||
) |
Initializes a ringqueue.
queue | The ringqueue context. |
data | Pointer to preallocated memory to use for the ringqueue. |
size | Size of data in bytes, see util_list_size. |
void* util_ringqueue_pop_end | ( | struct util_ringqueue * | queue | ) |
Remove an element at the end of the ringqueue queue
.
void* util_ringqueue_pop_front | ( | struct util_ringqueue * | queue | ) |
Remove an element at the front of the ringqueue queue
.
int util_ringqueue_put_end | ( | struct util_ringqueue * | queue, |
void * | data | ||
) |
Insert an element data
at the end of the ringqueue queue
.
int util_ringqueue_put_front | ( | struct util_ringqueue * | queue, |
void * | data | ||
) |
Insert an element data
at the front of the ringqueue queue
.
int util_ringqueue_size | ( | int | num_elements | ) |
Computes the size in bytes for num_elements
ringqueue entries.
This can be used by the called to allocate the correct amount of memory for util_ringqueue_init.