Miosix  2.0alpha1
miosix::DynUnsyncQueue< T > Class Template Reference

#include <queue.h>

Public Member Functions

 DynUnsyncQueue (unsigned int elem)
 
bool isEmpty () const
 
bool isFull () const
 
unsigned int size () const
 
unsigned int capacity () const
 
bool tryPut (const T &elem)
 
bool tryGet (T &elem)
 
void reset ()
 
 ~DynUnsyncQueue ()
 

Detailed Description

template<typename T>
class miosix::DynUnsyncQueue< T >

An unsynchronized circular buffer data structure with the storage dynamically allocated on the heap. Note that unlike Queue, this class is only a data structure and not a synchronization primitive. The synchronization between the thread and the IRQ (or the other thread) must be done by the caller.

Constructor & Destructor Documentation

template<typename T >
miosix::DynUnsyncQueue< T >::DynUnsyncQueue ( unsigned int  elem)
inline

Constructor

Parameters
elemnumber of elements of the circular buffer
template<typename T >
miosix::DynUnsyncQueue< T >::~DynUnsyncQueue ( )
inline

Destructor

Member Function Documentation

template<typename T >
unsigned int miosix::DynUnsyncQueue< T >::capacity ( ) const
inline
Returns
the maximum number of elements the queue can hold
template<typename T >
bool miosix::DynUnsyncQueue< T >::isEmpty ( ) const
inline
Returns
true if the queue is empty
template<typename T >
bool miosix::DynUnsyncQueue< T >::isFull ( ) const
inline
Returns
true if the queue is full
template<typename T >
void miosix::DynUnsyncQueue< T >::reset ( )
inline

Erase all elements in the queue

template<typename T >
unsigned int miosix::DynUnsyncQueue< T >::size ( ) const
inline
Returns
the number of elements currently in the queue

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