]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.4
authorfred <fred>
Fri, 1 Nov 1996 13:18:04 +0000 (13:18 +0000)
committerfred <fred>
Fri, 1 Nov 1996 13:18:04 +0000 (13:18 +0000)
flower/list.cc
flower/list.inl

index 782b3da86eb77b3276f395d8777e714a1ab1defe..741e4ee97c87b48830c3d703ae66c69ad80b1d0a 100644 (file)
@@ -3,6 +3,15 @@
 
 #include "list.hh"
 
+template<class T>
+List<T>::List(List const&src)
+{
+    set_empty();
+    // probably el stupido
+    for (Cursor<T> c(src); c.ok(); c++)
+       bottom().add(c);
+}
+
 template<class T>
 void
 List<T>::OK() const
@@ -29,7 +38,7 @@ template<class T>
 Cursor<T>
 List<T>::top()
 {
-
+#if 0 
     // ?? waarvoor is deze if ? 
     if ( top_ )                        // equivalent: if ( size_ )
        {
@@ -42,7 +51,9 @@ List<T>::top()
            t = top_->previous();
            }
        }
-                               // list empty: Cursor not ok()
+#endif
+    
+// list empty: Cursor not ok()
     return Cursor<T>( *this, top_ );
 }
 
@@ -70,20 +81,4 @@ List<T>::bottom()
 }
 
 
-// not inlined since it assumes knowledge of destructor.
-template<class T>
-inline void
-PointerList<T>::remove( Cursor<T> me )
-{
-    if ( me.ok() )
-       {
-
-       delete *me;
-        List<T>::remove( me ); 
-       }
-}
-
-
-
-
 #endif
index 8396156b6a1546e19561cc14e24928dbe1b3a437..8bdcf158772df21f6764b6fa507742870c022ca8 100644 (file)
@@ -4,6 +4,13 @@
 template<class T>
 inline
 List<T>::List()
+{
+    set_empty();
+}
+
+template<class T>
+inline void
+List<T>::set_empty()
 {
     top_ = bottom_ = 0;
     size_ = 0;
@@ -13,8 +20,7 @@ template<class T>
 inline
 List<T>::List( const T& thing )
 {
-    top_ = bottom_ = 0;
-    size_ = 0;
+    set_empty();
     add( thing, Cursor<T>( *this, bottom_ ) );
 }
 
@@ -113,40 +119,6 @@ List<T>::size() const
     return size_;
 }
 
-template<class T>
-inline
-PointerList<T>::PointerList() :
-    List<T>()
-{
-}
-
-template<class T>
-inline
-PointerList<T>::PointerList( const T& thing ) :
-    List<T>( thing )
-{
-}
-
-template<class T>
-inline
-PointerList<T>::~PointerList()
-{
-    Cursor<T> next(*this);
-    for ( Cursor<T> c( *this ); c.ok(); c = next ) {
-       next = c;
-       next++;
-       remove( c );            // PointerList::remove deletes the  real data
-    }
-}
-
-template<class T>
-inline void
-PointerList_print( PointerList<T> const & l  ) 
-{
-    List<T>& promises_to_be_const = (List<T>&) l;
-    for ( Cursor<T> c( promises_to_be_const ); c.ok(); c++ )
-        (*c)->print();  
-}
 
 
 #endif