|
template<size_t N> |
| CharQueue (char(&array)[N], const int lockNumber=locknew()) |
|
| CharQueue (char *array, const size_t length, const int lockNumber) |
|
virtual char | get_char () |
| Read and return a single character. Whether the method is blocking or not depends entirely on the implementation.
|
|
virtual void | put_char (const char c) |
| Print a single character. More...
|
|
virtual void | puts (const char *string) |
|
size_t | size () const |
| Obtain the number of elements in the queue. More...
|
|
bool | is_empty () const |
| Determine if any elements exist. More...
|
|
bool | is_full () const |
| Determine if inserting another element would overwrite data. More...
|
|
void | clear () |
| Remove all data from the queue.
|
|
virtual Queue & | enqueue (const char &value) |
| Insert an element to the buffer. More...
|
|
Queue & | insert (const char &value) |
|
virtual char | dequeue () |
| Return and remove the oldest value in the buffer. More...
|
|
char | peek () const |
| Return the oldest value in the buffer without removing it from the buffer. More...
|
|
bool | check (const char &value) const |
| Determine if a value is valid. More...
|
|
virtual void | puts (const char string[])=0 |
| Send a null-terminated character array. Though this method could be created using put_char, some objects (such as PropWare::UART), have optimized methods for sending a string and PrintCapable::puts can utilize them. More...
|
|
Provide a communication buffer for character data between cogs.
Typically used for buffered UART implementations. Note that the put_char and get_char methods are blocking to ensure that put_char does not attempt to write to a full buffer and get_char does not attempt to read from an empty buffer. For this reason, you should be careful about using the enqueue and dequeue methods directly when using a CharQueue object because they will allow you to write to a full queue and read from an empty one.
- Examples
- BufferedUART_Demo.cpp.
Definition at line 46 of file charqueue.h.