]> git.donarmstrong.com Git - lilypond.git/blob - flower/plist.inl
release: 0.0.5
[lilypond.git] / flower / plist.inl
1 /* -*-c++-*-
2   plist.inl -- part of flowerlib
3
4   (c) 1996 Han-Wen Nienhuys& Jan Nieuwenhuizen
5 */
6
7 #ifndef PLIST_INL
8 #define PLIST_INL
9
10
11
12 template<class T>
13 inline
14 PointerList<T>::~PointerList()
15 {
16     Cursor<T> next(*this);
17     for ( Cursor<T> c( *this ); c.ok(); c = next ) {
18         next = c;
19         next++;
20         remove( c );            // PointerList::remove deletes the  real data
21     }
22 }
23
24 template<class T>
25 inline void
26 PointerList_print( PointerList<T> const & l  ) 
27 {
28     for (PCursor<T> c(l ); c.ok(); c++ )
29         c->print();  
30 }
31
32 template<class T>
33 inline void
34 PL_copy(PointerList<T*> &to,PointerList<T*> const&src)
35 {
36     for (PCursor<T*> pc(src); pc.ok(); pc++) {
37         T *q = pc;
38         T *p=new T(*q) ; // argh, how do i do this in ANSI-C++
39         to.bottom().add(p);
40     }
41 }
42 #endif