|
树
0.1
数据结构_第6章
|
队头位置固定的队列类 More...
#include <vecQueue.hh>
Public Types | |
| typedef T | value_type |
| 类型别名定义 More... | |
| typedef value_type & | reference |
| 数据的引用 More... | |
| typedef size_t | size_type |
| 计数器类型 More... | |
Public Types inherited from Queue::Queue< T > | |
| typedef T | value_type |
| 类型别名定义 More... | |
| typedef value_type & | reference |
| 数据的引用 More... | |
| typedef size_t | size_type |
| 计数器类型 More... | |
Public Member Functions | |
| vecQueue (size_type initSize=10) | |
| Construct a new vec Queue object. More... | |
| virtual | ~vecQueue () |
| Destroy the vec Queue object. More... | |
| virtual bool | isEmpty () const |
| 判队空 More... | |
| virtual void | enQueue (const_reference &x) |
| 入队一个元素 More... | |
| virtual value_type | deQueue () |
| 出队一个元素 More... | |
| virtual value_type | getHead () const |
| Get the Head object. More... | |
| bool | empty () const |
| Test whether container is empty. More... | |
| size_type | size () const |
| Returns the number of elements in the queue. More... | |
| reference & | front () |
| Returns a reference to the next element in the queue. More... | |
| const_reference & | front () const |
| Returns a reference to the next element in the queue. More... | |
| reference & | back () |
| Returns a reference to the last element in the queue. More... | |
| const_reference & | back () const |
| Returns a reference to the last element in the queue. More... | |
| void | push (const value_type &val) |
| Inserts a new element at the end of the queue, after its current last element. More... | |
| void | push (value_type &&val) |
| Inserts a new element at the end of the queue, after its current last element. More... | |
| void | pop () |
| Removes the next element in the queue. More... | |
Public Member Functions inherited from Queue::Queue< T > | |
| virtual void | enQueue (const value_type &x)=0 |
| 入队一个元素 More... | |
| virtual | ~Queue ()=default |
| Destroy the Queue object. More... | |
Public Attributes | |
| const typedef value_type & | const_reference |
| 数据的常量引用 More... | |
Public Attributes inherited from Queue::Queue< T > | |
| const typedef value_type & | const_reference |
| 数据的常量引用 More... | |
Private Member Functions | |
| void | doubleSpace () |
| 扩大数组空间 More... | |
Private Attributes | |
| size_type | _maxSize |
| 内部数组的规模 More... | |
| value_type * | _data |
| 存储队列的动态数组 More... | |
| size_type | _rear |
| 队尾下标 More... | |
队头位置固定的队列类
| T | 数据的类型 |
Definition at line 46 of file vecQueue.hh.
| typedef value_type& Queue::vecQueue< T >::reference |
数据的引用
Definition at line 68 of file vecQueue.hh.
| typedef size_t Queue::vecQueue< T >::size_type |
计数器类型
Definition at line 70 of file vecQueue.hh.
| typedef T Queue::vecQueue< T >::value_type |
| Queue::vecQueue< T >::vecQueue | ( | size_type | initSize = 10 | ) |
Construct a new vec Queue object.
| initSize | 队列初始容量 |
Definition at line 211 of file vecQueue.hh.
|
virtual |
Destroy the vec Queue object.
Definition at line 217 of file vecQueue.hh.
| vecQueue< T >::const_reference & Queue::vecQueue< T >::back |
Returns a reference to the last element in the queue.
Definition at line 247 of file vecQueue.hh.
| const_reference& Queue::vecQueue< T >::back | ( | ) | const |
Returns a reference to the last element in the queue.
|
inlinevirtual |
出队一个元素
Implements Queue::Queue< T >.
Definition at line 138 of file vecQueue.hh.
|
private |
扩大数组空间
Definition at line 285 of file vecQueue.hh.
| bool Queue::vecQueue< T >::empty |
Test whether container is empty.
Definition at line 223 of file vecQueue.hh.
|
inlinevirtual |
| vecQueue< T >::const_reference & Queue::vecQueue< T >::front |
Returns a reference to the next element in the queue.
Definition at line 235 of file vecQueue.hh.
| const_reference& Queue::vecQueue< T >::front | ( | ) | const |
Returns a reference to the next element in the queue.
|
inlinevirtual |
Get the Head object.
Implements Queue::Queue< T >.
Definition at line 150 of file vecQueue.hh.
|
inlinevirtual |
判队空
Implements Queue::Queue< T >.
Definition at line 118 of file vecQueue.hh.
| void Queue::vecQueue< T >::pop |
Removes the next element in the queue.
Definition at line 277 of file vecQueue.hh.
| void Queue::vecQueue< T >::push | ( | const value_type & | val | ) |
Inserts a new element at the end of the queue, after its current last element.
| val | 数据的值 |
Definition at line 259 of file vecQueue.hh.
| void Queue::vecQueue< T >::push | ( | value_type && | val | ) |
Inserts a new element at the end of the queue, after its current last element.
| val | 数据的值 |
Definition at line 268 of file vecQueue.hh.
| vecQueue< T >::size_type Queue::vecQueue< T >::size |
Returns the number of elements in the queue.
Definition at line 229 of file vecQueue.hh.
|
private |
存储队列的动态数组
Definition at line 82 of file vecQueue.hh.
|
private |
内部数组的规模
Definition at line 76 of file vecQueue.hh.
|
private |
| const typedef value_type& Queue::vecQueue< T >::const_reference |
数据的常量引用
Definition at line 69 of file vecQueue.hh.