]> git.donarmstrong.com Git - lilypond.git/commitdiff
* flower/include/pqueue.hh: Derive from std::vector.
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 3 Feb 2006 01:32:16 +0000 (01:32 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 3 Feb 2006 01:32:16 +0000 (01:32 +0000)
* flower/include/parray.hh: Conform to std::vector interface.
Update users.

137 files changed:
ChangeLog
flower/include/array.hh
flower/include/array.icc
flower/include/flower-proto.hh
flower/include/parray.hh
flower/include/pqueue.hh
flower/include/std-string.hh
flower/include/std-vector.hh
flower/test-std.cc
lily/accidental-engraver.cc
lily/accidental-placement.cc
lily/align-interface.cc
lily/ambitus.cc
lily/audio-element-info.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface-scheme.cc
lily/axis-group-interface.cc
lily/beam-concave.cc
lily/beam-quanting.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/break-substitution.cc
lily/chord-name-engraver.cc
lily/cluster-engraver.cc
lily/cluster.cc
lily/collision-engraver.cc
lily/completion-note-heads-engraver.cc
lily/context-def.cc
lily/context.cc
lily/custos-engraver.cc
lily/dot-column-engraver.cc
lily/dot-column.cc
lily/drum-note-engraver.cc
lily/drum-note-performer.cc
lily/dynamic-engraver.cc
lily/figured-bass-engraver.cc
lily/fingering-engraver.cc
lily/gourlay-breaking.cc
lily/grid-line-span-engraver.cc
lily/grob-array.cc
lily/grob-info.cc
lily/grob.cc
lily/hara-kiri-group-spanner.cc
lily/horizontal-bracket-engraver.cc
lily/horizontal-bracket.cc
lily/include/accidental-placement.hh
lily/include/audio-column.hh
lily/include/audio-element-info.hh
lily/include/audio-staff.hh
lily/include/axis-group-engraver.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/beaming.hh
lily/include/book.hh
lily/include/break-algorithm.hh
lily/include/break-align-interface.hh
lily/include/column-x-positions.hh
lily/include/context-def.hh
lily/include/context.hh
lily/include/dimension-cache.hh
lily/include/grob-array.hh
lily/include/grob-info.hh
lily/include/grob.hh
lily/include/horizontal-bracket.hh
lily/include/includable-lexer.hh
lily/include/lily-parser.hh
lily/include/lily-proto.hh
lily/include/midi-walker.hh
lily/include/note-collision.hh
lily/include/paper-book.hh
lily/include/paper-column-engraver.hh
lily/include/performance.hh
lily/include/pointer-group-interface.hh
lily/include/score-engraver.hh
lily/include/score.hh
lily/include/separating-group-spanner.hh
lily/include/simple-spacer.hh
lily/include/slur-configuration.hh
lily/include/slur-scoring.hh
lily/include/source-file.hh
lily/include/spacing-spanner.hh
lily/include/spanner.hh
lily/include/system.hh
lily/include/tie-column-format.hh
lily/include/tie-formatting-problem.hh
lily/include/timing-translator.hh
lily/include/translator-group.hh
lily/include/tuplet-bracket.hh
lily/keyword.cc
lily/laissez-vibrer-engraver.cc
lily/laissez-vibrer-tie-column.cc
lily/lyric-performer.cc
lily/multi-measure-rest-engraver.cc
lily/new-fingering-engraver.cc
lily/note-collision.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/note-performer.cc
lily/note-spacing.cc
lily/output-property-engraver.cc
lily/paper-column.cc
lily/paper-score.cc
lily/phrasing-slur-engraver.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/pitched-trill-engraver.cc
lily/pointer-group-interface.cc
lily/rest-collision-engraver.cc
lily/rest-collision.cc
lily/rhythmic-column-engraver.cc
lily/script-column-engraver.cc
lily/script-column.cc
lily/separating-group-spanner.cc
lily/separating-line-group-engraver.cc
lily/simple-spacer.cc
lily/slur-engraver.cc
lily/slur-scoring.cc
lily/source-file.cc
lily/spacing-determine-loose-columns.cc
lily/spacing-loose-columns.cc
lily/spacing-spanner.cc
lily/span-arpeggio-engraver.cc
lily/span-bar-engraver.cc
lily/spanner.cc
lily/stanza-number-align-engraver.cc
lily/stem.cc
lily/system-start-delimiter-engraver.cc
lily/system.cc
lily/tab-note-heads-engraver.cc
lily/text-engraver.cc
lily/tie-column-format.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie-formatting-problem.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/vertical-align-engraver.cc

index 9d2b7f204be73643571957fc1c95745351fcb3d3..0607738bb31f2ad0f89723ae59af205cf9bac21c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-03  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower/include/pqueue.hh: Derive from std::vector.
+
+       * flower/include/parray.hh: Conform to std::vector interface.
+       Update users.
+
 2006-02-02  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/topdocs/NEWS.itely: grammar fix from Laura.
index c8110b17909edeb911633f7ed33f333b01b43fcc..a881c778d41e9f49aba0c626fe0d5e40e0c62536 100644 (file)
@@ -3,13 +3,13 @@
 
   Distributed under GNU GPL
 */
-#ifndef ARRAY_H
-#define ARRAY_H
-
 #ifndef STD_VECTOR_HH
 #error array.hh is obsolete, use std-vector.hh
 #endif
 
+#ifndef ARRAY_H
+#define ARRAY_H
+
 #include <cassert>
 using namespace std;
 
@@ -273,10 +273,6 @@ public:
     return Tarray;
   }
 
-  T const *accesses () const
-  {
-    return array_;
-  }
   void operator = (Array const &src)
   {
     resize (src.size_);
@@ -329,6 +325,35 @@ public:
       swap (v[i], v[j]);
   }
 
+  template<typename T>
+  void
+  concat (Array<T> &v, Array<T> const& w)
+  {
+    v.insert (v.end (), w.begin (), w.end ());
+  }
+
+  template<typename T>
+  void
+  vector_sort (Array<T> &v, int (*compare) (T const &, T const &),
+              vsize lower=-1, vsize upper=-1)
+  {
+    if (lower < 0)
+      {
+       lower = 0;
+       upper = v.size () - 1;
+      }
+    if (lower >= upper)
+      return;
+    swap (v[lower], v[(lower + upper) / 2]);
+    vsize last = lower;
+    for (vsize i = lower +1; i <= upper; i++)
+      if (compare (v.array_[i], v.array_[lower]) < 0)
+       swap (v[++last], v[i]);
+    swap (v[lower], v[last]);
+    vector_sort (v, compare, lower, last - 1);
+    vector_sort (v, compare, last + 1, upper);
+  }
+
 #include "array.icc"
 
 }
index 560ec31c72b4d9271801087bb84b62ce9a5eeb12..33f44a67787da568346fd0dd610c969a108b791e 100644 (file)
@@ -37,27 +37,6 @@ arrcpy (T *dest, T const *src, vsize count)
 #endif
 }
 
-template<typename T> INLINE void
-vector_sort (Array<T> &v, int (*compare) (T const &, T const &),
-            vsize lower=-1, vsize upper=-1)
-{
-  if (lower < 0)
-    {
-      lower = 0;
-      upper = v.size () - 1;
-    }
-  if (lower >= upper)
-    return;
-  swap (v[lower], v[(lower + upper) / 2]);
-  vsize last = lower;
-  for (vsize i = lower +1; i <= upper; i++)
-    if (compare (v.array_[i], v.array_[lower]) < 0)
-      swap (v[++last], v[i]);
-  swap (v[lower], v[last]);
-  vector_sort (v, compare, lower, last - 1);
-  vector_sort (v, compare, last + 1, upper);
-}
-
 template<class T> INLINE
 void
 Array<T>::OK () const
index 66bd2648c17f85e8a4f1c5e63cb6ce0a8b3e7484..650622eef9e1269f9b29cea227e29d12d4d1161f 100644 (file)
@@ -18,6 +18,8 @@ typedef unsigned char Byte;
 namespace std {
   struct String_data;
   struct String_handle;
+  //template<class T> struct Array;
+  template<class T> struct Link_array;
 }
 struct String_convert;
 
@@ -25,8 +27,6 @@ struct String_convert;
 #include "std-vector.hh"
 #include "real.hh"
 
-//template<class T> struct Array;
-template<class T> struct Link_array;
 template<class T> struct Link_list;
 template<class T> struct Interval_t;
 template<class T> struct PQueue;
index 2e90dd7c78c69eaf5aeaa352db4144e36a0fcfeb..64556ec4e200187d03734d2212e1058626dfc6ac 100644 (file)
@@ -9,8 +9,13 @@
 #ifndef PARRAY_HH
 #define PARRAY_HH
 
-#include "std-vector.hh"
+#ifndef STD_VECTOR_HH
+#error array.hh is obsolete, use std-vector.hh
+#endif
 
+using namespace std;
+
+namespace std {
 /**
    an array of pointers.
 
@@ -42,6 +47,7 @@ public:
   }
 
   Array<void *>::begin;
+  Array<void *>::data;
   Array<void *>::end;
   Array<void *>::clear;
   Array<void *>::erase;
@@ -74,6 +80,15 @@ public:
   {
   }
 
+  /* std::vector interface */
+  //typedef T** iterator;
+  //typedef T* const* iterator_const;
+
+  Link_array (const_iterator begin, const_iterator end)
+    : Array<void *> (begin, end)
+  {
+  }
+
   T *at (int i)
   {
     return (T *) Array<void *>::at (i);
@@ -174,10 +189,18 @@ public:
       return at (i);
   }
 
-  T ** accesses () const
+  T **
+  data ()
   {
-    return (T **) Array<void *>::accesses ();
+    return (T**) Array<void *>::data ();
   }
+
+  T * const*
+  data () const
+  {
+    return (T**) Array<void *>::data ();
+  }
+
   /**
      remove  i-th element, and return it.
   */
@@ -266,42 +289,10 @@ junk_pointers (Link_array<T> &a)
   a.clear ();
 }
 
-/*
-  lookup with binsearch, return tokencode.
-*/
 template<class T>
 int
-binsearch (Array<T> const &arr, T t, int (*compare) (T const &, T const &))
-{
-  int cmp;
-  int result;
-  int lo = 0;
-  int hi = arr.size ();
-
-  /* binary search */
-  do
-    {
-      cmp = (lo + hi) / 2;
-
-      result = compare (t, arr[cmp]);
-
-      if (result < 0)
-       hi = cmp;
-      else
-       lo = cmp;
-    }
-  while (hi - lo > 1);
-
-  if (!compare (t, arr[lo]))
-    return lo;
-  /* not found */
-  return -1;
-}
-
-template<class T>
-int
-binsearch_links (Link_array<T> const &arr, T *t,
-                int (*compare) (T *const &, T *const &))
+binary_search (Link_array<T> const &arr, T *t,
+              int (*compare) (T *const &, T *const &))
 {
   int cmp;
   int result;
@@ -356,6 +347,59 @@ binary_search_bounds (Link_array<T> const &table,
   while (*hi - *lo > 1);
 }
 
+template<class T>
+void
+reverse (Link_array<T> &v)
+{
+  vsize h = v.size () / 2;
+  for (vsize i = 0, j = v.size () - 1; i < h; i++, j--)
+    swap (v[i], v[j]);
+}
+
+template<typename T>
+void
+concat (Link_array<T> &v, Link_array<T> const& w)
+{
+  v.insert (v.end (), w.begin (), w.end ());
+}
+
+template<typename T>
+void
+vector_sort (Link_array<T> &v, int (*compare) (T *const &, T * const &),
+            vsize lower=-1, vsize upper=-1)
+{
+  if (lower < 0)
+    {
+      lower = 0;
+      upper = v.size () - 1;
+    }
+  if (lower >= upper)
+    return;
+  swap (v[lower], v[(lower + upper) / 2]);
+  vsize last = lower;
+  for (vsize i = lower +1; i <= upper; i++)
+    if (compare (v[i], v[lower]) < 0)
+      swap (v[++last], v[i]);
+  swap (v[lower], v[last]);
+  vector_sort (v, compare, lower, last - 1);
+  vector_sort (v, compare, last + 1, upper);
+}
+
+template<typename T>
+void
+uniq (Link_array<T> &v)
+{
+  v.uniq ();
+}
+
+template<typename T>
+typename Array<void *>::const_iterator
+find (Link_array<T> const &v, T * const& key)
+{
+  return v.begin () + v.find_index (key);
+}
+
+}
 
 #endif // PARRAY_HH
 
index 2f1896f42a38bb8582d5387301287a8db3a64c6c..17d45f32b59af978bc45aab148746d44c9fe1532 100644 (file)
@@ -34,7 +34,7 @@ int compare (PQueue_ent<K, T> const &e1, PQueue_ent<K, T> const &e2)
 template<class T>
 class PQueue
 {
-  Array<T> heap_array_;
+  std::vector<T> heap_array_;
   T &elt (vsize i)
   {
     return heap_array_[i - 1];
index 53b02c2cca5cfce6ea9c30b9aab11ce143b612ae..7d2ae6d7cc3ad2552255d18f86824c9f10fcc4f4 100644 (file)
@@ -48,7 +48,7 @@ namespace std {
 
 #include "string.hh"
 
-#endif /* STD_STRING */
+#endif /* STD_STRING */
 
 namespace std {
 
index 3386ac74b8d117bc64999201dd0fe394811740a9..3fa220184e376699a4cf413f1824d44f5bc65591 100644 (file)
@@ -9,7 +9,35 @@
 #ifndef STD_VECTOR_HH
 #define STD_VECTOR_HH
 
-#include <algorithm> // reverse, sort
+#include <algorithm>   /* find, reverse, sort */
+#include <functional>  /* unary_function */
+#include <cassert>
+
+#if HAVE_BOOST_LAMBDA
+#include <boost/lambda/lambda.hpp>
+#endif
+
+template<typename T>
+int default_compare (T const &a, T const &b)
+{
+   if (a < b)
+     return -1;
+   else if (a > b)
+     return 1;
+   else
+     return 0;
+}
+
+template<typename T>
+int default_compare (T *const &a, T *const &b)
+{
+  if (a < b)
+    return -1;
+  else if (a > b)
+    return 1;
+  else
+    return 0;
+}
 
 #if !STD_VECTOR
 /* Also declare vector, in the wrong way.  */
@@ -18,7 +46,6 @@
 #include <sstream>
 #endif
 
-
 #include "compare.hh"
 
 #if STD_VECTOR
@@ -62,22 +89,14 @@ namespace std {
   {
     return v[v.size () - i - 1];
   }
-  
-#if 0
+
   template<typename T>
-  vsize
-  //  binary_search (std::vector<T> const &v,
-  binary_search (vector<T> const &v,
-                T const &key, int (*compare) (T const &, T const &),
-                vsize b=0, vsize e=VPOS)
+  void
+  concat (vector<T> &v, vector<T> const& w)
   {
-    //(void) compare;
-    typename vector<T>::const_iterator i = find (v.iter (b), v.iter (e), key);
-    if (i != v.end ())
-      return i - v.begin ();
-    return VPOS;
+    v.insert (v.end (), w.begin (), w.end ());
   }
-#else // c&p from array.icc; cannot easily use stl_algo:find b.o. compare func.
+  
   template<class T>
   void
   binary_search_bounds (vector<T> const &table,
@@ -85,6 +104,9 @@ namespace std {
                        vsize *lo,
                        vsize *hi)
   {
+    if (*lo >= *hi)
+      return;
+
     int cmp;
     int result;
 
@@ -104,15 +126,62 @@ namespace std {
   }
 
   template<class T>
+  void
+  binary_search_bounds (vector<T> const &table,
+                       T const *key, int (*compare) (T *const &, T *const &),
+                       int *lo,
+                       int *hi)
+  {
+    int cmp;
+    int result;
+
+    /* binary search */
+    do
+      {
+       cmp = (*lo + *hi) / 2;
+
+       result = (*compare) ((T *) key, table[cmp]);
+
+       if (result < 0)
+         *hi = cmp;
+       else
+         *lo = cmp;
+      }
+    while (*hi - *lo > 1);
+  }
+  
+#if 0
+  template<typename T>
   vsize
-  binary_search (vector<T> const &table,
+  //  binary_search (std::vector<T> const &v,
+  binary_search (vector<T> const &v,
                 T const &key, int (*compare) (T const &, T const &),
+                vsize b=0, vsize e=VPOS)
+  {
+    //(void) compare;
+    if (e == VPOS)
+      e = v.size ();
+    typename vector<T>::const_iterator i = find (v.begin () + b,
+                                                v.begin () + e, key);
+    if (i != v.end ())
+      return i - v.begin ();
+    return VPOS;
+  }
+#else // c&p from array.icc; cannot easily use stl_algo:find b.o. compare func.
+  template<class T>
+  vsize
+  binary_search (vector<T> const &table,
+                T const &key,
+                int (*compare) (T const &, T const &),
                 vsize lo=0,
                 vsize hi=VPOS)
   {
     if (hi == VPOS)
       hi = table.size ();
 
+    if (lo >= hi)
+      return VPOS;
+
     binary_search_bounds (table, key, compare, &lo, &hi);
 
     if (! (*compare) (key, table[lo]))
@@ -121,11 +190,13 @@ namespace std {
     /* not found */
     return VPOS;
   }
+
+
 #endif
 
 
 #if 0
-  /* FIXME: the simple test works, but lily barfs.  */
+  /* FIXME: the COMPARE functionality is broken?  */
   template<typename T>
   void
   vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
@@ -142,37 +213,29 @@ namespace std {
   }
 #else
 
-  template<typename T>
-  void
-  swap (T *a, T *b)
-  {
-    T t = *a;
-    *a = *b;
-    *b = t;
-  }
-
   // ugh, c&p
-template<typename T> void
-vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
-            vsize lower=VPOS, vsize upper=VPOS)
-{
-  if (lower == VPOS)
-    {
-      lower = 0;
-      upper = v.size () - 1;
+  template<typename T> void
+  vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
+              vsize lower=VPOS, vsize upper=VPOS)
+  {
+    if (lower == VPOS)
+      {
+       lower = 0;
+       upper = v.size () - 1;
     }
-  if (upper == VPOS || lower >= upper)
-    return;
-  swap (v[lower], v[(lower + upper) / 2]);
-  vsize last = lower;
-  for (vsize i = lower +1; i <= upper; i++)
-    if (compare (v[i], v[lower]) < 0)
-      swap (v[++last], v[i]);
-  swap (v[lower], v[last]);
-  vector_sort (v, compare, lower, last - 1);
-  vector_sort (v, compare, last + 1, upper);
-}
-
+    if (upper == VPOS || lower >= upper)
+      return;
+    swap (v[lower], v[(lower + upper) / 2]);
+    vsize last = lower;
+    for (vsize i = lower +1; i <= upper; i++)
+      if (compare (v[i], v[lower]) < 0)
+       swap (v[++last], v[i]);
+    swap (v[lower], v[last]);
+    vector_sort (v, compare, lower, last - 1);
+    vector_sort (v, compare, last + 1, upper);
+  }
+#endif
+  
   template<typename T>
   void
   reverse (vector<T> &v)
@@ -182,11 +245,52 @@ vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
     ::std::reverse (v.begin (), v.end ());
   }
 
-#endif
+  template<typename T>
+  void
+  uniq (vector<T> &v)
+  {
+    v.erase (unique (v.begin (), v.end ()), v.end ());
+  }
 
-}
+  template<typename T>
+  typename vector<T>::const_iterator
+  find (vector<T> const &v, T const &key)
+  {
+    return ::std::find (v.begin (), v.end (), key);
+  }
+
+#if HAVE_BOOST_LAMBDA
+#include <boost/lambda/lambda.hpp>
+  using namespace boost::lambda;
+  template<typename T>
+  void
+  junk_pointers (vector<T> &v)
+  {
+    for_each (v.begin (), v.end (), (delete _1, _1 = 0));
+    v.clear ();
+  }
+#else
+
+  template<typename T> struct del : public unary_function<T, void>
+  {
+    void operator() (T x)
+    {
+      delete x;
+      x = 0;
+    }
+  };
 
+  template<typename T>
+  void
+  junk_pointers (vector<T> &v)
+  {
+    // Hmm.
+    ::std::for_each (v.begin (), v.end (), del<T> ());
+    v.clear ();
+  }
+#endif /* HAVE_BOOST_LAMBDA */
 
+}
 
 #else /* ! STD_VECTOR */
 
@@ -206,21 +310,11 @@ namespace std {
 
 }
 
-
 #endif /* STD_VECTOR */
 
-template<typename T>
-int default_compare (T const &a, T const &b)
-{
-   if (a < b)
-     return -1;
-   else if (a > b)
-     return 1;
-   else
-     return 0;
-}
-
 #include "array.hh"
+#include "parray.hh"
+
+using namespace std;
 
 #endif /* STD_VECTOR_HH */
index 7e7acee091f138b87d1ec8200058c30dd8857af5..6e53f987adb6389657323b85a68c1018ed8fc480 100644 (file)
@@ -1,10 +1,11 @@
+
+
 #if !STD_VECTOR
 #define Array flower_vector
 #endif
+#define HAVE_BOOST_LAMBDA 1
 #include "std-vector.hh"
 
-#include "parray.hh"
-
 #include <iostream>
 
 #include <boost/test/auto_unit_test.hpp>
@@ -16,6 +17,8 @@ using boost::unit_test::test_suite;
 #define vector flower_vector
 #endif
 
+using namespace std;
+
 template<typename T>
 void
 print (vector<T> v)
@@ -25,6 +28,7 @@ print (vector<T> v)
   cout << endl;
 }
 
+#if !STD_VECTOR
 template<typename T>
 void
 print (Link_array<T> v)
@@ -33,7 +37,7 @@ print (Link_array<T> v)
     cout << "v[" << i << "] = " << *v[i] << endl;
   cout << endl;
 }
-
+#endif
 
 BOOST_AUTO_UNIT_TEST (vector_erase)
 {
@@ -114,7 +118,7 @@ BOOST_AUTO_UNIT_TEST (vector_insert)
 
 BOOST_AUTO_UNIT_TEST (parray_concat)
 {
-#if 1
+#if !STD_VECTOR
   Link_array<int> u, v;
 #else
   vector<int*> u, v;
@@ -125,14 +129,14 @@ BOOST_AUTO_UNIT_TEST (parray_concat)
   u.push_back (&a[2]);
   v.push_back (&a[3]);
   v.push_back (&a[4]);
-  u.concat (v);
+  concat (u, v);
   BOOST_CHECK_EQUAL (u[0], &a[0]);
   BOOST_CHECK_EQUAL (u[1], &a[1]);
   BOOST_CHECK_EQUAL (u[2], &a[2]);
   BOOST_CHECK_EQUAL (u[3], &a[3]);
   BOOST_CHECK_EQUAL (u[4], &a[4]);
   BOOST_CHECK_EQUAL (u.size (), vsize (5));
-  u.concat (v);
+  concat (u, v);
   BOOST_CHECK_EQUAL (u.size (), vsize (7));
 
   u.clear ();
@@ -142,7 +146,7 @@ BOOST_AUTO_UNIT_TEST (parray_concat)
   v.push_back (&a[2]);
   v.push_back (&a[3]);
   v.push_back (&a[4]);
-  u.concat (v);
+  concat (u, v);
   BOOST_CHECK_EQUAL (u[0], &a[0]);
   BOOST_CHECK_EQUAL (u[1], &a[1]);
   BOOST_CHECK_EQUAL (u[2], &a[2]);
@@ -151,6 +155,27 @@ BOOST_AUTO_UNIT_TEST (parray_concat)
   BOOST_CHECK_EQUAL (u.size (), vsize (5));
 }
 
+BOOST_AUTO_UNIT_TEST (parray_uniq)
+{
+  vector<int> v;
+  v.push_back (0);
+  v.push_back (1);
+  v.push_back (0);
+  vector_sort (v, default_compare);
+  uniq (v);
+  BOOST_CHECK_EQUAL (v.size (), vsize (2));
+}
+
+BOOST_AUTO_UNIT_TEST (vector_search)
+{
+  vector<int> v;
+  v.push_back (0);
+  v.push_back (1);
+  v.push_back (2);
+  vsize i = binary_search (v, 1, &default_compare);
+  BOOST_CHECK_EQUAL (i, vsize (1));
+}
+
 test_suite*
 init_unit_test_suite (int, char**)
 {
@@ -160,5 +185,7 @@ init_unit_test_suite (int, char**)
   test->add (BOOST_TEST_CASE (vector_sorting));
   test->add (BOOST_TEST_CASE (vector_insert));
   test->add (BOOST_TEST_CASE (parray_concat));
+  test->add (BOOST_TEST_CASE (parray_uniq));
+  test->add (BOOST_TEST_CASE (vector_search));
   return test;
 }
index b240dfa03250e8425b945b9a046620a785a6c47d..bdd704da42c5198e5b19fc9a78d7975f5c0c5abc 100644 (file)
@@ -77,13 +77,13 @@ public:
     to store all information before we can really create the
     accidentals.
   */
-  Link_array<Grob> left_objects_;
-  Link_array<Grob> right_objects_;
+  std::vector<Grob*> left_objects_;
+  std::vector<Grob*> right_objects_;
 
   Grob *accidental_placement_;
 
   std::vector<Accidental_entry> accidentals_;
-  Link_array<Spanner> ties_;
+  std::vector<Spanner*> ties_;
 };
 
 /*
index d35089066eecb5223779204bf830f5879840bf1a..f8000479883144573436d5dfb4ad73b9ee897001 100644 (file)
@@ -57,8 +57,8 @@ Accidental_placement::add_accidental (Grob *me, Grob *a)
 */
 void
 Accidental_placement::split_accidentals (Grob *accs,
-                                        Link_array<Grob> *break_reminder,
-                                        Link_array<Grob> *real_acc)
+                                        Link_array__Grob_ *break_reminder,
+                                        Link_array__Grob_ *real_acc)
 {
   for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
        acs = scm_cdr (acs))
@@ -82,11 +82,11 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
                                                      Item *item_col,
                                                      Grob *left_object)
 {
-  Link_array<Grob> br, ra;
-  Link_array<Grob> *which = 0;
+  Link_array__Grob_ br, ra;
+  Link_array__Grob_ *which = 0;
 
   Accidental_placement::split_accidentals (me, &br, &ra);
-  br.concat (ra);
+  concat (br, ra);
 
   if (dynamic_cast<Item *> (left_object)->break_status_dir () == RIGHT)
     which = &br;
@@ -112,7 +112,7 @@ struct Accidental_placement_entry
   std::vector<Skyline_entry> right_skyline_;
   Interval vertical_extent_;
   std::vector<Box> extents_;
-  Link_array<Grob> grobs_;
+  Link_array__Grob_ grobs_;
   Real offset_;
   int notename_;
   Accidental_placement_entry ()
@@ -149,11 +149,11 @@ int ape_rcompare (Accidental_placement_entry *const &a,
   placement
 */
 void
-stagger_apes (Link_array<Accidental_placement_entry> *apes)
+stagger_apes (Link_array__Accidental_placement_entry_ *apes)
 {
-  Link_array<Accidental_placement_entry> asc = *apes;
+  Link_array__Accidental_placement_entry_ asc = *apes;
 
-  asc.sort (&ape_compare);
+  vector_sort (asc, &ape_compare);
 
   apes->clear ();
 
@@ -162,7 +162,10 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
     {
       Accidental_placement_entry *a = 0;
       if (parity)
-       a = asc.pop ();
+       {
+         a = asc.back ();
+         asc.pop_back ();
+       }
       else
        a = asc[i++];
 
@@ -170,7 +173,7 @@ stagger_apes (Link_array<Accidental_placement_entry> *apes)
       parity = !parity;
     }
 
-  apes->reverse ();
+  reverse (*apes);
 }
 
 /*
@@ -230,7 +233,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
     TODO: there is a bug in this code. If two accs are on the same
     Y-position, they share an Ape, and will be printed in overstrike.
   */
-  Link_array<Accidental_placement_entry> apes;
+  Link_array__Accidental_placement_entry_ apes;
   for (SCM s = accs; scm_is_pair (s); s = scm_cdr (s))
     {
       Accidental_placement_entry *ape = new Accidental_placement_entry;
@@ -248,7 +251,7 @@ Accidental_placement::calc_positioning_done (SCM smob)
     First we must extract *all* pointers. We can only determine
     extents if we're sure that we've found the right common refpoint
   */
-  Link_array<Grob> note_cols, heads;
+  Link_array__Grob_ note_cols, heads;
   for (vsize i = apes.size (); i--;)
     {
       Accidental_placement_entry *ape = apes[i];
@@ -282,15 +285,15 @@ Accidental_placement::calc_positioning_done (SCM smob)
        {
          extract_grob_set (c, "elements", gs);
 
-         note_cols.concat (gs);
+         concat (note_cols, gs);
        }
     }
 
   for (vsize i = note_cols.size (); i--;)
-    heads.concat (extract_grob_array (note_cols[i], "note-heads"));
+    concat (heads, extract_grob_array (note_cols[i], "note-heads"));
 
-  heads.default_sort ();
-  heads.uniq ();
+  vector_sort (heads, default_compare);
+  uniq (heads);
   common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
 
   for (vsize i = apes.size (); i--;)
index 2355ce11f465b913591519b0118ab22fffa0cac9..26d8d811438a8903a6945a1bd99e472afe762465 100644 (file)
@@ -88,7 +88,7 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a)
 
   extract_grob_set (me, "elements", elem_source);
 
-  Link_array<Grob> elems (elem_source); // writable..
+  Link_array__Grob_ elems (elem_source); // writable..
 
   Real where_f = 0;
 
@@ -160,7 +160,7 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
                                            Interval (0, Interval::infinity ()));
 
   std::vector<Interval> dims;
-  Link_array<Grob> elems;
+  Link_array__Grob_ elems;
 
   extract_grob_set (me, "elements", all_grobs);
   for (vsize i = 0; i < all_grobs.size (); i++)
index 702d8ba7b5757caa50814557c811878fa797b1f1..bdab636b6fd58b667efcddc1319e70904ca39153 100644 (file)
@@ -30,7 +30,9 @@ Ambitus::print (SCM smob)
       && heads.size () > 1)
     {
       Grob *common
-       = common_refpoint_of_array (heads.slice (0, 2), me, Y_AXIS);
+       = common_refpoint_of_array (Link_array__Grob_ (heads.begin (),
+                                                      heads.begin () + 2),
+                                   me, Y_AXIS);
 
       Grob *minh = heads[0];
       Grob *maxh = heads[1];
index 75c24d96f343a2c2ac68a90afe908658b2fef4c8..edc322a052bdd373927d4e9d218565d75cd28900 100644 (file)
@@ -25,11 +25,11 @@ Audio_element_info::Audio_element_info ()
   origin_trans_ = 0;
 }
 
-Link_array<Context>
+Link_array__Context_
 Audio_element_info::origin_contexts (Translator *end) const
 {
   Context *t = origin_trans_->context ();
-  Link_array<Context> r;
+  Link_array__Context_ r;
   do
     {
       r.push_back (t);
index f6ed06283b84742c1db869855c36392f5b5bd8e2..b7a92690571cfe26ce17bbae0468a85f436df170 100644 (file)
@@ -56,7 +56,7 @@ private:
   */
   Moment shortest_mom_;
   Spanner *finished_beam_;
-  Link_array<Item> *stems_;
+  Link_array__Item_ *stems_;
 
   int process_acknowledged_count_;
   Moment last_add_mom_;
@@ -210,7 +210,7 @@ Auto_beam_engraver::begin_beam ()
       return;
     }
 
-  stems_ = new Link_array<Item>;
+  stems_ = new Link_array__Item_;
   grouping_ = new Beaming_info_list;
   beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
 
index f5c7fb152949d5920bd90f62175067c049cb6892..8a672ea94f0eb3053144d243c883a7f6a8af3892 100644 (file)
@@ -22,7 +22,7 @@ LY_DEFINE (ly_relative_group_extent, "ly:relative-group-extent",
   SCM_ASSERT_TYPE (unsmob_grob (common), common, SCM_ARG2, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
-  Link_array<Grob> elts;
+  Link_array__Grob_ elts;
   if (!ga)
     {
       for (SCM s = elements; scm_is_pair (s); s = scm_cdr (s))
index 112dc3d767178092b8dcfe3bc4a1115dba530520..a994a2b321913c1adf910f787dfe430d94404c31 100644 (file)
@@ -45,7 +45,7 @@ Axis_group_interface::has_axis (Grob *me, Axis a)
 }
 
 Interval
-Axis_group_interface::relative_group_extent (Link_array<Grob> const &elts,
+Axis_group_interface::relative_group_extent (Link_array__Grob_ const &elts,
                                             Grob *common, Axis a)
 {
   Interval r;
@@ -88,7 +88,7 @@ Axis_group_interface::generic_group_extent (Grob *me, Axis a)
 }
 
 void
-Axis_group_interface::get_children (Grob *me, Link_array<Grob> *found)
+Axis_group_interface::get_children (Grob *me, Link_array__Grob_ *found)
 {
   found->push_back (me);
 
index 81581bc66becd0743e583e737f305d12c85cd327..1b55e94004dff1aaa36124ac1b06d46027ed3550 100644 (file)
@@ -87,7 +87,7 @@ Beam::calc_concaveness (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  Link_array<Grob> stems
+  Link_array__Grob_ stems
     = extract_grob_array (me, "stems");
 
   if (is_knee (me))
index 5b9b2dbaed808658d9a714472cf634161d2f3152..90e0bb7cdef31101736e127be02ff2ad18d96ff8 100644 (file)
@@ -139,7 +139,7 @@ Beam::quanting (SCM smob, SCM posns)
     Do stem computations.  These depend on YL and YR linearly, so we can
     precompute for every stem 2 factors.
   */
-  Link_array<Grob> stems
+  Link_array__Grob_ stems
     = extract_grob_array (me, "stems");
   std::vector<Stem_info> stem_infos;
   std::vector<Real> base_lengths;
@@ -327,7 +327,7 @@ Beam::quanting (SCM smob, SCM posns)
 }
 
 Real
-Beam::score_stem_lengths (Link_array<Grob> const &stems,
+Beam::score_stem_lengths (Link_array__Grob_ const &stems,
                          std::vector<Stem_info> const &stem_infos,
                          std::vector<Real> const &base_stem_ys,
                          std::vector<Real> const &stem_xs,
index 662ae54d1be882ec945b8f04dbf9734e5c863352..bfc5da52fb3f756819f586cba40733d5bd709eb3 100644 (file)
@@ -18,7 +18,7 @@
 std::vector<int>
 Break_algorithm::find_break_indices () const
 {
-  Link_array<Grob> all = pscore_->root_system ()->columns ();
+  Link_array__Grob_ all = pscore_->root_system ()->columns ();
   std::vector<int> retval;
 
   for (vsize i = 0; i < all.size (); i++)
@@ -32,11 +32,11 @@ Break_algorithm::find_break_indices () const
   return retval;
 }
 
-Link_array<Grob>
+Link_array__Grob_
 Break_algorithm::find_breaks () const
 {
-  Link_array<Grob> all = pscore_->root_system ()->columns ();
-  Link_array<Grob> retval;
+  Link_array__Grob_ all = pscore_->root_system ()->columns ();
+  Link_array__Grob_ retval;
 
   for (vsize i = 0; i < all.size (); i++)
     if (Item::is_breakable (all[i]))
@@ -50,7 +50,7 @@ Break_algorithm::find_breaks () const
 }
 
 Simple_spacer_wrapper *
-Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline,
+Break_algorithm::generate_spacing_problem (Link_array__Grob_ const &curline,
                                           Interval line) const
 {
   Simple_spacer_wrapper *spw = new Simple_spacer_wrapper;
index ac5cfa33f3ae47fd782a8e5927a3e7fe0319dcd2..854d2778edecc80467c7c971a0a4a9b343eb9d6a 100644 (file)
@@ -45,7 +45,7 @@ Break_align_interface::self_align_callback (SCM smob)
 
   So we return the correct order as an array.
 */
-Link_array<Grob>
+Link_array__Grob_
 Break_align_interface::ordered_elements (Grob *grob)
 {
   Item *me = dynamic_cast<Item *> (grob);
@@ -56,14 +56,14 @@ Break_align_interface::ordered_elements (Grob *grob)
       || scm_c_vector_length (order_vec) < 3)
     return elts;
 
-  Link_array<Grob> writable_elts (elts);
+  Link_array__Grob_ writable_elts (elts);
   SCM order = scm_vector_ref (order_vec,
                              scm_from_int (me->break_status_dir () + 1));
 
   /*
     Copy in order specified in BREAK-ALIGN-ORDER.
   */
-  Link_array<Grob> new_elts;
+  Link_array__Grob_ new_elts;
   for (; scm_is_pair (order); order = scm_cdr (order))
     {
       SCM sym = scm_car (order);
@@ -95,7 +95,7 @@ Break_align_interface::calc_positioning_done (SCM smob)
   Grob *grob = unsmob_grob (smob);  
   Item *me = dynamic_cast<Item *> (grob);
 
-  Link_array<Grob> elems = ordered_elements (me);
+  Link_array__Grob_ elems = ordered_elements (me);
   std::vector<Interval> extents;
 
   int last_nonempty = -1;
index d14092876f7a401f2584af4a50a2e21cf7c0d1ed..2c822f8548e3cf8029dc7297bd8a16b14df2cfc9 100644 (file)
@@ -139,17 +139,17 @@ do_break_substitution (SCM src)
 /*
   Perform substitution on GROB_LIST using a constant amount of stack.
 */
-Link_array<Grob> temporary_substition_array;
+Link_array__Grob_ temporary_substition_array;
 void
 substitute_grob_array (Grob_array *grob_arr, Grob_array *new_arr)
 {
-  Link_array<Grob> &old_grobs (grob_arr->array_reference ());
-  Link_array<Grob> *new_grobs (new_arr == grob_arr
+  Link_array__Grob_ &old_grobs (grob_arr->array_reference ());
+  Link_array__Grob_ *new_grobs (new_arr == grob_arr
                               ? & temporary_substition_array
                               : &new_arr->array_reference ());
 
   new_grobs->resize (old_grobs.size ());
-  Grob **array = (Grob **) new_grobs->accesses ();
+  Grob **array = (Grob **) new_grobs->data ();
   Grob **ptr = array;
   for (vsize i = 0; i < old_grobs.size (); i++)
     {
index e079e982c0aa1845698dbe54c5746e0452425ebd..a5da925e604c31c6d5a07a5aaf03bb00f641247d 100644 (file)
@@ -31,7 +31,7 @@ private:
   void add_note (Music *);
 
   Item *chord_name_;
-  Link_array<Music> notes_;
+  Link_array__Music_ notes_;
 
   SCM last_chord_;
 };
index 82917369445924595a86fb616df592eaeca9f54e..d564a2bdfcb752de8cb21f2ca67eddbed0641651 100644 (file)
@@ -24,7 +24,7 @@ protected:
   void stop_translation_timestep ();
   virtual void finalize ();
 private:
-  Link_array<Music> cluster_notes_;
+  Link_array__Music_ cluster_notes_;
   Item *beacon_;
 
   void typeset_grobs ();
index cefb02f78207f5eb95799e7bcf546ceda9e51a6e..a9ac17408a2c8a294bf9c09b7f19b2a1e6a552d5 100644 (file)
@@ -133,7 +133,7 @@ Cluster::print (SCM smob)
 
   Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
 
-  Link_array<Grob> const &cols = extract_grob_array (me, "columns");
+  Link_array__Grob_ const &cols = extract_grob_array (me, "columns");
   if (cols.empty ())
     {
       me->warning (_ ("junking empty cluster"));
@@ -175,7 +175,7 @@ Cluster::print (SCM smob)
       if (spanner->get_break_index () < orig->broken_intos_.size () - 1)
        {
          Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1];
-         Link_array<Grob> const &next_cols = extract_grob_array (next, "columns");
+         Link_array__Grob_ const &next_cols = extract_grob_array (next, "columns");
          if (next_cols.size () > 0)
            {
              Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS);
index 285dd9082081f64e65c49470048475495ee28fcf..1bdd9609680beadd640e899c352fe19dd4f126d6 100644 (file)
@@ -14,7 +14,7 @@
 class Collision_engraver : public Engraver
 {
   Item *col_;
-  Link_array<Grob> note_columns_;
+  Link_array__Grob_ note_columns_;
 
 protected:
   DECLARE_ACKNOWLEDGER (note_column);
index 7bdf2e3ba5d1f685f39c252ae387fcd650cb7510..af0cb783f940c84c4bb447f6c5277f16fb4e0f36 100644 (file)
@@ -43,13 +43,13 @@ using namespace std;
 
 class Completion_heads_engraver : public Engraver
 {
-  Link_array<Item> notes_;
-  Link_array<Item> prev_notes_;
-  Link_array<Grob> ties_;
+  Link_array__Item_ notes_;
+  Link_array__Item_ prev_notes_;
+  Link_array__Grob_ ties_;
 
-  Link_array<Item> dots_;
-  Link_array<Music> note_events_;
-  Link_array<Music> scratch_note_events_;
+  Link_array__Item_ dots_;
+  Link_array__Music_ note_events_;
+  Link_array__Music_ scratch_note_events_;
 
   Moment note_end_mom_;
   bool is_first_;
index 906a42eb41eaec1c055c6525d978569ddb8dbf85..80663c91857a4f1579360b7d69103d4553c85f04 100644 (file)
@@ -192,20 +192,20 @@ Context_def::get_default_child (SCM user_mod) const
   return name;
 }
 
-Link_array<Context_def>
+Link_array__Context_def_
 Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
 {
   assert (scm_is_symbol (type_sym));
 
   SCM accepted = get_accepted (SCM_EOL);
 
-  Link_array<Context_def> accepteds;
+  Link_array__Context_def_ accepteds;
   for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s))
     if (Context_def *t = unsmob_context_def (find_context_def (odef,
                                                               scm_car (s))))
       accepteds.push_back (t);
 
-  Link_array<Context_def> best_result;
+  Link_array__Context_def_ best_result;
   for (vsize i = 0; i < accepteds.size (); i++)
     {
       /* do not check aliases, because \context Staff should not
@@ -222,7 +222,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
     {
       Context_def *g = accepteds[i];
 
-      Link_array<Context_def> result
+      Link_array__Context_def_ result
        = g->path_to_acceptable_context (type_sym, odef);
       if (result.size () && result.size () < best_depth)
        {
index 405dc4b5d4ef64e08716ad47a8cefce5701fbc15..0fbdc207317fe272bd7a23201350799fb137e3d6 100644 (file)
@@ -124,7 +124,7 @@ Context::create_unique_context (SCM n, SCM operations)
   /*
     TODO: use accepts_list_.
   */
-  Link_array<Context_def> path
+  Link_array__Context_def_ path
     = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
 
   if (path.size ())
@@ -182,7 +182,7 @@ Context::find_create_context (SCM n, std::string id, SCM operations)
   /*
     TODO: use accepts_list_.
   */
-  Link_array<Context_def> path
+  Link_array__Context_def_ path
     = unsmob_context_def (definition_)->path_to_acceptable_context (n, get_output_def ());
 
   if (path.size ())
index 53f24a6f7ce18be68cdacc41ce05e99fd9881a25..b68ed603882f9a7c79325cfddb23632a0427297d 100644 (file)
@@ -37,7 +37,7 @@ public:
 private:
   Item *create_custos ();
   bool custos_permitted_;
-  Link_array<Grob> custodes_;
+  Link_array__Grob_ custodes_;
   std::vector<Pitch> pitches_;
 };
 
index a157b6a71560aed957632fd39ddf12710bf94860..f5c4a8ad9543ac066cdb4a04cc2caf9cdae07732 100644 (file)
@@ -17,7 +17,7 @@ class Dot_column_engraver : public Engraver
 {
   Grob *dotcol_;
   Grob *stem_;
-  Link_array<Item> heads_;
+  Link_array__Item_ heads_;
 public:
   TRANSLATOR_DECLARATIONS (Dot_column_engraver);
 
index 84f56b6418c247b9dbc2eeca087476e879fa413b..f3e2af55f9104e963971705622a02aa1d5c632be 100644 (file)
@@ -204,7 +204,7 @@ SCM
 Dot_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);  
-  Link_array<Grob> dots
+  Link_array__Grob_ dots
     = extract_grob_array (me, "dots");
 
   { /*
@@ -227,7 +227,7 @@ Dot_column::calc_positioning_done (SCM smob)
       }
   }
 
-  dots.sort (compare_position);
+  vector_sort (dots, &compare_position);
   for (vsize i = dots.size (); i--;)
     if (!dots[i]->is_live ())
       dots.erase (dots.begin () + i);
index 4494e2c72990bf691405f4168434741ba1be8c35..9293fc72bc553c4c09839cf3e25c757c0d7dd0da 100644 (file)
@@ -18,10 +18,10 @@ using namespace std;
 
 class Drum_notes_engraver : public Engraver
 {
-  Link_array<Item> notes_;
-  Link_array<Item> dots_;
-  Link_array<Item> scripts_;
-  Link_array<Music> events_;
+  Link_array__Item_ notes_;
+  Link_array__Item_ dots_;
+  Link_array__Item_ scripts_;
+  Link_array__Music_ events_;
 
 public:
   TRANSLATOR_DECLARATIONS (Drum_notes_engraver);
index dd83e6699f2b2b9a37812952ab22506f6e3c8cb2..0dab3e2890f66377de3e4cc3ffbd0f7c44757000 100644 (file)
@@ -25,8 +25,8 @@ protected:
   void process_music ();
 
 private:
-  Link_array<Music> note_evs_;
-  Link_array<Audio_note> notes_;
+  Link_array__Music_ note_evs_;
+  Link_array__Audio_note_ notes_;
 };
 
 Drum_note_performer::Drum_note_performer ()
@@ -40,7 +40,8 @@ Drum_note_performer::process_music ()
 
   while (note_evs_.size ())
     {
-      Music *n = note_evs_.pop ();
+      Music *n = note_evs_.back ();
+      note_evs_.pop_back ();
       SCM sym = n->get_property ("drum-type");
       SCM defn = SCM_EOL;
 
index e6ecc2a972193ade920df537597e5ccb6e754ccd..3dcbea5ce60669eceff71b6a0713525dc8ddebfd 100644 (file)
@@ -55,8 +55,8 @@ class Dynamic_engraver : public Engraver
 
   Drul_array<Music *> accepted_spanevents_drul_;
 
-  Link_array<Note_column> pending_columns_;
-  Link_array<Grob> pending_elements_;
+  Link_array__Note_column_ pending_columns_;
+  Link_array__Grob_ pending_elements_;
 
   void typeset_all ();
 
index ee5517e94bcec9fca3a5f05b1477d3122d68fc33..8d97f2998d96286d5b23d344ed99d5487db52294 100644 (file)
@@ -63,12 +63,12 @@ struct Figured_bass_engraver : public Engraver
   void add_brackets ();
   void create_grobs ();
 
-  void center_continuations (Link_array<Spanner> const &consecutive_lines);
+  void center_continuations (Link_array__Spanner_ const &consecutive_lines);
   void center_repeated_continuations ();
 protected:
   std::vector<Figure_group> groups_;
   Spanner *alignment_;
-  Link_array<Music> new_musics_;
+  Link_array__Music_ new_musics_;
   bool continuation_;
   bool new_music_found_;
   
@@ -165,11 +165,11 @@ Figured_bass_engraver::try_music (Music *m)
 }
 
 void
-Figured_bass_engraver::center_continuations (Link_array<Spanner> const &consecutive_lines)
+Figured_bass_engraver::center_continuations (Link_array__Spanner_ const &consecutive_lines)
 {
   if (consecutive_lines.size () == 2)
     {
-      Link_array<Grob> left_figs;
+      Link_array__Grob_ left_figs;
       for (vsize j = consecutive_lines.size(); j--;)
        left_figs.push_back (consecutive_lines[j]->get_bound (LEFT));
 
@@ -185,7 +185,7 @@ Figured_bass_engraver::center_continuations (Link_array<Spanner> const &consecut
 void
 Figured_bass_engraver::center_repeated_continuations ()
 {  
-  Link_array<Spanner> consecutive_lines;
+  Link_array__Spanner_ consecutive_lines;
   for (vsize i = 0; i <= groups_.size(); i++)
     {
       if (i < groups_.size ()
@@ -220,7 +220,7 @@ Figured_bass_engraver::clear_spanners ()
 void
 Figured_bass_engraver::add_brackets ()
 {
-  Link_array<Grob> encompass;
+  Link_array__Grob_ encompass;
   bool inside = false;
   for (vsize i = 0; i < groups_.size (); i ++)
     {
@@ -349,7 +349,7 @@ Figured_bass_engraver::process_music ()
       /*
        Ugh, repeated code.
        */
-      Link_array<Spanner> consecutive;
+      Link_array__Spanner_ consecutive;
       if (to_boolean (get_property ("figuredBassCenterContinuations")))
        {
          for (vsize i = 0; i <= junk_continuations.size (); i++)
index e45de84b14fabad1fede39303d67c3a91eee0bac..daace643e49e110a421e5292b7004ba11cb4f07d 100644 (file)
@@ -15,8 +15,8 @@
 
 class Fingering_engraver : public Engraver
 {
-  Link_array<Music> events_;
-  Link_array<Item> fingerings_;
+  Link_array__Music_ events_;
+  Link_array__Item_ fingerings_;
 
 public:
   TRANSLATOR_DECLARATIONS (Fingering_engraver);
index f9ff08b6af31337e61dca877fe825c9e5c4808ad..83f0006cb2370d5c4f573201f50fe0bac16ce04f 100644 (file)
@@ -78,7 +78,7 @@ std::vector<Column_x_positions>
 Gourlay_breaking::do_solve () const
 {
   std::vector<Break_node> optimal_paths;
-  Link_array<Grob> all
+  Link_array__Grob_ all
     = pscore_->root_system ()->columns ();
 
   std::vector<int> breaks = find_break_indices ();
@@ -104,8 +104,8 @@ Gourlay_breaking::do_solve () const
 
       for (vsize start_idx = break_idx; start_idx--;)
        {
-         Link_array<Grob> line = all.slice (breaks[start_idx],
-                                            breaks[break_idx] + 1);
+         Link_array__Grob_ line (all.begin () + breaks[start_idx],
+                                 all.begin () + breaks[break_idx] + 1);
 
          line[0] = dynamic_cast<Item *> (line[0])->find_prebroken_piece (RIGHT);
          line.back () = dynamic_cast<Item *> (line.back ())->find_prebroken_piece (LEFT);
index b7daf45eac4187a897975a70cc0e5efcc70b4878..742146402c6bcd12bd47f1e92f410d324a143188 100644 (file)
@@ -13,7 +13,7 @@
 class Grid_line_span_engraver : public Engraver
 {
   Item *spanline_;
-  Link_array<Item> lines_;
+  Link_array__Item_ lines_;
 
 public:
   TRANSLATOR_DECLARATIONS (Grid_line_span_engraver);
index ee1d3e78a2009dbaf620cb793562791427a72a07..99230a5ec392e40c1cf5f414e0a1a4c166633749 100644 (file)
@@ -29,13 +29,13 @@ Grob_array::Grob_array ()
   ordered_ = false;
 }
 
-Link_array<Grob> &
+Link_array__Grob_ &
 Grob_array::array_reference ()
 {
   return grobs_;
 }
 
-Link_array<Grob> const &
+Link_array__Grob_ const &
 Grob_array::array () const
 {
   return grobs_;
@@ -89,7 +89,7 @@ Grob_array::empty () const
 }
 
 void
-Grob_array::set_array (Link_array<Grob> const &src)
+Grob_array::set_array (Link_array__Grob_ const &src)
 {
   grobs_ = src;
 }
index d8471d43f76d3caa3e1ca35cc3995116294b8f48..691d23b1a50743f72e0396484b4cd991fdad8c42 100644 (file)
@@ -33,11 +33,11 @@ Grob_info::music_cause () const
   return unsmob_music (cause);
 }
 
-Link_array<Context>
+Link_array__Context_
 Grob_info::origin_contexts (Translator *end) const
 {
   Context *t = origin_trans_->context ();
-  Link_array<Context> r;
+  Link_array__Context_ r;
   do
     {
       r.push_back (t);
index c3905c487613c6e24c43ecfdb2cc0b207e43182b..bde3c630afb953b77aeefb2324dc8248299d1195 100644 (file)
@@ -608,7 +608,7 @@ common_refpoint_of_list (SCM elist, Grob *common, Axis a)
 }
 
 Grob *
-common_refpoint_of_array (Link_array<Grob> const &arr, Grob *common, Axis a)
+common_refpoint_of_array (Link_array__Grob_ const &arr, Grob *common, Axis a)
 {
   for (vsize i = arr.size (); i--;)
     if (Grob *s = arr[i])
index f00434346dbac33c5147c9d7b1933eba374e0134..1c5b92c05431c5382e63db092a23057e75e5f200 100644 (file)
@@ -43,7 +43,7 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me)
           == 0)) 
     return;
 
-  Link_array<Grob> childs;
+  Link_array__Grob_ childs;
   Axis_group_interface::get_children (me, &childs);
   for (vsize i = 0; i < childs.size (); i++)
     childs[i]->suicide ();
index 2babc2b03311b8638bdc9191e6094a73950eade2..52c828cffb1aa5390c70d2f7a40cacc140cb8b89 100644 (file)
@@ -19,8 +19,8 @@ class Horizontal_bracket_engraver : public Engraver
 {
 public:
   TRANSLATOR_DECLARATIONS (Horizontal_bracket_engraver);
-  Link_array<Spanner> bracket_stack_;
-  Link_array<Music> events_;
+  Link_array__Spanner_ bracket_stack_;
+  Link_array__Music_ events_;
   int pop_count_;
   int push_count_;
 
@@ -106,10 +106,8 @@ void
 Horizontal_bracket_engraver::stop_translation_timestep ()
 {
   for (int i = pop_count_; i--;)
-    {
-      if (bracket_stack_.size ())
-       bracket_stack_.pop ();
-    }
+    if (bracket_stack_.size ())
+      bracket_stack_.pop_back ();
   pop_count_ = 0;
   push_count_ = 0;
 }
index 652370a8eb4f2913f527970c12773446608a2a21..10d65316e0d80524b1c2d1d8df43d893177c9506 100644 (file)
@@ -47,7 +47,7 @@ Horizontal_bracket::make_bracket (Grob *me,
 
 Stencil
 Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint,
-                                           Link_array<Grob> grobs,
+                                           Link_array__Grob_ grobs,
                                            Axis a, Direction dir)
 {
   Grob *common = common_refpoint_of_array (grobs, refpoint, a);
index 27325ea6d8496d0fb8b7bed2fb83f09f5e5412cb..bb6b6810030bd89800c625a713360411328b5648 100644 (file)
@@ -21,8 +21,8 @@ public:
                                                  Item *item_col,
                                                  Grob *acc);
   static void split_accidentals (Grob *accs,
-                                Link_array<Grob> *break_reminder,
-                                Link_array<Grob> *real_acc);
+                                Link_array__Grob_ *break_reminder,
+                                Link_array__Grob_ *real_acc);
 
   DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
   static bool has_interface (Grob *);
index 3e514f0d3e1767ad238acfebe8b8bf7090a2a4b7..0bffa4e45eb973f5d9037ce3c7a5e0cb46cafa69 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "lily-proto.hh"
 #include "moment.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "audio-element.hh"
 
 /**
@@ -24,7 +24,7 @@ public:
   void add_audio_item (Audio_item *i);
   Moment at_mom () const;
 
-  Link_array<Audio_item> audio_items_;
+  Link_array__Audio_item_ audio_items_;
 
 private:
   Audio_column (Audio_column const &);
index 7b0b0fba7282e82ab15b0b981f9c382bd583e34c..915fac9c5a4bfac485924d51e80ee8ff6bc20752 100644 (file)
@@ -10,7 +10,7 @@
 #define AUDIO_ITEM_INFO_HH
 
 #include "lily-proto.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 
 /**
    Data container for broadcasts
@@ -22,7 +22,7 @@ public:
   Music *event_;
   Translator *origin_trans_;
 
-  Link_array<Context> origin_contexts (Translator *) const;
+  Link_array__Context_ origin_contexts (Translator *) const;
 
   Audio_element_info (Audio_element *, Music *);
   Audio_element_info ();
index 6ba1155a41940dffd4f174e44717798467f51cbb..d2a2baeba32fd336b87330d5126e7f565b4ff063 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef AUDIO_STAFF_HH
 #define AUDIO_STAFF_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "audio-element.hh"
 
@@ -16,7 +16,7 @@ struct Audio_staff : public Audio_element
   void add_audio_item (Audio_item *l);
   void output (Midi_stream &midi_stream_r, int track_i);
 
-  Link_array<Audio_item> audio_items_;
+  Link_array__Audio_item_ audio_items_;
   int channel_;
 };
 
index 998b84b5cbcb77b84bc64cd64c32bcd53d8254b0..535828577a8d70e67015a3f4144f5ba8923efdfb 100644 (file)
@@ -19,7 +19,7 @@ class Axis_group_engraver : public Engraver
 {
 protected:
   Spanner *staffline_;
-  Link_array<Grob> elts_;
+  Link_array__Grob_ elts_;
   void process_music ();
   virtual void finalize ();
   DECLARE_ACKNOWLEDGER (grob);
index 0898f3f8cd8356ae96e7790fa2b2e8667e0743ad..04da19759d4c8f661756ddbfbaee737984719de2 100644 (file)
@@ -19,13 +19,13 @@ struct Axis_group_interface
   static SCM generic_group_extent (Grob *me, Axis a);
   DECLARE_SCHEME_CALLBACK (width, (SCM smob));
   DECLARE_SCHEME_CALLBACK (height, (SCM smob));
-  static Interval relative_group_extent (Link_array<Grob> const &list,
+  static Interval relative_group_extent (Link_array__Grob_ const &list,
                                         Grob *common, Axis);
 
   static void add_element (Grob *me, Grob *);
   static void set_axes (Grob *, Axis, Axis);
   static bool has_axis (Grob *, Axis);
-  static void get_children (Grob *, Link_array<Grob> *);
+  static void get_children (Grob *, Link_array__Grob_ *);
   static bool has_interface (Grob *);
 };
 
index c828ae46f393cdcb77602641d64b97eca9b15401..c852b443018d6b5437d4f33c7babfae5e3e76177 100644 (file)
@@ -72,7 +72,7 @@ public:
   
 static Real score_slopes_dy (Real, Real, Real, Real, Real, bool, Beam_quant_parameters const *);
 
-  static Real score_stem_lengths (Link_array<Grob> const &stems,
+  static Real score_stem_lengths (Link_array__Grob_ const &stems,
                                  std::vector<Stem_info> const &stem_infos,
                                  std::vector<Real> const &base_stem_ys,
                                  std::vector<Real> const &stem_xs,
index 19ff113571c124c5b5f237ac03ce08d3a417caec..0e877f684f056a5fe6c12de14ea70e09cad72cbe 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef BEAMING_HH
 #define BEAMING_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "moment.hh"
 
 struct Beaming_info
index c731e21a507054b0d72a0c160034766be9338f96..50943dc0aded49aaf2ab0a53ab1653468edee809 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "input.hh"
 #include "lily-proto.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "object-key.hh"
 #include "std-string.hh"
 
index 9226aa621fb601d5086b618f908bf7a366ce125c..ed1164ffdaef0363cb95bb98a6c2ee4ad1f5313e 100644 (file)
@@ -23,12 +23,12 @@ protected:
   Paper_score *pscore_;
   Real linewidth_;
 
-  Link_array<Grob> find_breaks () const;
+  Link_array__Grob_ find_breaks () const;
   std::vector<int> find_break_indices () const;
   void solve_line (Column_x_positions *) const;
-  bool feasible (Link_array<Grob> const &) const;
+  bool feasible (Link_array__Grob_ const &) const;
 
-  Simple_spacer_wrapper *generate_spacing_problem (Link_array<Grob> const &,
+  Simple_spacer_wrapper *generate_spacing_problem (Link_array__Grob_ const &,
                                                   Interval) const;
   virtual std::vector<Column_x_positions> do_solve () const = 0;
 
index 931e219965ddc43b0bd7f2e62e2fa3e13516ef09..289d432cdbfaf63907424acb84557742a300cd2c 100644 (file)
@@ -14,7 +14,7 @@
 class Break_align_interface
 {
 public:
-  static Link_array<Grob> ordered_elements (Grob *me);
+  static Link_array__Grob_ ordered_elements (Grob *me);
   static bool has_interface (Grob *);
   static void add_element (Grob *me, Grob *add);
   DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
index bc49b37c912f716ae2652fadb3fb12f9e98471d5..c5d0f928a78331f7515124602b4a8a85e2d13b43 100644 (file)
@@ -7,13 +7,13 @@
 #ifndef COLUMN_X_POSITIONS_HH
 #define COLUMN_X_POSITIONS_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-proto.hh"
 
 struct Column_x_positions
 {
-  Link_array<Grob> cols_;
-  Link_array<Grob> loose_cols_;
+  Link_array__Grob_ cols_;
+  Link_array__Grob_ loose_cols_;
 
   std::vector<Real> config_;
   Real force_;
index 3a234bfd78c1141aa4c800a51356aa66180e1d7f..faddf38f73cfa14492cae4cef8c2763fa6ef39b3 100644 (file)
@@ -41,7 +41,7 @@ public:
   SCM get_translator_names (SCM) const;
   void set_acceptor (SCM accepts, bool add);
 
-  Link_array<Context_def> path_to_acceptable_context (SCM type_string,
+  Link_array__Context_def_ path_to_acceptable_context (SCM type_string,
                                                      Output_def *) const;
   Context *instantiate (SCM extra_ops, Object_key const *);
 
index a667f9d40875a6cebd9a1378739bfb9cb8a4551e..5c3b93fa14b1b28350ce891b98fff0e175d7ebf4 100644 (file)
@@ -92,7 +92,7 @@ public:
                                std::string id, SCM ops);
   Context *create_unique_context (SCM context_name,
                                  SCM ops);
-  Link_array<Context> path_to_acceptable_context (SCM alias,
+  Link_array__Context_ path_to_acceptable_context (SCM alias,
                                                  Output_def *) const;
 };
 
index 9b59d1b1fbc29e47f8b70aa7cf8d67ab2243645a..fa9147838a620e3f7c6202577fec386f4cbd3d8f 100644 (file)
@@ -10,7 +10,7 @@
 #define DIMENSION_CACHE_HH
 
 #include "lily-proto.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "dimension-cache-callback.hh"
 #include "lily-guile.hh"
 
index 99a0dcd4048dc07262077795f9f8d3e1bbf05539..7d8bf9be1d36bffc2b0aa9c672350b924c71486f 100644 (file)
 
 #include "lily-proto.hh"
 #include "smobs.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 
 class Grob_array
 {
-  Link_array<Grob> grobs_;
+  Link_array__Grob_ grobs_;
   bool ordered_;
 
   DECLARE_SIMPLE_SMOBS (Grob_array,);
@@ -31,15 +31,15 @@ public:
   bool empty () const;
   void clear ();
   void add (Grob *x) { grobs_.push_back (x); }
-  void set_array (Link_array<Grob> const &src);
-  Link_array<Grob> &array_reference ();
-  Link_array<Grob> const &array () const;
+  void set_array (Link_array__Grob_ const &src);
+  Link_array__Grob_ &array_reference ();
+  Link_array__Grob_ const &array () const;
   static SCM make_array ();
 };
 
 DECLARE_UNSMOB (Grob_array, grob_array);
 
-Link_array<Grob> const &ly_scm2link_array (SCM x);
+Link_array__Grob_ const &ly_scm2link_array (SCM x);
 SCM grob_list_to_grob_array (SCM lst);
 
 #endif /* GROB_ARRAY_HH */
index c41d0686d040027bbea3801ed54fdf7fc7842258..89b1054552a0bbff8a6c9a463aa07436ce25fc05 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lily-guile.hh"
 #include "lily-proto.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 
 /*
   Data container for broadcasts.
@@ -29,7 +29,7 @@ public:
   Context *context () const;
   Music *music_cause () const;
   Music *ultimate_music_cause () const;
-  Link_array<Context> origin_contexts (Translator *) const;
+  Link_array__Context_ origin_contexts (Translator *) const;
   Grob_info (Translator *, Grob *);
   Grob_info ();
 
index 0652c9f8153761602ade78c9a50b2cf330d1108a..522cfd555c8280f9ce708dcf313aa262f8f54506 100644 (file)
@@ -128,7 +128,7 @@ Item *unsmob_item (SCM);
 
 /* refpoints */
 Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
-Grob *common_refpoint_of_array (Link_array<Grob> const &, Grob *, Axis a);
+Grob *common_refpoint_of_array (Link_array__Grob_ const &, Grob *, Axis a);
 System *get_root_system (Grob *me);
 
 /* extents */ 
index 4629ecaf9b0695d1f9b1920d18ab475a5d6d154f..79925bc9345acb9180939261f3d1aa9d55b1ec4e 100644 (file)
@@ -17,7 +17,7 @@ struct Horizontal_bracket
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   static Stencil make_bracket (Grob *, Real, Axis, Direction);
   static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint,
-                                        Link_array<Grob> grobs,
+                                        Link_array__Grob_ grobs,
                                         Axis a, Direction dir);
   static bool has_interface (Grob *);
 };
index 68fed68ebf823a9e8f4d69ac8724cc156974a62a..f495424f282336e0dfc55180a7b017491ca9687e 100644 (file)
@@ -14,7 +14,7 @@
 #endif
 
 #include "std-string.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-proto.hh"
 
 // GIGA urg!
@@ -29,7 +29,7 @@ class Includable_lexer : public yyFlexLexer
 
 protected:
   bool close_input ();
-  Link_array<Source_file> include_stack_;
+  Link_array__Source_file_ include_stack_;
   std::vector<int> char_count_stack_;
 
 public:
index 55ee32a171931d02eefb001485b8ad135cc23ba2..7c89bdca0e80b6bd3a18c5c76528cfe8f45ad90c 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "duration.hh"
 #include "input.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "pitch.hh"
 
 /**
index 5693b42059e6478c88c72227c9e23662cc954824..ccbd17722683c104fecef15b75170c0bf145c498 100644 (file)
@@ -178,4 +178,52 @@ typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info
 typedef void (*Translator_void_method_ptr) (Translator *);
 
 
+/* FIXME: when Link_array is dropped, do grand s/r to vector<TYPE*>.  */
+#if STD_VECTOR
+
+// FIXME: does not work with sourc-file.cc
+// #define Link_array__char_ std::vector<char*>
+
+#define Link_array__char_ Link_array<char>
+#define Link_array__Grob_ std::vector<Grob*>
+#define Link_array__Accidental_placement_entry_ std::vector<Accidental_placement_entry*>
+#define Link_array__Audio_item_ std::vector<Audio_item*>
+#define Link_array__Audio_note_ std::vector<Audio_note*>
+#define Link_array__Audio_piano_pedal_ std::vector<Audio_piano_pedal*>
+#define Link_array__Audio_staff_ std::vector<Audio_staff*>
+#define Link_array__Bracket_nesting_node_ std::vector<Bracket_nesting_node*>
+#define Link_array__Context_ std::vector<Context*>
+#define Link_array__Context_def_ std::vector<Context_def*>
+#define Link_array__Grob_ std::vector<Grob*>
+#define Link_array__Item_ std::vector<Item*>
+#define Link_array__Music_ std::vector<Music*>
+#define Link_array__Note_column_ std::vector<Note_column*>
+#define Link_array__Output_def_ std::vector<Output_def*>
+#define Link_array__Slur_configuration_ std::vector<Slur_configuration*>
+#define Link_array__Source_file_ std::vector<Source_file*>
+#define Link_array__Spanner_ std::vector<Spanner*>
+#define Link_array__Tie_configuration_ std::vector<Tie_configuration*>
+#else /* !STD_VECTOR */
+#define Link_array__char_ Link_array<char>
+#define Link_array__Grob_ Link_array<Grob>
+#define Link_array__Accidental_placement_entry_ Link_array<Accidental_placement_entry>
+#define Link_array__Audio_item_ Link_array<Audio_item>
+#define Link_array__Audio_note_ Link_array<Audio_note>
+#define Link_array__Audio_piano_pedal_ Link_array<Audio_piano_pedal>
+#define Link_array__Audio_staff_ Link_array<Audio_staff>
+#define Link_array__Bracket_nesting_node_ Link_array<Bracket_nesting_node>
+#define Link_array__Context_ Link_array<Context>
+#define Link_array__Context_def_ Link_array<Context_def>
+#define Link_array__Grob_ Link_array<Grob>
+#define Link_array__Item_ Link_array<Item>
+#define Link_array__Music_ Link_array<Music>
+#define Link_array__Note_column_ Link_array<Note_column>
+#define Link_array__Output_def_ Link_array<Output_def>
+#define Link_array__Slur_configuration_ Link_array<Slur_configuration>
+#define Link_array__Source_file_ Link_array<Source_file>
+#define Link_array__Spanner_ Link_array<Spanner>
+#define Link_array__Tie_configuration_ Link_array<Tie_configuration>
+#endif /* !STD_VECTOR */
+
+
 #endif /* LILY_PROTO_HH */
index 05181eecd645c21925b3cf803e0c839c2704cbd5..d98d209242a0febc553c60827e124d665b7fa6a9 100644 (file)
@@ -41,7 +41,7 @@ private:
   Midi_track *track_;
   Audio_staff *staff_;
   int index_;
-  Link_array<Audio_item> *items_;
+  Link_array__Audio_item_ *items_;
   PQueue<Midi_note_event> stop_note_queue;
   Moment last_mom_;
 };
index 1b1bd536f65a59016126d4d2ce5f1673f218eb0a..70be17119ccf81ffe1ed5d0af4b12448beb2916e 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lily-proto.hh"
 #include "lily-guile.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 
 /**
    Resolve conflicts between various Note_columns (chords).
 class Note_collision_interface
 {
 public:
-  static SCM automatic_shift (Grob *, Drul_array<Link_array<Grob> >);
+  static SCM automatic_shift (Grob *, Drul_array<Link_array__Grob_ >);
   static SCM forced_shift (Grob *);
 
-  static Drul_array<Link_array<Grob> > get_clash_groups (Grob *me);
+  static Drul_array<Link_array__Grob_ > get_clash_groups (Grob *me);
   DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob));
   static void add_column (Grob *me, Grob *ncol);
   static bool has_interface (Grob *);
index 7373e9a0d7594ec50f2209a75ad958308e7854f2..c84fbe1c1c0fe83003c3ac0f348bcc34da854cee 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef PAPER_BOOK_HH
 #define PAPER_BOOK_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "protected-scm.hh"
 #include "smobs.hh"
 
index 8e8d5f9fa3fdb56cf351b2ce82dc1ea6dedb92c1..ef0fc75363cb5e6e1c2cb0594f0713565fe01ec0 100644 (file)
@@ -34,7 +34,7 @@ protected:
   int breaks_;                 // used for stat printing
   Paper_column *command_column_;
   Paper_column *musical_column_;
-  Link_array<Item> items_;
+  Link_array__Item_ items_;
   bool first_;
   Moment last_moment_;
 public:
index 4ea823bd11c936b2cc4413ee84d871d29e14ff4d..f264ecdb6cb8becaacf708b103b3eed0307cc0f3 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef PERFORMANCE_HH
 #define PERFORMANCE_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "cons.hh"
 #include "music-output.hh"
 
@@ -27,7 +27,7 @@ public:
   void print () const;
   void write_output (std::string filename);
 
-  Link_array<Audio_staff> audio_staffs_;
+  Link_array__Audio_staff_ audio_staffs_;
   Cons<Audio_element> *audio_element_list_;
   Output_def *midi_;
 };
index a8e63752296ecc6879181bda46da9c04a2a20b0b..7ec2d625133c1a1e2fbcdad1c9596db9d32ab03b 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef POINTER_GROUP_INTERFACE_HH
 #define POINTER_GROUP_INTERFACE_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
@@ -21,8 +21,8 @@ public:
   static void add_grob (Grob *, SCM nm, SCM x);
 };
 
-Link_array<Grob> const &internal_extract_grob_array (Grob const *elt, SCM symbol);
-Link_array<Item> internal_extract_item_array (Grob const *elt, SCM symbol);
+Link_array__Grob_ const &internal_extract_grob_array (Grob const *elt, SCM symbol);
+Link_array__Item_ internal_extract_item_array (Grob const *elt, SCM symbol);
 
 #define extract_grob_array(x, prop) internal_extract_grob_array (x, ly_symbol2scm (prop))
 #define extract_item_array(x, prop) internal_extract_item_array (x, ly_symbol2scm (prop))
@@ -32,9 +32,9 @@ Link_array<Item> internal_extract_item_array (Grob const *elt, SCM symbol);
   representation of grob sets again.
 */
 #define extract_grob_set(grob, prop, set)                              \
-  Link_array<Grob> const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
+  Link_array__Grob_ const &set (internal_extract_grob_array (grob, ly_symbol2scm (prop)))
 #define extract_item_set(grob, prop, set)                              \
-  Link_array<Item> set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
+  Link_array__Item_ set (internal_extract_item_array (grob, ly_symbol2scm (prop)))
 
 #endif /* POINTER_GROUP_INTERFACE_HH */
 
index 6972f01d2b30f3aea2e1af7abdb3642d62f3ee01..286210dde5e0a7cc267b204b335279440c79eebb 100644 (file)
@@ -17,7 +17,7 @@ class Score_engraver : public virtual Score_translator,
 {
   System *system_;
 
-  Link_array<Grob> elems_;
+  Link_array__Grob_ elems_;
   Paper_score *pscore_;
 
   void typeset_all ();
index 6cb5cf927dfc5b8f86936a0d7e8054194bcbf6d8..092ddd0c8d9b3ae74abd2b5a838c176b049af481 100644 (file)
@@ -12,7 +12,7 @@
 #include "lily-proto.hh"
 
 #include "input.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "smobs.hh"
 #include "virtual-methods.hh"
 #include "std-string.hh"
@@ -24,7 +24,7 @@ class Score : public Input
   SCM music_;
 
 public:
-  Link_array<Output_def> defs_;
+  Link_array__Output_def_ defs_;
   std::string user_key_;
   SCM header_;
   bool error_found_;
index 4e2f2f43802d87b4b329acb5c8dc93117e6ab30e..b1499339e7f4e5f4ba51c79b238e394b2de997d8 100644 (file)
@@ -14,7 +14,7 @@
 class Separating_group_spanner
 {
   static void find_rods (Item *,
-                        Link_array<Grob> const &separators,
+                        Link_array__Grob_ const &separators,
                         vsize idx,
                         Real);
 public:
index 05d33130946e2e1b0a70c5f8b06b04b606a63379..16c9494ed6ff78229e2ddbbc24258906ad8e45f2 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef SIMPLE_SPACER_HH
 #define SIMPLE_SPACER_HH
 
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-proto.hh"
 #include "smobs.hh"
 
@@ -56,11 +56,11 @@ public:
 struct Simple_spacer_wrapper
 {
   Simple_spacer *spacer_;
-  Link_array<Grob> spaced_cols_;
-  Link_array<Grob> loose_cols_;
+  Link_array__Grob_ spaced_cols_;
+  Link_array__Grob_ loose_cols_;
 
   Simple_spacer_wrapper ();
-  void add_columns (Link_array<Grob> const &);
+  void add_columns (Link_array__Grob_ const &);
   void solve (Column_x_positions *, bool);
   ~Simple_spacer_wrapper ();
 private:
index 59cc3a5368d3d57f24a67161704458aab5fdc05c..285a8da7df6a9acccd4638caf596e6e3f8611cb8 100644 (file)
@@ -10,7 +10,7 @@
 #define SLUR_CONFIGURATION_HH
 
 #include "bezier.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "main.hh"
 
 class Slur_configuration
index 0bb54bf7c08a68b73a9b8c61a875909f69fc2447..51be36672cb1a224a071587061fe273cfc6ac126 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "box.hh"
 #include "lily-proto.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "lily-guile.hh"
 
 struct Slur_score_parameters
@@ -104,7 +104,7 @@ struct Slur_score_state
   bool has_same_beam_;
 
   Real musical_dy_;
-  Link_array<Grob> columns_;
+  Link_array__Grob_ columns_;
   std::vector<Encompass_info> encompass_infos_;
   std::vector<Extra_collision_info> extra_encompass_infos_;
 
@@ -112,7 +112,7 @@ struct Slur_score_state
   Slur_score_parameters parameters_;
   Drul_array<Bound_info> extremes_;
   Drul_array<Offset> base_attachments_;
-  Link_array<Slur_configuration> configurations_;
+  Link_array__Slur_configuration_ configurations_;
   Real staff_space_;
   Real thickness_;
 
@@ -126,7 +126,7 @@ struct Slur_score_state
   std::vector<Offset> generate_avoid_offsets () const;
   Drul_array<Bound_info> get_bound_info () const;
   void generate_curves () const;
-  Link_array<Slur_configuration> enumerate_attachments (Drul_array<Real> end_ys) const;
+  Link_array__Slur_configuration_ enumerate_attachments (Drul_array<Real> end_ys) const;
   Drul_array<Offset> get_base_attachments () const;
   Drul_array<Real> get_y_attachment_range () const;
   Encompass_info get_encompass_info (Grob *col) const;
index 6f7f75e68354c7277c46a5da111e8b8961fef872..42a2be56b2514d1755e2cf2a7fbbe468c7f00bf4 100644 (file)
 #define SOURCE_FILE_HH
 
 #include "std-string.hh"
+#include "std-vector.hh"
+#include "lily-proto.hh"
 
 #include <iostream>
 using namespace std;
 
 #include "protected-scm.hh"
-#include "parray.hh"
 
 /**
    class for reading and mapping a file.
@@ -67,7 +68,7 @@ public:
   std::string name_;
 
 private:
-  Link_array<char> newline_locations_;
+  Link_array__char_ newline_locations_;
   istream *istream_;
   char *contents_str0_;
   std::vector<char> chs_;
index f8161292fed10cfac0b5bac89918c111f8e91ee3..1b7a86b10334603139f4e31188b611c964dde9c0 100644 (file)
@@ -43,13 +43,13 @@ public:
   static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
   static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *);
   static Real get_duration_space (Moment dur, Spacing_options const *, bool *);
-  static Rational find_shortest (Grob *, Link_array<Grob> const &);
-  static Rational effective_shortest_duration (Grob *me, Link_array<Grob> const &all);
+  static Rational find_shortest (Grob *, Link_array__Grob_ const &);
+  static Rational effective_shortest_duration (Grob *me, Link_array__Grob_ const &all);
   static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
-  static void prune_loose_columns (Grob *, Link_array<Grob> *cols, Spacing_options const *);
-  static void set_explicit_neighbor_columns (Link_array<Grob> const &cols);
-  static void set_implicit_neighbor_columns (Link_array<Grob> const &cols);
-  static void generate_springs (Grob *me, Link_array<Grob> const &cols, Spacing_options const *);
+  static void prune_loose_columns (Grob *, Link_array__Grob_ *cols, Spacing_options const *);
+  static void set_explicit_neighbor_columns (Link_array__Grob_ const &cols);
+  static void set_implicit_neighbor_columns (Link_array__Grob_ const &cols);
+  static void generate_springs (Grob *me, Link_array__Grob_ const &cols, Spacing_options const *);
   static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *);
   DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
   static bool has_interface (Grob *);
index 77f272b4cabe9e397b0afb2a24ba9069eb660cc7..594220f2c15ea70ef0597bea36a391a4babe6df5 100644 (file)
@@ -36,7 +36,7 @@ class Spanner : public Grob
 public:
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
 
-  Link_array<Spanner> broken_intos_;
+  Link_array__Spanner_ broken_intos_;
 
   int get_break_index () const;
 
index a13f9c7da305e286d7314d886ff1af0a069889b9..8b82baeff262df428cb30e3bdcb0f33c901f15ec 100644 (file)
@@ -41,8 +41,8 @@ public:
   void break_into_pieces (std::vector<Column_x_positions> const &);
   static bool has_interface (Grob *);
 
-  Link_array<Item> broken_col_range (Item const *, Item const *) const;
-  Link_array<Grob> columns () const;
+  Link_array__Item_ broken_col_range (Item const *, Item const *) const;
+  Link_array__Grob_ columns () const;
 
   void add_column (Paper_column *);
   void typeset_grob (Grob *);
index a6cb8df5eb8b50bea2b649045cdc426f9bd6690b..600e11eedd2fdef10bed48536ed52e8778550fd8 100644 (file)
@@ -14,7 +14,7 @@
 #include "tie-configuration.hh"
 
 void set_chord_outline (std::vector<Skyline_entry> *skyline,
-                       Link_array<Item> bounds,
+                       Link_array__Item_ bounds,
                        Grob *common,
                        Direction d);
 void set_tie_config_directions (Ties_configuration *tie_configs_ptr);
@@ -26,7 +26,7 @@ void final_shape_adjustment (Tie_configuration &conf,
                             Grob *staff_referencer);
 void
 set_chord_outlines (Drul_array< std::vector<Skyline_entry> > *skyline_drul,
-                   Link_array<Grob> ties,
+                   Link_array__Grob_ ties,
                    Grob *common);
 
 void
index 2563e206d6d6fd06e774f403613a83ad0173e12e..7f89b21a65de36f392222292fb93f39fbb175d2d 100644 (file)
@@ -11,7 +11,7 @@
 #define TIE_FORMATTING_PROBLEM_HH
 
 #include "drul-array.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "skyline.hh"
 #include "lily-proto.hh"
 #include "tie-configuration.hh"
@@ -110,10 +110,10 @@ public:
   Ties_configuration generate_optimal_chord_configuration ();
   Ties_configuration generate_ties_configuration (Ties_configuration const &);
   Tie_configuration find_optimal_tie_configuration (Tie_specification const &) const;
-  void from_ties (Link_array<Grob> const &ties);
+  void from_ties (Link_array__Grob_ const &ties);
   void from_tie (Grob *tie);
-  void from_lv_ties (Link_array<Grob> const &);
-  void set_chord_outline (Link_array<Item>, Direction);
+  void from_lv_ties (Link_array__Grob_ const &);
+  void set_chord_outline (Link_array__Item_, Direction);
   void set_manual_tie_configuration (SCM);
   Interval get_attachment (Real) const;
   Grob *common_x_refpoint () const;
index c53533141551352fdf7cee984295aab651b4eab7..ef13b682ccda6a2fdb4d1e42d5bde78539a6e015 100644 (file)
@@ -12,7 +12,7 @@
 #include "moment.hh"
 #include "translator.hh"
 
-#include "parray.hh"
+#include "std-vector.hh"
 
 class Timing_translator : public Translator
 {
index 3abbee33d7d90be36eb009244be8c284c58284ea..625944ba2d6c9e6c6177cc1451d430d1549b83b3 100644 (file)
@@ -10,7 +10,7 @@
 #define TRANSLATOR_GROUP_HH
 
 #include "translator.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 
 typedef void (Translator:: *Translator_method) (void);
 typedef void (Translator_group:: *Translator_group_method) (void);
index b93de11d6adcce233ee4d028b8b050414c403b3f..3b0c0d735dcd1eb3d7fc6b6a5a4c5b591120ffc3 100644 (file)
@@ -25,7 +25,7 @@ public:
   static void get_bounds (Grob *, Grob **, Grob **);
   static void add_column (Grob *me, Item *);
   static void add_beam (Grob *me, Grob *);
-  static Grob *parallel_beam (Grob *me, Link_array<Grob> const &cols, bool *equally_long);
+  static Grob *parallel_beam (Grob *me, Link_array__Grob_ const &cols, bool *equally_long);
   static void calc_position_and_height (Grob *, Real *, Real *dy);
   static Stencil make_bracket (Grob *me, Axis protusion_axis,
                               Offset dz, Drul_array<Real> height,
index 7279ba52911626574f743e588394492c048f1139..84065ab4f6fd0093f621e0d87d3a351b9f027ab3 100644 (file)
@@ -30,6 +30,5 @@ Keyword_table::lookup (char const *s) const
   vsize idx = binary_search (table_, e, tabcmp);
   if (idx != VPOS)
     return table_[idx].tokcode_;
-  else
-    return VPOS;
+  return VPOS;
 }
index d361298c56da773dd52cad01c7c32b6559a1698d..33cf854eb4443d44785ba2a90b3230c93d34ead0 100644 (file)
@@ -19,7 +19,7 @@ class Laissez_vibrer_engraver : public Engraver
 
   Music *event_;
   Grob *lv_column_;
-  Link_array<Grob> lv_ties_;
+  Link_array__Grob_ lv_ties_;
   
   void stop_translation_timestep (); 
   DECLARE_ACKNOWLEDGER (note_head);
index 449181e61d613f1b8be9f06c7a11a8da43f26263..3553d35b70fa78c6c1fce6baabdfe6a00d5f459b 100644 (file)
@@ -42,9 +42,9 @@ Laissez_vibrer_tie_column::calc_positioning_done (SCM smob)
   Grob *me = unsmob_grob (smob);
   
   extract_grob_set (me, "ties", lv_ro_ties);
-  Link_array<Grob> lv_ties (lv_ro_ties);
+  Link_array__Grob_ lv_ties (lv_ro_ties);
 
-  lv_ties.sort (&Laissez_vibrer_tie::compare);
+  vector_sort (lv_ties, &Laissez_vibrer_tie::compare);
 
   Ties_configuration ties_config;
   
index 6d2ff577ec9fd9d954c3ca967bbfb47042a7ac6f..35a17bc3e77c05cf5c00eab9c78e702cdb1764b4 100644 (file)
@@ -21,7 +21,7 @@ protected:
    void process_music ();
 
 private:
-  Link_array<Music> events_;
+  Link_array__Music_ events_;
   Audio_text *audio_;
 };
 
index c429b67b489f30ab9abab9f4897c178fd70c2445..574ace67cb944a5264f2f6aa3d77168cde8e47ca 100644 (file)
@@ -29,7 +29,7 @@ protected:
 
 private:
   Music *rest_ev_;
-  Link_array<Music> text_events_;
+  Link_array__Music_ text_events_;
   int start_measure_;
   Rational last_main_moment_;
   Moment stop_moment_;
@@ -39,8 +39,8 @@ private:
   Spanner *last_rest_;
   Spanner *mmrest_;
 
-  Link_array<Spanner> numbers_;
-  Link_array<Spanner> last_numbers_;
+  Link_array__Spanner_ numbers_;
+  Link_array__Spanner_ last_numbers_;
 };
 
 Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
index 1e74bbba34dc57b232d3b474701b16d6d528ccba..496e19f93d89e103b15b89a2197a7f0af16ed20e 100644 (file)
@@ -47,7 +47,7 @@ class New_fingering_engraver : public Engraver
   std::vector<Finger_tuple> articulations_;
   std::vector<Finger_tuple> string_numbers_;
 
-  Link_array<Grob> heads_;
+  Link_array__Grob_ heads_;
   Grob *stem_;
 
 public:
index e7a6c621c87eeec82303e3435085b52e195e9177..db794d5092b9e73d79fcf16730daaa130ff0739d 100644 (file)
@@ -25,7 +25,7 @@ void
 check_meshing_chords (Grob *me,
                      Drul_array<std::vector<Real> > *offsets,
                      Drul_array<std::vector<Slice> > const &extents,
-                     Drul_array<Link_array<Grob> > const &clash_groups)
+                     Drul_array<Link_array__Grob_ > const &clash_groups)
 
 {
   if (!extents[UP].size () || ! extents[DOWN].size ())
@@ -280,7 +280,7 @@ SCM
 Note_collision_interface::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);  
-  Drul_array<Link_array<Grob> > cg = get_clash_groups (me);
+  Drul_array<Link_array__Grob_ > cg = get_clash_groups (me);
 
   Direction d = UP;
   do
@@ -309,7 +309,7 @@ Note_collision_interface::calc_positioning_done (SCM smob)
     }
   while (flip (&d) != UP);
 
-  Link_array<Grob> done;
+  Link_array__Grob_ done;
   Real left_most = 1e6;
 
   std::vector<Real> amounts;
@@ -328,7 +328,8 @@ Note_collision_interface::calc_positioning_done (SCM smob)
       Grob *s = unsmob_grob (scm_caar (autos));
       Real amount = scm_to_double (scm_cdar (autos)) * wid;
 
-      if (!done.find (s))
+      vsize x = find (done, s) - done.begin ();
+      if (x == VPOS || x >= done.size ())
        {
          done.push_back (s);
          amounts.push_back (amount);
@@ -343,10 +344,10 @@ Note_collision_interface::calc_positioning_done (SCM smob)
   return SCM_BOOL_T;
 }
 
-Drul_array < Link_array<Grob> >
+Drul_array < Link_array__Grob_ >
 Note_collision_interface::get_clash_groups (Grob *me)
 {
-  Drul_array<Link_array<Grob> > clash_groups;
+  Drul_array<Link_array__Grob_ > clash_groups;
 
   extract_grob_set (me, "elements", elements);
   for (vsize i = 0; i < elements.size (); i++)
@@ -359,8 +360,8 @@ Note_collision_interface::get_clash_groups (Grob *me)
   Direction d = UP;
   do
     {
-      Link_array<Grob> &clashes (clash_groups[d]);
-      clashes.sort (Note_column::shift_compare);
+      Link_array__Grob_ &clashes (clash_groups[d]);
+      vector_sort (clashes, Note_column::shift_compare);
     }
   while ((flip (&d)) != UP);
 
@@ -374,7 +375,7 @@ Note_collision_interface::get_clash_groups (Grob *me)
 */
 SCM
 Note_collision_interface::automatic_shift (Grob *me,
-                                          Drul_array < Link_array<Grob>
+                                          Drul_array < Link_array__Grob_
                                           > clash_groups)
 {
   Drul_array < std::vector<int> > shifts;
@@ -384,7 +385,7 @@ Note_collision_interface::automatic_shift (Grob *me,
   do
     {
       std::vector<int> &shift (shifts[d]);
-      Link_array<Grob> &clashes (clash_groups[d]);
+      Link_array__Grob_ &clashes (clash_groups[d]);
 
       for (vsize i = 0; i < clashes.size (); i++)
        {
index 3a8705168c95e9e73d83f0092b7fbb337c71322e..109e4905c7b6b0f1d3ea228bfbc0ae6de2815b4d 100644 (file)
@@ -20,9 +20,9 @@ using namespace std;
 
 class Note_heads_engraver : public Engraver
 {
-  Link_array<Item> notes_;
-  Link_array<Item> dots_;
-  Link_array<Music> note_evs_;
+  Link_array__Item_ notes_;
+  Link_array__Item_ dots_;
+  Link_array__Music_ note_evs_;
 
 public:
   TRANSLATOR_DECLARATIONS (Note_heads_engraver);
index 1fc63b024266c9d0ecab1009208904bf3fe1b005..c0ee4986f6651741a0a059e79b55be09f8b28cb4 100644 (file)
@@ -14,8 +14,8 @@ class Note_name_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Note_name_engraver);
 
-  Link_array<Music> events_;
-  Link_array<Item> texts_;
+  Link_array__Music_ events_;
+  Link_array__Item_ texts_;
   virtual bool try_music (Music *m);
   void process_music ();
   void stop_translation_timestep ();
index 77c0a21bf8d4800557b55de3156131890ed191a5..cfb8edaf5105c69da1a0947b08cc3f5939695019 100644 (file)
@@ -28,8 +28,8 @@ protected:
   void process_music ();
 
 private:
-  Link_array<Music> note_evs_;
-  Link_array<Audio_note> notes_;
+  Link_array__Music_ note_evs_;
+  Link_array__Audio_note_ notes_;
 };
 
 void
@@ -45,7 +45,8 @@ Note_performer::process_music ()
 
       while (note_evs_.size ())
        {
-         Music *n = note_evs_.pop ();
+         Music *n = note_evs_.back ();
+         note_evs_.pop_back ();
          SCM pit = n->get_property ("pitch");
 
          if (Pitch *pitp = unsmob_pitch (pit))
index 78b1bcaf4a3fe7e79d1b75f52789f74590686d0f..0ddf4bc5403ebce0b3989fe3ddad2982ce98768d 100644 (file)
@@ -39,7 +39,7 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
   Interval left_head_wid;
   do
     {
-      Link_array<Grob> const &items (ly_scm2link_array (props [d]));
+      Link_array__Grob_ const &items (ly_scm2link_array (props [d]));
       for (vsize i = items.size (); i--;)
        {
          Item *it = dynamic_cast<Item *> (items[i]);
@@ -223,7 +223,7 @@ Note_spacing::right_column (Grob *me)
 
   if (prune && a)
     {
-      Link_array<Grob> &right = a->array_reference ();
+      Link_array__Grob_ &right = a->array_reference ();
       for (vsize i = right.size (); i--;)
        {
          if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
@@ -269,7 +269,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
 
   do
     {
-      Link_array<Grob> const &items (ly_scm2link_array (props [d]));
+      Link_array__Grob_ const &items (ly_scm2link_array (props [d]));
       for (vsize i = 0; i < items.size (); i++)
        {
          Item *it = dynamic_cast<Item *> (items[i]);
index d3eeccedfccc5578563cad8cfcc5e0d918f10967..c0750c06c858fb20507e010f03d11256f3cadedf 100644 (file)
@@ -18,7 +18,7 @@ class Output_property_engraver : public Engraver
 {
   TRANSLATOR_DECLARATIONS (Output_property_engraver);
 protected:
-  Link_array<Music> props_;
+  Link_array__Music_ props_;
   DECLARE_ACKNOWLEDGER (grob)
 
   void stop_translation_timestep ();
index 5688d49e6177eeff56950ccc14b3b2210e7de3e3..f7a1ae5e8b9108d54a2de1397b10138192bd692e 100644 (file)
@@ -157,7 +157,7 @@ Paper_column::before_line_breaking (SCM grob)
   if (!ga)
     return SCM_UNSPECIFIED;
 
-  Link_array<Grob> &array (ga->array_reference ());
+  Link_array__Grob_ &array (ga->array_reference ());
 
   for (vsize i = array.size (); i--;)
     {
index 6bc05c4e13807c2e3bd3ebdebd1a6cc771e9d161..c983fe02892157aff73b20a11e01a7737bf5afa2 100644 (file)
@@ -86,7 +86,7 @@ Paper_score::process ()
      down the road.
 
      doubly, also done in Score_engraver */
-  Link_array<Grob> pc (system_->columns ());
+  Link_array__Grob_ pc (system_->columns ());
   pc[0]->set_property ("breakable", SCM_BOOL_T);
   pc.back ()->set_property ("breakable", SCM_BOOL_T);
 
index b8eed4092d72692b705b112f543d50ef45a1e23c..64f76ae3a01317b8d93cfca7cb7a20a3e2927069 100644 (file)
@@ -27,8 +27,8 @@ class Phrasing_slur_engraver : public Engraver
 {
   Drul_array<Music *> events_;
   Music *running_slur_start_;
-  Link_array<Grob> slurs_;
-  Link_array<Grob> end_slurs_;
+  Link_array__Grob_ slurs_;
+  Link_array__Grob_ end_slurs_;
 
 protected:
   virtual bool try_music (Music *);
index 1177347f09379c5a5f469ed91acfea7ffafb3582..e15f8deb3d6ab665aedc4667b81afb1bb1d9bf08 100644 (file)
@@ -79,7 +79,7 @@ private:
     occurs simultaneously then extra space can be added between them.
   */
 
-  Link_array<Spanner> previous_;
+  Link_array__Spanner_ previous_;
   void del_linespanner (Spanner *);
 
   void create_text_grobs (Pedal_info *p, bool);
@@ -438,8 +438,8 @@ Piano_pedal_engraver::finalize ()
 void
 Piano_pedal_engraver::del_linespanner (Spanner *g)
 {
-  int idx = previous_.find_index (g);
-  if (idx >= 0)
+  vsize idx = find (previous_, g) - previous_.begin ();
+  if (idx != VPOS && idx < previous_.size ())
     previous_.erase (previous_.begin () + idx);
 }
 
index f4ac60018a651b1a13d9d13c587c6e65bb76db03..4cf4415f0300fcf1be4fe3401a4e9e246d73c973 100644 (file)
@@ -36,7 +36,7 @@ protected:
   void start_translation_timestep ();
 
 private:
-  Link_array<Audio_piano_pedal> audios_;
+  Link_array__Audio_piano_pedal_ audios_;
   Pedal_info *info_alist_;
 };
 
index ec983e5d0c3e75b32877c828764f65b597d40bf1..0cc9155e059c4764f58106bdeada9f6ae407c593 100644 (file)
@@ -35,7 +35,7 @@ private:
   Item *trill_group_;
   Item *trill_accidental_;
 
-  Link_array<Grob> heads_;
+  Link_array__Grob_ heads_;
 
   void make_trill (Music *);
 };
index 967c4ccec692b121f547d515557275bdeb7523fb..51354ffb50cb95eea40e1fa4c093e8247800cf61 100644 (file)
@@ -40,26 +40,26 @@ Pointer_group_interface::add_grob (Grob *me, SCM sym, Grob *p)
   arr->add (p);
 }
 
-static Link_array<Grob> empty_array;
+static Link_array__Grob_ empty_array;
 
-Link_array<Grob> const &
+Link_array__Grob_ const &
 ly_scm2link_array (SCM x)
 {
   Grob_array *arr = unsmob_grob_array (x);
   return arr ? arr->array () : empty_array;
 }
 
-Link_array<Grob> const &
+Link_array__Grob_ const &
 internal_extract_grob_array (Grob const *elt, SCM symbol)
 {
   return ly_scm2link_array (elt->internal_get_object (symbol));
 }
 
-Link_array<Item>
+Link_array__Item_
 internal_extract_item_array (Grob const *elt, SCM symbol)
 {
   Grob_array *arr = unsmob_grob_array (elt->internal_get_object (symbol));
-  Link_array<Item> items;
+  Link_array__Item_ items;
   for (vsize i = 0; arr && i < arr->size (); i++)
     items.push_back (arr->item (i));
 
index 2d2b6df053b7119301b9b7a2b8bf744ae4f9d2f5..1ee16363ae80c6184f2af6c7f2f96fe5d713f065 100644 (file)
@@ -15,7 +15,7 @@ class Rest_collision_engraver : public Engraver
 {
   Item *rest_collision_;
   int rest_count_;
-  Link_array<Grob> note_columns_;
+  Link_array__Grob_ note_columns_;
 protected:
   DECLARE_ACKNOWLEDGER (note_column);
   void process_acknowledged ();
index 1921aa5a177a72a7ea50eff6e2a53218370ee451..aebdf84cf841925b98ece9b30483ad6b89b382a3 100644 (file)
@@ -92,8 +92,8 @@ Rest_collision::calc_positioning_done (SCM smob)
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "elements", elts);
 
-  Link_array<Grob> rests;
-  Link_array<Grob> notes;
+  Link_array__Grob_ rests;
+  Link_array__Grob_ notes;
 
   for (vsize i = 0; i < elts.size (); i++)
     {
@@ -137,7 +137,7 @@ Rest_collision::calc_positioning_done (SCM smob)
        This is incomplete: in case of an uneven number of rests, the
        center one should be centered on the staff.
       */
-      Drul_array<Link_array<Grob> > ordered_rests;
+      Drul_array<Link_array__Grob_ > ordered_rests;
       for (vsize i = 0; i < rests.size (); i++)
        {
          Grob *r = Note_column::get_rest (rests[i]);
@@ -151,7 +151,7 @@ Rest_collision::calc_positioning_done (SCM smob)
 
       Direction d = LEFT;
       do
-       ordered_rests[d].sort (Note_column::shift_compare);
+       vector_sort (ordered_rests[d], Note_column::shift_compare);
       while (flip (&d) != LEFT)
        ;
 
index ebc156fc953de1ab7d041fd8b357d745c494a75e..2ca4cdca7c837ef53a0e47c1db26cbec3a7e3b3f 100644 (file)
@@ -41,7 +41,7 @@
 
 class Rhythmic_column_engraver : public Engraver
 {
-  Link_array<Grob> rheads_;
+  Link_array__Grob_ rheads_;
   Grob *stem_;
   Grob *note_column_;
   Grob *dotcol_;
index 41555cdbff34399b886639299789b54ff370cd88..ccbe0f6112b682bd71aafeb29578d1ac04e641f1 100644 (file)
@@ -18,7 +18,7 @@
 class Script_column_engraver : public Engraver
 {
   Grob *scol_;
-  Link_array<Item> scripts_;
+  Link_array__Item_ scripts_;
 
 public:
   TRANSLATOR_DECLARATIONS (Script_column_engraver);
index bfd95f999ba81872d116050a289582431372bec2..0cc14ba48fa96889ad05b4f27d6a75be4129adbc 100644 (file)
@@ -42,7 +42,7 @@ Script_column::before_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   Drul_array<SCM> scripts_drul (SCM_EOL, SCM_EOL);
-  Link_array<Grob> staff_sided;
+  Link_array__Grob_ staff_sided;
 
   extract_grob_set (me, "scripts", scripts);
   for (vsize i = 0; i < scripts.size (); i++)
index 94aac0973486e391dbab515a2653142a49b31b4e..a5b076bc868d00f1f9c0d29b20323602723db729 100644 (file)
@@ -16,7 +16,7 @@
 
 void
 Separating_group_spanner::find_rods (Item *r,
-                                    Link_array<Grob> const &separators,
+                                    Link_array__Grob_ const &separators,
                                     vsize idx,
                                     Real padding)
 {
index 1db11947a38f1178335e160a88e282bc957c3a17..b50acd3143a46585bd577f9dc2c83734c509f68f 100644 (file)
@@ -24,7 +24,7 @@
 struct Spacings
 {
   Item *staff_spacing_;
-  Link_array<Item> note_spacings_;
+  Link_array__Item_ note_spacings_;
 
   Spacings ()
   {
index be700c693c0de2dded888fe080c93af8702bc7cf..900fd77988ec3fb97eb480989131d06324381155 100644 (file)
@@ -376,9 +376,9 @@ compare_paper_column_rank (Grob *const &a,
 }
 
 void
-Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
+Simple_spacer_wrapper::add_columns (Link_array__Grob_ const &icols)
 {
-  Link_array<Grob> cols (icols);
+  Link_array__Grob_ cols (icols);
   cols.clear ();
 
   for (vsize i = 0; i < icols.size (); i++)
@@ -418,8 +418,8 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
           scm_is_pair (s); s = scm_cdr (s))
        {
          Grob *other = unsmob_grob (scm_caar (s));
-         int j = binsearch_links (cols, other, &compare_paper_column_rank);
-         if (j >= 0 && cols[j] == other)
+         vsize j = binary_search (cols, other, &compare_paper_column_rank);
+         if (j != VPOS && cols[j] == other)
            spacer_->add_rod (i, j, scm_to_double (scm_cdar (s)));
        }
 
index 9fee28767ae34de3edf5e36708313be8c7ea48af..a0deb271dccb7736d30e3380de734de82a01c83c 100644 (file)
@@ -26,8 +26,8 @@ class Slur_engraver : public Engraver
 {
   Drul_array<Music *> events_;
   Music *running_slur_start_;
-  Link_array<Grob> slurs_;
-  Link_array<Grob> end_slurs_;
+  Link_array__Grob_ slurs_;
+  Link_array__Grob_ end_slurs_;
 
   void set_melisma (bool);
 
index 19ce9ee47c6c15dc11f514aecf1275c9c58961e5..71a6470b0c2f124b58907f6ff2e33b9734c74625 100644 (file)
@@ -635,7 +635,7 @@ std::vector<Offset>
 Slur_score_state::generate_avoid_offsets () const
 {
   std::vector<Offset> avoid;
-  Link_array<Grob> encompasses = columns_;
+  Link_array__Grob_ encompasses = columns_;
 
   for (vsize i = 0; i < encompasses.size (); i++)
     {
@@ -689,10 +689,10 @@ Slur_score_state::generate_curves () const
     configurations_[i]->generate_curve (*this, r_0, h_inf, avoid);
 }
 
-Link_array<Slur_configuration>
+Link_array__Slur_configuration_
 Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
 {
-  Link_array<Slur_configuration> scores;
+  Link_array__Slur_configuration_ scores;
 
   Drul_array<Offset> os;
   os[LEFT] = base_attachments_[LEFT];
index a25d071074dd42972e2396318dea47191b76498e..041308dbc8999ebd583a0ff0cdb3aa33130fdc0a 100644 (file)
@@ -324,7 +324,7 @@ Source_file::get_line (char const *pos_str0) const
 
   binary_search_bounds (newline_locations_,
                        pos_str0,
-                       Link_array<char>::default_compare,
+                       default_compare,
                        &lo, &hi);
 
   if (*pos_str0 == '\n')
index bcac1ea5f7ae3847e561569a46cbe554d90485cc..e878d264a186c6bb9355b90e3c6f4b1f2b56dc57 100644 (file)
@@ -126,10 +126,10 @@ is_loose_column (Grob *l, Grob *c, Grob *r, Spacing_options const *options)
   between.
 */
 void
-Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
+Spacing_spanner::prune_loose_columns (Grob *me, Link_array__Grob_ *cols,
                                      Spacing_options const *options)
 {
-  Link_array<Grob> newcols;
+  Link_array__Grob_ newcols;
 
   for (vsize i = 0; i < cols->size (); i++)
     {
@@ -228,7 +228,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols,
   Set neighboring columns determined by the spacing-wishes grob property.
 */
 void
-Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
+Spacing_spanner::set_explicit_neighbor_columns (Link_array__Grob_ const &cols)
 {
   for (vsize i = 0; i < cols.size (); i++)
     {
@@ -300,7 +300,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> const &cols)
   yet. Only do breakable non-musical columns, and musical columns.
 */
 void
-Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> const &cols)
+Spacing_spanner::set_implicit_neighbor_columns (Link_array__Grob_ const &cols)
 {
   for (vsize i = 0; i < cols.size (); i++)
     {
index 9caba57552f9dde6a2469993c2d83314ad0ad56e..bc0594bed0c79d0b41439132eaa3d1cd1246fe46 100644 (file)
@@ -38,7 +38,7 @@ set_loose_columns (System *which, Column_x_positions const *posns)
       Item *left = 0;
       Item *right = 0;
 
-      Link_array<Item> clique;
+      Link_array__Item_ clique;
       while (1)
        {
          SCM between = loose->get_object ("between-cols");
index 6300c9979495ef3d978333219481370fb56ced69..39638ff007cfd28199893f3580c568068a566946 100644 (file)
@@ -35,7 +35,7 @@ using namespace std;
 */
 Rational
 Spacing_spanner::effective_shortest_duration (Grob *me,
-                                             Link_array<Grob> const &all)
+                                             Link_array__Grob_ const &all)
 {
   SCM preset_shortest = me->get_property ("common-shortest-duration");
   Rational global_shortest;
@@ -61,7 +61,7 @@ Spacing_spanner::set_springs (SCM smob)
   /*
     can't use get_system() ? --hwn.
   */
-  Link_array<Grob> all (get_root_system (me)->columns ());
+  Link_array__Grob_ all (get_root_system (me)->columns ());
 
   set_explicit_neighbor_columns (all);
 
@@ -86,7 +86,7 @@ Spacing_spanner::set_springs (SCM smob)
   stuff, then.
 */
 Rational
-Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
+Spacing_spanner::find_shortest (Grob *me, Link_array__Grob_ const &cols)
 {
   /*
     ascending in duration
@@ -225,7 +225,7 @@ Spacing_spanner::generate_pair_spacing (Grob *me,
 
 void
 Spacing_spanner::generate_springs (Grob *me,
-                                  Link_array<Grob> const &cols,
+                                  Link_array__Grob_ const &cols,
                                   Spacing_options const *options)
 {
   Paper_column *next = 0;
index 998d2693a27367066aa49d6d2a2ace357ff0d288..1e992e16a3b99fdd9e609705e7c5a72a54cea380 100644 (file)
@@ -30,7 +30,7 @@ protected:
 
 private:
   Item *span_arpeggio_;
-  Link_array<Grob> arpeggios_;
+  Link_array__Grob_ arpeggios_;
 };
 
 Span_arpeggio_engraver::Span_arpeggio_engraver ()
index 158663a979895cad077f35d433871e6eb6171c02..8ddd16c08de72cea08f2b605837b3d254ed921af 100644 (file)
@@ -22,7 +22,7 @@ dependencies to the spanbars.
 class Span_bar_engraver : public Engraver
 {
   Item *spanbar_;
-  Link_array<Item> bars_;
+  Link_array__Item_ bars_;
 
 public:
   TRANSLATOR_DECLARATIONS (Span_bar_engraver);
index e80f1efce32df6435036b87cf20e0ca98ff85720..1a8ae94ed9f00b5c14e8fc1c6c52330d6b22ef0c 100644 (file)
@@ -81,7 +81,7 @@ Spanner::do_break_processing ()
   else
     {
       System *root  = get_root_system (this);
-      Link_array<Item> break_points = root->broken_col_range (left, right);
+      Link_array__Item_ break_points = root->broken_col_range (left, right);
 
       break_points.insert (break_points.begin () + 0, left);
       break_points.push_back (right);
@@ -124,7 +124,7 @@ Spanner::do_break_processing ()
            }
        }
     }
-  broken_intos_.sort (Spanner::compare);
+  vector_sort (broken_intos_, Spanner::compare);
   for (vsize i = broken_intos_.size ();i--;)
     broken_intos_[i]->break_index_ = i;
 }
@@ -238,12 +238,10 @@ Spanner::get_system () const
 Grob *
 Spanner::find_broken_piece (System *l) const
 {
-  int idx = binsearch_links (broken_intos_, (Spanner *)l, Spanner::compare);
-
-  if (idx < 0)
-    return 0;
-  else
+  vsize idx = binary_search (broken_intos_, (Spanner *)l, Spanner::compare);
+  if (idx != VPOS)
     return broken_intos_ [idx];
+  return 0;
 }
 
 int
@@ -337,7 +335,7 @@ int
 broken_spanner_index (Spanner *sp)
 {
   Spanner *parent = dynamic_cast<Spanner *> (sp->original ());
-  return parent->broken_intos_.find_index (sp);
+  return find (parent->broken_intos_, sp) - parent->broken_intos_.begin ();
 }
 
 Spanner *
index 0a40dcac36446f998539c03e5184146d8ff6aee2..3f80169b0cc35bfd60d209080740d176b270ac92 100644 (file)
@@ -21,8 +21,8 @@ public:
   TRANSLATOR_DECLARATIONS (Stanza_number_align_engraver);
 
 protected:
-  Link_array<Grob> lyrics_;
-  Link_array<Grob> stanza_numbers_;
+  Link_array__Grob_ lyrics_;
+  Link_array__Grob_ stanza_numbers_;
 
   DECLARE_ACKNOWLEDGER (lyric_syllable);
   DECLARE_ACKNOWLEDGER (stanza_number);
index 937b17c824c155c2e8ebb9d63a7c2bb89a49a873..111eda05327640f7f90a089f9f1fe8c14b39940e 100644 (file)
@@ -367,12 +367,12 @@ Stem::calc_positioning_done (SCM smob)
     return SCM_BOOL_T;
 
   extract_grob_set (me, "note-heads", ro_heads);
-  Link_array<Grob> heads (ro_heads);
-  heads.sort (compare_position);
+  Link_array__Grob_ heads (ro_heads);
+  vector_sort (heads, compare_position);
   Direction dir = get_grob_direction (me);
 
   if (dir < 0)
-    heads.reverse ();
+    reverse (heads);
 
   Real thick = thickness (me);
 
index 6bcdea73b04687236e8e3af81c5858d56abf868a..9808148fd9615107e0b484c44e2ff3a009b989c4 100644 (file)
@@ -32,7 +32,7 @@ public:
 struct Bracket_nesting_group : public Bracket_nesting_node
 {
   Spanner *delimiter_;
-  Link_array<Bracket_nesting_node> children_;
+  Link_array__Bracket_nesting_node_ children_;
   SCM symbol_;
 
   void from_list (SCM ); 
index 423fbac24f6f4a167e9816819aa2d14c05358df0..6bcae7ffba0f5e0129565894488ba31f0322f775 100644 (file)
@@ -106,7 +106,7 @@ System::derived_mark () const
 }
 
 static void
-fixup_refpoints (Link_array<Grob> const &grobs)
+fixup_refpoints (Link_array__Grob_ const &grobs)
 {
   for (vsize i = grobs.size (); i--;)
     grobs[i]->fixup_refpoint ();
@@ -207,7 +207,7 @@ System::break_into_pieces (std::vector<Column_x_positions> const &breaking)
       System *system = dynamic_cast<System *> (clone (i));
       system->rank_ = i;
 
-      Link_array<Grob> c (breaking[i].cols_);
+      Link_array__Grob_ c (breaking[i].cols_);
       pscore_->typeset_system (system);
 
       system->set_bound (LEFT, c[0]);
@@ -317,9 +317,9 @@ System::post_processing ()
      This might seem inefficient, but Stencils are cached per grob
      anyway. */
 
-  Link_array<Grob> all_elts_sorted (all_elements_->array ());
-  all_elts_sorted.default_sort ();
-  all_elts_sorted.uniq ();
+  Link_array__Grob_ all_elts_sorted (all_elements_->array ());
+  vector_sort (all_elts_sorted, default_compare);
+  uniq (all_elts_sorted);
   this->get_stencil ();
   for (vsize i = all_elts_sorted.size (); i--;)
     {
@@ -399,10 +399,10 @@ System::get_paper_system ()
   return pl->unprotect ();
 }
 
-Link_array<Item>
+Link_array__Item_
 System::broken_col_range (Item const *left, Item const *right) const
 {
-  Link_array<Item> ret;
+  Link_array__Item_ ret;
 
   left = left->get_column ();
   right = right->get_column ();
@@ -430,7 +430,7 @@ System::broken_col_range (Item const *left, Item const *right) const
 
 /** Return all columns, but filter out any unused columns , since they might
     disrupt the spacing problem. */
-Link_array<Grob>
+Link_array__Grob_
 System::columns () const
 {
   extract_grob_set (this, "columns", ro_columns);
@@ -443,7 +443,7 @@ System::columns () const
        break;
     }
 
-  Link_array<Grob> columns;
+  Link_array__Grob_ columns;
   for (int i = 0; i <= last_breakable; i++)
     {
       if (Paper_column::is_used (ro_columns[i]))
index 6da82d3fdd10776f14eb18d383913fb584329d2a..7f777c8374bb4e3e1064075c31df8af9e0bb0109 100644 (file)
@@ -26,11 +26,11 @@ using namespace std;
 */
 class Tab_note_heads_engraver : public Engraver
 {
-  Link_array<Item> notes_;
+  Link_array__Item_ notes_;
 
-  Link_array<Item> dots_;
-  Link_array<Music> note_events_;
-  Link_array<Music> tabstring_events_;
+  Link_array__Item_ dots_;
+  Link_array__Music_ note_events_;
+  Link_array__Music_ tabstring_events_;
 public:
   TRANSLATOR_DECLARATIONS (Tab_note_heads_engraver);
 
index d2eb4055f4115ac668c165f824f8cb898c2f6d34..7ada54bb7c92cd8d89d33725a4a9275e77107276 100644 (file)
@@ -18,8 +18,8 @@
 */
 class Text_engraver : public Engraver
 {
-  Link_array<Music> evs_;
-  Link_array<Item> texts_;
+  Link_array__Music_ evs_;
+  Link_array__Item_ texts_;
 public:
   TRANSLATOR_DECLARATIONS (Text_engraver);
 protected:
index 68afe8f3032423aa329a2e4e379d0b5ab43c7cb8..7c6bcbb11bc9d7fa0459890f735f8792e5a58ded 100644 (file)
@@ -10,7 +10,7 @@
 #include "stem.hh"
 #include "note-head.hh"
 #include "tie.hh"
-#include "parray.hh"
+#include "std-vector.hh"
 #include "spanner.hh"
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
index a6633aca6e4c5cf9c58291adad77b2222741c7d4..6962ccf3690de696259629d9d3afd3627b733d5c 100644 (file)
@@ -70,7 +70,7 @@ Tie_column::calc_positioning_done (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   extract_grob_set (me, "ties", ro_ties);
-  Link_array<Grob> ties (ro_ties);
+  Link_array__Grob_ ties (ro_ties);
   if (!ties.size ())
     return SCM_BOOL_T;
 
@@ -82,7 +82,7 @@ Tie_column::calc_positioning_done (SCM smob)
       return SCM_BOOL_T;
     }
   
-  ties.sort (&Tie::compare);
+  vector_sort (ties, &Tie::compare);
 
   Tie_formatting_problem problem;
   problem.from_ties (ties);
index 9ec95d91a14a8e49446c4ef5dde2e8627949a481..c78b99286cabbf4db9e9179836606999aa270b66 100644 (file)
@@ -48,9 +48,9 @@ struct Head_event_tuple
 class Tie_engraver : public Engraver
 {
   Music *event_;
-  Link_array<Grob> now_heads_;
+  Link_array__Grob_ now_heads_;
   std::vector<Head_event_tuple> heads_to_tie_;
-  Link_array<Grob> ties_;
+  Link_array__Grob_ ties_;
 
   Spanner *tie_column_;
 
index d1462d4f4b90ad0d7d31d2d8737a90da8f700185..8309db2660ddd43ac2e1a7bcaa0b6854040cd3a5 100644 (file)
@@ -59,7 +59,7 @@ Tie_formatting_problem::~Tie_formatting_problem ()
 }
 
 void
-Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
+Tie_formatting_problem::set_chord_outline (Link_array__Item_ bounds,
                                           Direction d)
 {
   Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]);
@@ -163,7 +163,7 @@ Tie_formatting_problem::set_chord_outline (Link_array<Item> bounds,
 void
 Tie_formatting_problem::from_tie (Grob *tie)
 {
-  Link_array<Grob> ties;
+  Link_array__Grob_ ties;
   ties.push_back (tie);
   from_ties (ties);
 
@@ -177,7 +177,7 @@ Tie_formatting_problem::common_x_refpoint () const
 }
 
 void
-Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
+Tie_formatting_problem::from_ties (Link_array__Grob_ const &ties)
 {
   if (ties.empty ())
     return;
@@ -194,7 +194,7 @@ Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
   Direction d = LEFT;
   do
     {
-      Link_array<Item> bounds;
+      Link_array__Item_ bounds;
       
       for (vsize i = 0; i < ties.size (); i++)
        {
@@ -231,13 +231,13 @@ Tie_formatting_problem::from_ties (Link_array<Grob> const &ties)
 }
 
 void
-Tie_formatting_problem::from_lv_ties (Link_array<Grob> const &lv_ties)
+Tie_formatting_problem::from_lv_ties (Link_array__Grob_ const &lv_ties)
 {
   if (lv_ties.empty ())
     return;
   
   details_.from_grob (lv_ties[0]);
-  Link_array<Item> heads;
+  Link_array__Item_ heads;
   
   for (vsize i = 0; i < lv_ties.size (); i++)
     {
@@ -477,7 +477,7 @@ Tie_formatting_problem::score_configuration (Tie_configuration const &conf) cons
 Tie_configuration
 Tie_formatting_problem::find_optimal_tie_configuration (Tie_specification const &spec) const
 {
-  Link_array<Tie_configuration> confs;
+  Link_array__Tie_configuration_ confs;
 
   int pos = spec.position_;
   Direction dir = spec.manual_dir_;
index 146499dbaa1f0e6b761dc4033b25897f29df659d..2ca32323d868d9d57eb6698199bf1653a93b3882 100644 (file)
@@ -72,7 +72,7 @@ flatten_number_pair_property (Grob *me,
 
 
 Grob *
-Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array<Grob> const &cols, bool *equally_long)
+Tuplet_bracket::parallel_beam (Grob *me_grob, Link_array__Grob_ const &cols, bool *equally_long)
 {
   Spanner *me = dynamic_cast<Spanner *> (me_grob);
 
index ef54824044733febcb283094919e03dd9106080c..2845d4c445a823063346b14438b7c0118cf5d1b8 100644 (file)
@@ -41,7 +41,7 @@ public:
 
 protected:
   std::vector<Tuplet_description> tuplets_;
-  Link_array<Spanner> last_tuplets_;
+  Link_array__Spanner_ last_tuplets_;
   DECLARE_ACKNOWLEDGER (note_column);
   virtual bool try_music (Music *r);
   virtual void finalize ();
index de78c3f835a7e2a9da837588bbd9ee9bcb13b8e6..2b2930e9b17dbf2511ff635cdc49af39fc4a127f 100644 (file)
@@ -117,9 +117,10 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
       if (before_grob || after_grob)
        {
          Grob_array *ga = unsmob_grob_array (valign_->get_object ("elements"));
-         Link_array<Grob> &arr = ga->array_reference ();
+         Link_array__Grob_ &arr = ga->array_reference ();
 
-         Grob *added = arr.pop ();
+         Grob *added = arr.back ();
+         arr.pop_back ();
          for (vsize i = 0; i < arr.size (); i++)
            {
              if (arr[i] == before_grob)