队列  0.1
数据结构_第4章
Queue::linkQueue< T > Class Template Referenceabstract

Ӷ More...

#include <linkQueue.hh>

Inheritance diagram for Queue::linkQueue< T >:
[legend]
Collaboration diagram for Queue::linkQueue< T >:
[legend]

Classes

struct  node
 linkQueueĽ More...
 

Public Types

typedef T value_type
 ͱ More...
 
typedef value_typereference
 ݵ More...
 
typedef size_t size_type
  More...
 

Public Member Functions

 linkQueue ()
 Construct a new link Queue object. More...
 
virtual ~linkQueue ()
 Destroy the link 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...
 
referencefront ()
 Returns a reference to the next element in the queue. More...
 
const_referencefront () const
 Returns a reference to the next element in the queue. More...
 
referenceback ()
 Returns a reference to the last element in the queue. More...
 
const_referenceback () 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. More...
 
void pop ()
 Removes the next element in the queue. More...
 

Public Attributes

const typedef value_typeconst_reference
 ݵij More...
 

Private Member Functions

virtual void enQueue (const value_type &x)=0
 入队一个元素 More...
 

Private Attributes

node_front
 ָ׽ More...
 
node_rear
 ָβ More...
 
size_type _size
 еǰԪظ More...
 

Detailed Description

template<typename T>
class Queue::linkQueue< T >

Ӷ

Template Parameters
Tݵ

Definition at line 46 of file linkQueue.hh.

Member Typedef Documentation

◆ reference

template<typename T >
typedef value_type& Queue::linkQueue< T >::reference

ݵ

Definition at line 68 of file linkQueue.hh.

◆ size_type

template<typename T >
typedef size_t Queue::linkQueue< T >::size_type

Definition at line 70 of file linkQueue.hh.

◆ value_type

template<typename T >
typedef T Queue::linkQueue< T >::value_type

ͱ

Note
ԣܷӻ̳

Definition at line 67 of file linkQueue.hh.

Constructor & Destructor Documentation

◆ linkQueue()

template<class T >
Queue::linkQueue< T >::linkQueue

Construct a new link Queue object.

Definition at line 246 of file linkQueue.hh.

◆ ~linkQueue()

template<class T >
Queue::linkQueue< T >::~linkQueue
virtual

Destroy the link Queue object.

Definition at line 252 of file linkQueue.hh.

Member Function Documentation

◆ back() [1/2]

template<class T >
linkQueue< T >::const_reference & Queue::linkQueue< T >::back

Returns a reference to the last element in the queue.

Returns
reference& βԪص

Definition at line 288 of file linkQueue.hh.

◆ back() [2/2]

template<typename T >
const_reference& Queue::linkQueue< T >::back ( ) const

Returns a reference to the last element in the queue.

Returns
const_reference& βԪصij

◆ deQueue()

template<typename T >
virtual value_type Queue::linkQueue< T >::deQueue ( )
inlinevirtual

һԪ

Returns
value_type

Implements Queue::Queue< T >.

Definition at line 173 of file linkQueue.hh.

◆ empty()

template<class T >
bool Queue::linkQueue< T >::empty

Test whether container is empty.

Returns
true is empty
false not empty

Definition at line 264 of file linkQueue.hh.

◆ enQueue() [1/2]

template<typename T >
virtual void Queue::Queue< T >::enQueue ( const value_type x)
pure virtualinherited

入队一个元素

Parameters
x数据的值

◆ enQueue() [2/2]

template<typename T >
virtual void Queue::linkQueue< T >::enQueue ( const_reference x)
inlinevirtual

һԪ

Parameters
xԪص

Definition at line 163 of file linkQueue.hh.

◆ front() [1/2]

template<class T >
linkQueue< T >::const_reference & Queue::linkQueue< T >::front

Returns a reference to the next element in the queue.

Returns
reference& Ԫص

Definition at line 276 of file linkQueue.hh.

Referenced by main().

Here is the caller graph for this function:

◆ front() [2/2]

template<typename T >
const_reference& Queue::linkQueue< T >::front ( ) const

Returns a reference to the next element in the queue.

Returns
const_reference& Ԫصij

◆ getHead()

template<typename T >
virtual value_type Queue::linkQueue< T >::getHead ( ) const
inlinevirtual

Get the Head object.

Returns
value_type Ԫصֵ

Implements Queue::Queue< T >.

Definition at line 185 of file linkQueue.hh.

◆ isEmpty()

template<typename T >
virtual bool Queue::linkQueue< T >::isEmpty ( ) const
inlinevirtual

жӿ

Returns
true ӿ
false ӷǿ

Implements Queue::Queue< T >.

Definition at line 153 of file linkQueue.hh.

Referenced by main().

Here is the caller graph for this function:

◆ pop()

template<class T >
void Queue::linkQueue< T >::pop

Removes the next element in the queue.

Note
effectively reducing its size by one.

Definition at line 322 of file linkQueue.hh.

Referenced by main().

Here is the caller graph for this function:

◆ push() [1/2]

template<class T >
void Queue::linkQueue< T >::push ( const value_type val)

Inserts a new element at the end of the queue, after its current last element.

Parameters
valݵֵ

Definition at line 300 of file linkQueue.hh.

Referenced by main().

Here is the caller graph for this function:

◆ push() [2/2]

template<class T >
void Queue::linkQueue< T >::push ( value_type &&  val)

Inserts a new element at the end of the queue.

Note
after its current last element
Parameters
valݵֵ

Definition at line 311 of file linkQueue.hh.

References Queue::linkQueue< T >::node::_next.

◆ size()

template<class T >
linkQueue< T >::size_type Queue::linkQueue< T >::size

Returns the number of elements in the queue.

Returns
size_type

Definition at line 270 of file linkQueue.hh.

Referenced by main().

Here is the caller graph for this function:

Member Data Documentation

◆ _front

template<typename T >
node* Queue::linkQueue< T >::_front
private

ָ׽

Definition at line 120 of file linkQueue.hh.

◆ _rear

template<typename T >
node* Queue::linkQueue< T >::_rear
private

ָβ

Definition at line 126 of file linkQueue.hh.

◆ _size

template<typename T >
size_type Queue::linkQueue< T >::_size
private

еǰԪظ

Definition at line 132 of file linkQueue.hh.

◆ const_reference

template<typename T >
const typedef value_type& Queue::linkQueue< T >::const_reference

ݵij

Definition at line 69 of file linkQueue.hh.


The documentation for this class was generated from the following file: