text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

Stack Class Reference

#include <StackP.h>

List of all members.


Detailed Description

ADT stack - Pointer-based implementation.

Definition at line 21 of file StackP.h.

Public Member Functions

 Stack ()
 Stack (const Stack &aStack)
 ~Stack ()
bool isEmpty () const
void push (const StackItemType &newItem) throw (StackException)
void pop () throw (StackException)
void pop (StackItemType &stackTop) throw (StackException)
void getTop (StackItemType &stackTop) const throw (StackException)

Private Attributes

StackNode * topPtr

Classes

struct  StackNode


Constructor & Destructor Documentation

Stack::Stack (   ) 
 

Default constructor.

Definition at line 23 of file StackP.cpp.

Stack::Stack (  const Stack &  aStack  ) 
 

Copy constructor.

Parameters:
aStack The stack to copy.

Definition at line 27 of file StackP.cpp.

References Stack::StackNode::item, Stack::StackNode::next, and topPtr.

Stack::~Stack (   ) 
 

Destructor.

Definition at line 51 of file StackP.cpp.

References isEmpty(), and pop().


Member Function Documentation

bool Stack::isEmpty (   )  const
 

Definition at line 59 of file StackP.cpp.

References topPtr.

Referenced by pop(), and ~Stack().

void Stack::push (  const StackItemType &  newItem  )  throw (StackException)
 

Definition at line 64 of file StackP.cpp.

References Stack::StackNode::item, and Stack::StackNode::next.

void Stack::pop (   )  throw (StackException)
 

Definition at line 86 of file StackP.cpp.

References isEmpty(), Stack::StackNode::next, and topPtr.

Referenced by ~Stack().

void Stack::pop (  StackItemType &  stackTop  )  throw (StackException)
 

Definition at line 100 of file StackP.cpp.

References Stack::StackNode::next.

void Stack::getTop (  StackItemType &  stackTop  )  const throw (StackException)
 

Definition at line 116 of file StackP.cpp.


Member Data Documentation

StackNode* Stack::topPtr [private]
 

Pointer to first node in the stack.

Definition at line 55 of file StackP.h.

Referenced by isEmpty(), pop(), and Stack().


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

Generated on Sun Aug 27 16:41:24 2006 for AWLogo by  doxygen 1.4.6