Template Class DataLoggerQueue
Defined in File data_logger_queue.hpp
Derived Types
public holoscan::LockFreeQueue< T >(Template Class LockFreeQueue)public holoscan::OrderedQueue< T >(Template Class OrderedQueue)
-
template<typename T>
class 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
T – The type of elements stored in the queue (typically DataEntry)
Subclassed by holoscan::LockFreeQueue< T >, holoscan::OrderedQueue< T >
Public Functions
-
virtual ~DataLoggerQueue() = default
-
virtual bool try_enqueue(T &&item) = 0
Attempt to enqueue an item (thread-safe).
- Parameters
item – The item to enqueue (will be moved)
- Returns
true if successfully enqueued, false if queue is full
-
virtual bool try_dequeue(T &item) = 0
Attempt to dequeue an item (thread-safe).
- Parameters
item – Output parameter where the dequeued item will be moved
- Returns
true if an item was dequeued, false if queue is empty
-
virtual size_t size_approx() const = 0
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)