]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-wrapper-iterator.cc
834494c88d1db95fc19bf8fc4a3cea04aa298cc9
[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 #include "music-wrapper-iterator.hh"
11 #include "music-wrapper.hh"
12
13 Music_wrapper_iterator::Music_wrapper_iterator ()
14 {
15   child_iter_p_ =0;
16 }
17
18 Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper_iterator const &src)
19   : Music_iterator (src)
20 {
21   child_iter_p_ = src.child_iter_p_->clone ();
22 }
23
24 Music_wrapper_iterator::~Music_wrapper_iterator ()
25 {
26   delete child_iter_p_;
27 }
28
29
30 void
31 Music_wrapper_iterator::construct_children ()
32 {
33   child_iter_p_ =
34     get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element ());
35 }
36
37 bool
38 Music_wrapper_iterator::ok () const
39 {
40   return child_iter_p_ && child_iter_p_->ok ();
41 }
42
43 void
44 Music_wrapper_iterator::process (Moment m)
45 {
46   child_iter_p_->process (m);
47 }
48
49 SCM
50 Music_wrapper_iterator::get_music (Moment m)const
51 {
52   return child_iter_p_->get_music (m);
53 }
54
55 Moment
56 Music_wrapper_iterator::pending_moment () const
57 {
58   return child_iter_p_->pending_moment ();
59 }
60
61 Music_iterator*
62 Music_wrapper_iterator::try_music_in_children (Music *m) const
63 {
64   return child_iter_p_->try_music (m);
65 }