COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Queue.hh>
Public Member Functions | |
Queue () | |
uint8_t | available () const |
uint8_t | room () const |
bool | enqueue (T *data) |
bool | enqueue_P (const T *data) |
bool | dequeue (T *data) |
void | await (T *data) |
Template class for ring-buffer for queueing data elements. See Event::queue for an example of usage.
[in] | T | element class. |
[in] | nmemb | number of elements in queue. |
|
inline |
void Queue< T, NMEMB >::await | ( | T * | data | ) |
bool Queue< T, NMEMB >::dequeue | ( | T * | data | ) |
Dequeue member data from queue to given buffer. Returns true(1) if member was available and succcessful otherwise false(0). Synchronised operation as interrupt handler may push events.
[in,out] | data | pointer to member data buffer. |
bool Queue< T, NMEMB >::enqueue | ( | T * | data | ) |
Enqueue given member data if storage is available. Return true(1) if successful otherwise false(0). Synchronised operation as interrupt handler may push events.
[in] | data | pointer to member data buffer. |
bool Queue< T, NMEMB >::enqueue_P | ( | const T * | data | ) |
Enqueue given member data in program memory if storage is available. Return true(1) if successful otherwise false(0). Synchronised operation as interrupt handler may push events.
[in] | data | pointer to member data buffer in program memory. |
|
inline |