]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/list.icc
release: 1.0.1
[lilypond.git] / flower / include / list.icc
1 /*
2   list.icc -- implement List inline functions
3
4   source file of the Flower Library
5
6   (c) 1996, 1997--1998
7   Jan Nieuwenhuizen <janneke@gnu.org>
8   Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 */
10
11
12 #ifndef LIST_ICC
13 #define LIST_ICC
14
15 template<class T>
16 inline
17 List<T>::List()
18 {
19   set_empty();
20 }
21
22 template<class T>
23 inline void
24 List<T>::set_empty()
25 {
26   top_ = bottom_ = 0;
27   size_ = 0;
28 }
29
30 template<class T>
31 inline void
32 List<T>::remove (Cursor<T> me)
33 {
34   if (me.ok())
35     {
36       Link<T> *lp = me.pointer();       
37       lp->remove (*this);
38       delete lp;
39       size_--;
40     }
41 }
42
43 template<class T>
44 inline int
45 List<T>::size() const
46
47   return size_;
48 }
49
50 template<class T>
51 inline Cursor<T>
52 List<T>::top() const
53 {
54   return Cursor<T>(*this, top_);
55 }
56
57
58 template<class T>
59 inline Cursor<T>
60 List<T>::bottom() const
61 {
62   return Cursor<T>(*this, bottom_);
63 }
64
65
66 #endif
67