]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/grob-array.hh
* configure.in (--enable-std-vector): New option.
[lilypond.git] / lily / include / grob-array.hh
1 /*
2   grob-array.hh -- declare Grob_array
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef GROB_ARRAY_HH
10 #define GROB_ARRAY_HH
11
12 #include "lily-proto.hh"
13 #include "smobs.hh"
14 #include "parray.hh"
15
16 class Grob_array
17 {
18   Link_array<Grob> grobs_;
19   bool ordered_;
20
21   DECLARE_SIMPLE_SMOBS (Grob_array,);
22
23   Grob_array ();
24 public:
25   bool ordered () const { return ordered_; }
26   void set_ordered (bool b) { ordered_ = b; }
27   Item *item (vsize i);
28   Spanner *spanner (vsize i);
29   Grob *grob (vsize i) { return grobs_.elem (i); }
30   vsize size () const { return grobs_.size (); }
31   bool empty () const;
32   void clear ();
33   void add (Grob *x) { grobs_.push_back (x); }
34   void set_array (Link_array<Grob> const &src);
35   Link_array<Grob> &array_reference ();
36   Link_array<Grob> const &array () const;
37   static SCM make_array ();
38 };
39
40 DECLARE_UNSMOB (Grob_array, grob_array);
41
42 Link_array<Grob> const &ly_scm2link_array (SCM x);
43 SCM grob_list_to_grob_array (SCM lst);
44
45 #endif /* GROB_ARRAY_HH */
46