modm API documentation
modm::atomic::Queue< T, N > Class Template Reference

Interrupt save queue. More...

#include <modm/architecture/driver/atomic/queue.hpp>

Public Typedefs

using Index = std::conditional_t< (N >=254), uint16_t, uint8_t >
 
using Size = Index
 

Public Member Functions

bool isFull () const
 
bool isNotFull () const
 
bool isNearlyFull () const
 
bool isEmpty () const
 
bool isNotEmpty () const
 
bool isNearlyEmpty () const
 
Size getMaxSize () const
 
Size getSize () const
 
const T & get () const
 
bool push (const T &value)
 
void pop ()
 

Detailed Description

template<typename T, std::size_t N>
class modm::atomic::Queue< T, N >

Interrupt save queue.

A maximum size of 254 is allowed for 8-bit microcontrollers.

Member Function Documentation

template<typename T , std::size_t N>
bool modm::atomic::Queue< T, N >::isNearlyEmpty ( ) const

Check if the queue is nearly empty.

Returns
true if less than three elements are stored in the queue, false otherwise.

Only works with queue with more than three elements. TODO: calculations are approximate and may include off-by-one errors.

template<typename T , std::size_t N>
bool modm::atomic::Queue< T, N >::isNearlyFull ( ) const
Returns
false if less than three elements can be stored in queue.

Only works with queue with more than three elements.


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