树  0.1
数据结构_第6章
Stack::seqStack< T > Class Template Reference

#include <seqStack.hxx>

Inheritance diagram for Stack::seqStack< T >:
Collaboration diagram for Stack::seqStack< T >:

Public Member Functions

 seqStack (int initSize=10)
 
 seqStack (std::initializer_list< T > &&il)
 
virtual bool isEmpty () const
 
virtual void push (const T &elem)
 
virtual void push (T &&elem)
 
virtual T pop ()
 
virtual T top () const
 
int size () const
 
int elemMem () const
 
virtual ~seqStack ()
 
bool empty () const
 
- Public Member Functions inherited from Stack::Stack< T >
virtual ~Stack ()=default
 

Private Member Functions

void doubleSpace ()
 

Private Attributes

T * elem
 
int top_p
 
int maxSize
 

Detailed Description

template<class T>
class Stack::seqStack< T >

Definition at line 37 of file seqStack.hxx.

Constructor & Destructor Documentation

◆ seqStack() [1/2]

template<class T >
Stack::seqStack< T >::seqStack ( int  initSize = 10)

Definition at line 60 of file seqStack.hxx.

◆ seqStack() [2/2]

template<class T >
Stack::seqStack< T >::seqStack ( std::initializer_list< T > &&  il)

Definition at line 66 of file seqStack.hxx.

◆ ~seqStack()

template<class T >
Stack::seqStack< T >::~seqStack
virtual

Definition at line 74 of file seqStack.hxx.

Member Function Documentation

◆ doubleSpace()

template<class T >
void Stack::seqStack< T >::doubleSpace
private

Definition at line 116 of file seqStack.hxx.

◆ elemMem()

template<class T >
int Stack::seqStack< T >::elemMem

Definition at line 134 of file seqStack.hxx.

◆ empty()

template<class T >
bool Stack::seqStack< T >::empty ( ) const
inline

Definition at line 68 of file seqStack.hxx.

◆ isEmpty()

template<class T >
bool Stack::seqStack< T >::isEmpty
virtual

Implements Stack::Stack< T >.

Definition at line 80 of file seqStack.hxx.

◆ pop()

template<class T >
T Stack::seqStack< T >::pop
virtual

Implements Stack::Stack< T >.

Definition at line 104 of file seqStack.hxx.

◆ push() [1/2]

template<class T >
void Stack::seqStack< T >::push ( const T &  elem)
virtual

Implements Stack::Stack< T >.

Definition at line 86 of file seqStack.hxx.

◆ push() [2/2]

template<class T >
void Stack::seqStack< T >::push ( T &&  elem)
virtual

Definition at line 95 of file seqStack.hxx.

◆ size()

template<class T >
int Stack::seqStack< T >::size

Definition at line 128 of file seqStack.hxx.

◆ top()

template<class T >
T Stack::seqStack< T >::top
virtual

Implements Stack::Stack< T >.

Definition at line 110 of file seqStack.hxx.

Member Data Documentation

◆ elem

template<class T >
T* Stack::seqStack< T >::elem
private

Definition at line 52 of file seqStack.hxx.

◆ maxSize

template<class T >
int Stack::seqStack< T >::maxSize
private

Definition at line 54 of file seqStack.hxx.

◆ top_p

template<class T >
int Stack::seqStack< T >::top_p
private

Definition at line 53 of file seqStack.hxx.


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