Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ESC SR04 TSI
Diff: com/queue/queue.h
- Revision:
- 33:6b25a5721a20
- Parent:
- 30:17297295ce0c
diff -r 17297295ce0c -r 6b25a5721a20 com/queue/queue.h --- a/com/queue/queue.h Sun Jun 09 04:14:21 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/**************************** queue.h ****************************************/ -/* */ -/* Authers: Greg Abdo. */ -/* Date: February 23, 2013 */ -/* Version: 1.0 */ -/* */ -/* The queue is used to stack StructureItem in order with a FILO arrangement.*/ -/*****************************************************************************/ - -#ifndef QUEUE_H -#define QUEUE_H - -#include "mbed.h" - -using namespace std; - -class queue -{ -public: - queue(); // Queue constructor - ~queue(); // Queue destructor - - bool isEmpty(); // Check for an empty queue. - void clear(); // Clears the entire queue. - void add( char* ); // Push commandData into the queue. - char* peek(); // Look at the last item in the queue. - char* pop(); // Pop the top item off the queue. - void printAll(); // Print the entire queue. - -private: - struct queueNode // Node object for the queue. - { - queueNode( char* array ) - { - data = array; - next = NULL; - } - - ~queueNode() - {} - - char* data; // Pointer to the StructureItem object. - queueNode * next; // Next node in the queue. - }; - - queueNode * front; // Root of the queue. -}; - -#endif