队列  0.1
数据结构_第4章
Queue.h
Go to the documentation of this file.
1 /****************************************************
2  * @file Queue.h
3  * @author Guorui Wei (313017602@qq.com)
4  * @brief 队列的抽象类
5  * @version 0.1
6  * @date 2020-04-05
7  *
8  * @copyright Copyright (c) 2020
9  *
10  * See the file LICENSE in the top directory of this distribution for
11  * more information.
12  *
13  ****************************************************/
14 
15 #ifndef __QUEUE_H__
16 #define __QUEUE_H__
17 
18 #include <cstddef>
19 
24 namespace Queue
25 {
26 
32 template <typename T>
33 class Queue
34 {
35 public:
42  typedef T value_type;
43  typedef value_type &reference;
44  typedef const value_type &const_reference;
45  typedef size_t size_type;
46 
47 public:
54  virtual bool isEmpty() const = 0;
55 
61  virtual void enQueue(const value_type &x) = 0;
62 
68  virtual value_type deQueue() = 0;
69 
75  virtual value_type getHead() const = 0;
76 
81  virtual ~Queue() = default;
82 };
83 
84 } // namespace Queue
85 
86 #include "linkQueue.hh"
87 #include "seqQueue.hh"
88 #include "vecQueue.hh"
89 
90 #endif
vecQueue.hh
Queue::Queue::value_type
T value_type
类型别名定义
Definition: Queue.h:66
seqQueue.hh
Queue
ԶĶ඼Queueֿռ(linkQueue.hh)
Definition: linkQueue.hh:25
Queue::Queue::size_type
size_t size_type
计数器类型
Definition: Queue.h:69
linkQueue.hh