]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
patch::: 1.3.86.jcn1
[lilypond.git] / lily / music-wrapper-iterator.cc
1 /*   
2   music-wrapper-iterator.cc --  implement Music_wrapper_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10
11 #include "music-wrapper-iterator.hh"
12 #include "music-wrapper.hh"
13
14 Music_wrapper_iterator::Music_wrapper_iterator ()
15 {
16   child_iter_p_ =0;
17 }
18
19 Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper_iterator const &src)
20   : Music_iterator (src)
21 {
22   child_iter_p_ = src.child_iter_p_->clone ();
23 }
24
25 Music_wrapper_iterator::~Music_wrapper_iterator ()
26 {
27   delete child_iter_p_;
28 }
29
30 void
31 Music_wrapper_iterator::do_print () const
32 {
33   child_iter_p_->print ();
34 }
35
36 void
37 Music_wrapper_iterator::construct_children ()
38 {
39   child_iter_p_ =
40     get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element ());
41 }
42
43 bool
44 Music_wrapper_iterator::ok () const
45 {
46   return child_iter_p_ && child_iter_p_->ok ();
47 }
48
49 void
50 Music_wrapper_iterator::do_process_and_next (Moment m)
51 {
52   child_iter_p_->process_and_next (m);
53   Music_iterator::do_process_and_next (m);
54 }
55
56 Music*
57 Music_wrapper_iterator::get_music ()
58 {
59   return child_iter_p_->get_music ();
60 }
61
62 bool
63 Music_wrapper_iterator::next ()
64 {
65   return child_iter_p_->next ();
66 }
67
68 Moment
69 Music_wrapper_iterator::next_moment () const
70 {
71   return child_iter_p_->next_moment ();
72 }
73
74
75 Music_iterator*
76 Music_wrapper_iterator::try_music_in_children (Music *m) const
77 {
78   return child_iter_p_->try_music (m);
79 }