Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * [LinkedQueue.h]
- * The LinkedQueue class declaration/specification.
- */
- #ifndef LINKEDQUEUE_H
- #define LINKEDQUEUE_H
- #include <iostream>
- struct Node
- {
- float element;
- Node *next;
- };
- class LinkedQueue
- {
- /**
- * Everything under public can be accessed by all other programs or classes.
- */
- public:
- /**
- * Constructor(s):
- */
- LinkedQueue();
- /**
- * Destructor:
- */
- ~LinkedQueue();
- /**
- * Mutators:
- */
- void Enqueue(float);
- /**
- * Accessors:
- */
- void Dequeue(float &);
- /**
- * General Use:
- */
- void MakeEmpty(void); // empties the queue
- bool IsEmpty(void); // returns true if the queue is empty
- bool IsFull(void); // returns true if the queue is full
- /**
- * Everything under protected can be accessed only by the class itself or (derived) subclasses,
- * as in the case of inheritance.
- */
- protected:
- /**
- * (Private) DATA MEMBERS/PROPERTIES:
- *
- * Everything under private can only be accessed by the class itself (the code in the
- * implementation file).
- */
- private:
- Node *q_front; // a node representing (pointing to) the front of the queue
- Node *q_rear; // a node representing (pointing to) the rear of the queue
- };
- #endif // LINKEDQUEUE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement