blob: 44f0d0d30802a4bc7bac7b96c66e93cf9b4296ef (
plain)
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
|
#ifndef SIMPLELIST_H
#define SIMPLELIST_H
#include "mystring.h"
template <class T>
struct TemplNode
{
TemplNode(const T& text)
:m_item(text),m_next(0) {};
T m_item;
TemplNode* m_next;
};
template <class T>
class SimpleList
{
public:
SimpleList();
~SimpleList();
void append(const T& item);
void clear();
int size();
T* first();
T* next();
void removeFirst();
void remove(T* item);
protected:
TemplNode<T>* m_list;
TemplNode<T>* m_current;
TemplNode<T>* m_last;
int m_size;
};
template class SimpleList<int>;
#endif
|