]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/list.icc
release: 0.1.11
[lilypond.git] / flower / include / list.icc
1 // -*-c++-*-
2
3 #ifndef LIST_INL
4 #define LIST_INL
5
6 template<class T>
7 inline
8 List<T>::List()
9 {
10   set_empty();
11 }
12
13 template<class T>
14 inline void
15 List<T>::set_empty()
16 {
17   top_ = bottom_ = 0;
18   size_ = 0;
19 }
20
21 template<class T>
22 inline void
23 List<T>::remove (Cursor<T> me)
24 {
25   if ( me.ok())
26     {
27         Link<T> *lp = me.pointer();     
28         lp->remove (*this);
29         delete lp;
30       size_--;
31     }
32 }
33
34 template<class T>
35 inline int
36 List<T>::size() const
37
38   return size_;
39 }
40
41 template<class T>
42 inline Cursor<T>
43 List<T>::top() const
44 {
45   return Cursor<T>( *this, top_);
46 }
47
48
49 template<class T>
50 inline Cursor<T>
51 List<T>::bottom() const
52 {
53   return Cursor<T>( *this, bottom_);
54 }
55
56
57 #endif