libguac 1.6.0
 
Loading...
Searching...
No Matches
guac_fifo Struct Reference

Generic base structure for a FIFO of arbitrary events. More...

Data Fields

guac_flag state
 The current state of this FIFO.
 
size_t max_items
 The maximum number of items that may be stored in this FIFO.
 
size_t item_size
 The size of each individual item, in bytes.
 
size_t head
 The index of the first item within this FIFO.
 
size_t item_count
 The current number of items stored within this FIFO.
 
ssize_t items_offset
 The offset of the first byte of the implementation-specific array of items within this FIFO, relative to the first byte of guac_fifo structure.
 

Detailed Description

Generic base structure for a FIFO of arbitrary events.

The size of the FIFO and each event are up to the implementation. Each implementation must provide this base structure with a pointer to the underlying array of items, the maximum number of items supported, and the size in bytes of each item through a call to guac_fifo_init().

This generic base may be safely included in shared memory, but implementations building off this base must ensure the base is initialized with a call to guac_fifo_init() and that any additional implementation-specific aspects are also safe for shared memory usage.

Field Documentation

◆ head

size_t guac_fifo::head

The index of the first item within this FIFO.

As items are added/removed, this value will advance as necessary to avoid needing to spend CPU time moving existing items around in memory.

◆ item_size

size_t guac_fifo::item_size

The size of each individual item, in bytes.

All FIFO items must have a constant size, though that size is implementation-dependent.

◆ state

guac_flag guac_fifo::state

The current state of this FIFO.

This state primarily represents whether the FIFO contains at least one item (is non-empty), but it is also used to represent whether the FIFO is invalid (no longer permitted to contain any items).


The documentation for this struct was generated from the following file: