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

Thread-safe queue for inter-task communication. Works like std::queue. More...

#include <sensesp/system/task_queue_producer.h>

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

Public Member Functions

 SafeQueue ()
 
void push (const T &value)
 
bool pop (T &value, unsigned int max_duration_ms)
 
bool empty ()
 
size_t size ()
 

Protected Attributes

SemaphoreHandle_t queue_semaphore_
 
SemaphoreHandle_t write_lock_
 

Detailed Description

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

Thread-safe queue for inter-task communication. Works like std::queue.

Template Parameters
T

Definition at line 19 of file task_queue_producer.h.

Constructor & Destructor Documentation

◆ SafeQueue()

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

Definition at line 21 of file task_queue_producer.h.

Member Function Documentation

◆ empty()

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

Definition at line 46 of file task_queue_producer.h.

◆ pop()

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

Definition at line 34 of file task_queue_producer.h.

◆ push()

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

Definition at line 27 of file task_queue_producer.h.

◆ size()

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

Definition at line 53 of file task_queue_producer.h.

Member Data Documentation

◆ queue_semaphore_

template<typename T >
SemaphoreHandle_t sensesp::SafeQueue< T >::queue_semaphore_
protected

Definition at line 61 of file task_queue_producer.h.

◆ write_lock_

template<typename T >
SemaphoreHandle_t sensesp::SafeQueue< T >::write_lock_
protected

Definition at line 62 of file task_queue_producer.h.


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