-
Notifications
You must be signed in to change notification settings - Fork 1
/
TLStack.tmpl.h
58 lines (42 loc) · 872 Bytes
/
TLStack.tmpl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* File: TLStack.tmpl.h
* Project: QUEST
* Author: Marc Diefenbruch, Axel Hirche
* Date: (C) 1997, 1998 University of Essen, Germany
*/
#include "SCL/SCStream.h"
#inlcude "SCL/SCListIter.h"
#include "TLStack.h"
template <class T> TLStack<T>::TLStack (void)
: SCList<T>(false)
{
/* empty */
}
template <class T> TLStack<T>::~TLStack (void)
{
/* empty */
}
template <class T> T* TLStack<T>::Pop (void)
{
if (IsEmpty())
return NULL;
return Remove (Tail());
}
template <class T> T* TLStack<T>::Top (void) const
{
if (IsEmpty())
return NULL;
return (*Tail())();
}
template <class T> void TLStack<T>::Push (T* elem)
{
return InsertAfter (elem, Tail());
}
template <class T> SCNatural TLStack<T>::Depth (void) const
{
return NumOfElems();
}
template <class T> void TLSTack<T>::Clear (void)
{
RemoveAllElements();
}