1 #include "simplelist.h"
4 SimpleList
<T
>::SimpleList()
12 SimpleList
<T
>::~SimpleList()
18 void SimpleList
<T
>::append(const T
& text
)
22 m_list
=new TemplNode
<T
>(text
);
27 m_last
->m_next
=new TemplNode
<T
>(text
);
28 m_last
=m_last
->m_next
;
34 void SimpleList
<T
>::removeFirst()
36 if (m_list
==0) return;
37 TemplNode
<T
> *first
=m_list
;
38 m_list
=m_list
->m_next
;
47 void SimpleList
<T
>::clear()
58 void SimpleList
<T
>::remove(T
* item
)
62 for (T
* tmp
=first(); tmp
!=0; tmp
=next())
66 if (m_current
==m_list
)
73 TemplNode
<T
> *succ
=m_current
->m_next
;
74 if (m_current
==m_last
)
89 T
* SimpleList
<T
>::first()
94 return &m_current
->m_item
;
98 T
* SimpleList
<T
>::next()
100 if (m_current
==0) return 0;
101 m_current
=m_current
->m_next
;
102 if (m_current
==0) return 0;
103 return &m_current
->m_item
;
107 int SimpleList
<T
>::size()