Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * [ArrayBasedQueue.h]
- * The ArrayBasedQueue class declaration/specification.
- */
- #ifndef ARRAYBASEDQUEUE_H
- #define ARRAYBASEDQUEUE_H
- #include <iostream>
- class ArrayBasedQueue
- {
- /**
- * Everything under public can be accessed by all other programs or classes.
- */
- public:
- /**
- * Constructor(s):
- */
- ArrayBasedQueue(int);
- /**
- * Destructor:
- */
- ~ArrayBasedQueue();
- /**
- * 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:
- float *pData; // a pointer to the data (because the data is going to be stored in a dynamic array)
- int q_rear; // the rear of the queue
- int q_front; // the front of the queue
- int MAX_LENGTH; // the max length of the queue
- };
- #endif // ARRAYBASEDQUEUE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement