Advertisement
Phr0zen_Penguin

LinkedQueue.h - VTC C++ Linked Queue Header

May 3rd, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1. /**
  2.  * [LinkedQueue.h]
  3.  * The LinkedQueue class declaration/specification.
  4.  */
  5.  
  6. #ifndef LINKEDQUEUE_H
  7. #define LINKEDQUEUE_H
  8.  
  9. #include <iostream>
  10.  
  11. struct Node
  12. {
  13.     float   element;
  14.     Node    *next;
  15. };
  16.  
  17. class LinkedQueue
  18. {
  19.     /**
  20.      * Everything under public can be accessed by all other programs or classes.
  21.      */
  22.     public:
  23.         /**
  24.          * Constructor(s):
  25.          */
  26.         LinkedQueue();
  27.  
  28.         /**
  29.          * Destructor:
  30.          */
  31.         ~LinkedQueue();
  32.  
  33.         /**
  34.          * Mutators:
  35.          */
  36.         void Enqueue(float);
  37.  
  38.         /**
  39.          * Accessors:
  40.          */
  41.         void Dequeue(float &);
  42.  
  43.         /**
  44.          * General Use:
  45.          */
  46.         void MakeEmpty(void);       // empties the queue
  47.         bool IsEmpty(void);         // returns true if the queue is empty
  48.         bool IsFull(void);          // returns true if the queue is full
  49.  
  50.  
  51.     /**
  52.      * Everything under protected can be accessed only by the class itself or (derived) subclasses,
  53.      * as in the case of inheritance.
  54.      */
  55.     protected:
  56.  
  57.  
  58.     /**
  59.      * (Private) DATA MEMBERS/PROPERTIES:
  60.      *
  61.      * Everything under private can only be accessed by the class itself (the code in the
  62.      * implementation file).
  63.      */
  64.     private:
  65.         Node    *q_front;   // a node representing (pointing to) the front of the queue
  66.         Node    *q_rear;    // a node representing (pointing to) the rear of the queue
  67. };
  68.  
  69. #endif // LINKEDQUEUE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement