Pico-Arduino
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pico_arduino::Queue< T > Class Template Reference

Construct a new Pico Queue object. More...

#include <PicoQueue.h>

Public Member Functions

 Queue (int maxCount=100, bool blocking=true, bool withLock=true)
 Construct a new Queue object. More...
 
 ~Queue ()
 Destructor - calls queue_free.
 
void clear ()
 clears the queue by removing all elements
 
bool isEmpty ()
 checks if the queue is eimpty
 
bool isFull ()
 checks if the queue is full
 
bool peek (T &data)
 Reads the next element w/o removing it from the queue.
 
bool pop (T &data)
 Gets the next element (from the head) and removes it from the queue.
 
bool push (T &data)
 Adds an element (at the end) of the queue.
 
uint size ()
 Provides the number of entries in the queue.
 

Protected Member Functions

uint nextSpinlockNumber ()
 

Protected Attributes

bool is_blocking
 
queue_t q
 

Detailed Description

template<class T>
class pico_arduino::Queue< T >

Construct a new Pico Queue object.

Template Parameters
T
Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ Queue()

template<class T >
pico_arduino::Queue< T >::Queue ( int  maxCount = 100,
bool  blocking = true,
bool  withLock = true 
)
inline

Construct a new Queue object.

Parameters
maxCountmax number of entries
blockingtrue if blocking
withLocktrue if access is synchronized with locks

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