Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** ADT deque interface
- @file DequeInterface.h */
- #ifndef _DEQUE_INTERFACE
- #define _DEQUE_INTERFACE
- template<class ItemType>
- class DequeInterface
- {
- /** Checks to see if deque is empty
- @pre None.
- @return True if empty, false if not */
- virtual bool empty() const = 0;
- /** Insert a new entry into the front of deque
- @post newEntry is at the
- front of the deque, if the operation is succesful.
- @param newEntry The object to be added as a new entry.
- @return Returns true if addition is successful, otherwise false */
- virtual bool addFront(const ItemType& newEntry) = 0;
- /** Adds a new entry to the back of this deque.
- @post If successful, newEntry is at the
- back of the deque.
- @param newEntry The object to be added as a new entry.
- @return True if the addition is successful or false if not. */
- virtual bool addBack(const ItemType& newEntry) = 0;
- /** Removes the front of this deque.
- @post If the operation was successful, the front of the deque
- has been removed.
- @return True if the removal is successful or false if not. */
- virtual bool removeFront() = 0;
- /** Removes the back of this deque.
- @post If the operation was successful, the front of the deque
- has been removed.
- @return True if the removal is successful or false if not. */
- virtual bool removeBack() = 0;
- /** Returns the front of this deque.
- @pre The deque is not empty.
- @post The front of the deque has been returned, and the
- deque is unchanged.
- @return The front of the deque. */
- virtual ItemType peekFront() const = 0;
- /** Returns the back of this deque.
- @pre The deque is not empty.
- @post The back of the deque has been returned, and the
- deque is unchanged.
- @return The back of the deque. */
- virtual ItemType peekBack() const = 0;
- } // end DequeInterface
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement