SensESP 3.3.0
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SafeQueue< T > Class Template Reference

Thread-safe queue for inter-task communication. More...

#include <sensesp/system/task_queue_producer.h>

Inheritance diagram for sensesp::SafeQueue< T >:
[legend]

Public Member Functions

 SafeQueue (size_t max_size=10)
 SafeQueue (const SafeQueue &)=delete
SafeQueueoperator= (const SafeQueue &)=delete
 SafeQueue (SafeQueue &&)=delete
SafeQueueoperator= (SafeQueue &&)=delete
void push (const T &value)
bool pop (T &value, unsigned int max_duration_ms)
bool empty ()
size_t size ()

Detailed Description

template<typename T>
class sensesp::SafeQueue< T >

Thread-safe queue for inter-task communication.

Uses a statically allocated FreeRTOS mutex (no heap allocation) to avoid corruption from heap fragmentation or adjacent stack overflows.

Instances must outlive all tasks that access them. Destroying a SafeQueue while another task is blocked on it is undefined behavior.

Template Parameters
T

Definition at line 26 of file task_queue_producer.h.

Constructor & Destructor Documentation

◆ SafeQueue() [1/3]

template<typename T>
sensesp::SafeQueue< T >::SafeQueue ( size_t max_size = 10)
inline

Definition at line 28 of file task_queue_producer.h.

Here is the caller graph for this function:

◆ SafeQueue() [2/3]

template<typename T>
sensesp::SafeQueue< T >::SafeQueue ( const SafeQueue< T > & )
delete
Here is the call graph for this function:

◆ SafeQueue() [3/3]

template<typename T>
sensesp::SafeQueue< T >::SafeQueue ( SafeQueue< T > && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ empty()

template<typename T>
bool sensesp::SafeQueue< T >::empty ( )
inline

Definition at line 65 of file task_queue_producer.h.

◆ operator=() [1/2]

template<typename T>
SafeQueue & sensesp::SafeQueue< T >::operator= ( const SafeQueue< T > & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
SafeQueue & sensesp::SafeQueue< T >::operator= ( SafeQueue< T > && )
delete
Here is the call graph for this function:

◆ pop()

template<typename T>
bool sensesp::SafeQueue< T >::pop ( T & value,
unsigned int max_duration_ms )
inline

Definition at line 52 of file task_queue_producer.h.

◆ push()

template<typename T>
void sensesp::SafeQueue< T >::push ( const T & value)
inline

Definition at line 38 of file task_queue_producer.h.

◆ size()

template<typename T>
size_t sensesp::SafeQueue< T >::size ( )
inline

Definition at line 74 of file task_queue_producer.h.


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