dtinfo subtree DtMmdb

This commit is contained in:
Ulrich Wilkens
2012-10-14 15:38:27 +02:00
committed by Jon Trulson
parent b92cf08899
commit 8c8363f4a5
184 changed files with 1090 additions and 773 deletions

View File

@@ -23,54 +23,3 @@
// $XConsortium: CC_Stack.C /main/4 1996/10/08 19:22:53 cde-hal $
#include "CC_Stack.h"
//------------------------------------------------------------------------
template <class T> Stack<T>::Stack ()
{
Items = new CC_TValSlist<T>();
}
//-------------------------------------------------------------------------
template <class T> Stack<T>::~Stack ()
{
delete Items;
}
//-------------------------------------------------------------------------
template <class T>
void
Stack<T>::push (const T newItem)
{
Items->append ( newItem );
}
//---------------------------------------------------------------------------
template <class T>
T
Stack<T>::pop () {
CC_Link<T> *last_elem = (CC_Link<T> *)Items->removeLast();
if ( !last_elem ) {
throw (Exception());
}
T *ret = last_elem->f_element;
delete last_elem;
T ret_value = *ret;
delete ret;
return(ret_value);
}
//---------------------------------------------------------------------------
template <class T>
T&
Stack<T>::top () const
{
CC_Link<T> *last_elem = (CC_Link<T> *)Items->last();
if ( !last_elem ) {
throw(Exception());
}
return ( *last_elem->f_element );
}