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
com/queue/queue.h
- Committer:
- dereklmc
- Date:
- 2013-06-09
- Revision:
- 30:17297295ce0c
- Parent:
- 16:5f736b955d53
File content as of revision 30:17297295ce0c:
/**************************** 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
