holoscan::DataLoggerQueue
holoscan::DataLoggerQueue
Abstract base class for data logger queues.
This interface allows different queue implementations to be used by AsyncDataLoggerResource, enabling trade-offs between performance and ordering guarantees.
All implementations must be thread-safe for concurrent access from multiple producers and a single consumer (MPSC - Multiple Producer Single Consumer).
Template parameters
The type of elements stored in the queue (typically DataEntry)
Constructors
Destructor
~DataLoggerQueue
Methods
try_enqueue
Attempt to enqueue an item (thread-safe).
Returns: true if successfully enqueued, false if queue is full
Parameters
The item to enqueue (will be moved)
try_dequeue
Attempt to dequeue an item (thread-safe).
Returns: true if an item was dequeued, false if queue is empty
Parameters
Output parameter where the dequeued item will be moved
size_approx
Get size of the queue (thread-safe).
Note: The accuracy of this value depends on the implementation:
- LockFreeQueue: Returns an approximation that may be stale by the time it’s returned
- OrderedQueue: Returns the exact size at the moment the mutex was acquired
Returns: Number of items in the queue (approximation or exact, depending on implementation)