]> git.donarmstrong.com Git - lilypond.git/blob - flower/list.inl
d71e947050b17bb55f4e4da99cc22a8142ad63f2
[lilypond.git] / flower / list.inl
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
23 List<T>::List( const T& thing )
24 {
25     set_empty();
26     add( thing, Cursor<T>( *this, bottom_ ) );
27 }
28 template<class T>
29 inline void
30 List<T>::remove( Cursor<T> me )
31 {
32     if ( me.ok() ){
33         Link<T> *lp = me.pointer();     
34         lp->remove(*this);
35         delete lp;
36         size_--;
37     }
38 }
39
40 template<class T>
41 inline int
42 List<T>::size() const
43
44     return size_;
45 }
46
47 template<class T>
48 inline Cursor<T>
49 List<T>::top()
50 {
51     return Cursor<T>( *this, top_ );
52 }
53
54
55 template<class T>
56 inline Cursor<T>
57 List<T>::bottom()
58 {
59     return Cursor<T>( *this, bottom_ );
60 }
61
62
63 #endif