Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Stack Class Template Reference

A template class which implements a simple stack of arbitrary data. Items are pushed onto and popped off of the stack, or may just be copied from the stack. More...

#include <Stack.h>

List of all members.

Public Methods

 Stack (int s)
 ~Stack (void)
int max_stack_size (void)
 return max stack size. More...

int stack_size (void)
 return current stack size. More...

int num (void)
 return current stack size. More...

int push (const T &a)
 push a new item onto the stack. More...

int dup (void)
 duplicate the top element on the stack. More...

T & pop (void)
 pop an item off the stack, returning its reference. More...

T & top (void)
 return reference to the top item, but do not pop the stack. More...

void clear (void)
 set stack to empty. More...


Detailed Description

template<class T>
class Stack< T >

A template class which implements a simple stack of arbitrary data. Items are pushed onto and popped off of the stack, or may just be copied from the stack.

Definition at line 30 of file Stack.h.


Constructor & Destructor Documentation

template<class T>
Stack< T >::Stack int    s [inline]
 

Definition at line 40 of file Stack.h.

template<class T>
Stack< T >::~Stack void    [inline]
 

Definition at line 47 of file Stack.h.


Member Function Documentation

template<class T>
void Stack< T >::clear void    [inline]
 

set stack to empty.

Definition at line 106 of file Stack.h.

template<class T>
int Stack< T >::dup void    [inline]
 

duplicate the top element on the stack.

Definition at line 69 of file Stack.h.

template<class T>
int Stack< T >::max_stack_size void    [inline]
 

return max stack size.

Definition at line 52 of file Stack.h.

template<class T>
int Stack< T >::num void    [inline]
 

return current stack size.

Definition at line 54 of file Stack.h.

template<class T>
T& Stack< T >::pop void    [inline]
 

pop an item off the stack, returning its reference.

Definition at line 81 of file Stack.h.

template<class T>
int Stack< T >::push const T &    a [inline]
 

push a new item onto the stack.

Definition at line 57 of file Stack.h.

Referenced by Stack< Matrix4 >::dup.

template<class T>
int Stack< T >::stack_size void    [inline]
 

return current stack size.

Definition at line 53 of file Stack.h.

template<class T>
T& Stack< T >::top void    [inline]
 

return reference to the top item, but do not pop the stack.

Definition at line 92 of file Stack.h.

Referenced by Stack< Matrix4 >::dup.


The documentation for this class was generated from the following file:
Generated on Fri Nov 8 02:47:22 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002