From fec806e6af4ad135b9f854684d1de00658148c68 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:44:31 +0000 Subject: [PATCH] lilypond-1.1.7 --- lily/include/music-iterator.hh | 50 +++++++++++++++++++++++++++---- lily/include/music-wrapper.hh | 8 ++++- lily/include/property-iterator.hh | 8 ++--- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 38dff72bd3..749baac14c 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -16,35 +16,75 @@ #include "moment.hh" #include "virtual-methods.hh" +/** Walk through music and deliver music to translation units, synced + in time. This classa provides both the implementation of the shared + code, and the public interface. + + Derived classes should only have a public constructor. + The state of an iterator would be the intersection of the particular music + construct with one point in musical time. + */ class Music_iterator { Arrayreport_to_l_arr_; void push_translator (Translator_group*); void pop_translator(); + protected: Music const * music_l_; bool first_b_; + + /** + Do the actual printing. This should be overriden in derived classes. It + is called by #print#, in the public interface + */ virtual void do_print() const; + /** + Find a bottom notation context to deliver requests to. + */ virtual Translator_group* get_req_translator_l(); - Music_iterator* get_iterator_p (Music const*) const; + + /** + Get an iterator for MUS, inheriting the translation unit from THIS. + */ + Music_iterator* get_iterator_p (Music const*mus) const; void set_translator (Translator_group*); + + /** Do the actual reporting. This should be overriden in derived + classes. It is called by #process_and_next#, the public interface + */ virtual void do_process_and_next (Moment until); - void inherit_info (Music_iterator const *parent); + public: + + /** + The translation unit that we this iterator is reporting to now. + */ Translator_group*report_to_l() const; + - - static Music_iterator* static_get_iterator_p (Music const*,Translator_group*); + /** Get an iterator matching the type of MUS, and use TRANS to find + an accompanying translation unit + */ + static Music_iterator* static_get_iterator_p (Music const* mus,Translator_group* trans); + Music_iterator(); + /// Find the next interesting point in time. virtual Moment next_moment() const; + + ///Are we finished with this piece of music? virtual bool ok() const; + virtual ~Music_iterator(); + + + ///Report all musical information that occurs between now and UNTIL void process_and_next (Moment until); /** Construct sub-iterators, and set the translator to - report to + report to. */ virtual void construct_children(); void print() const; diff --git a/lily/include/music-wrapper.hh b/lily/include/music-wrapper.hh index afb153e5ca..46008d2f5c 100644 --- a/lily/include/music-wrapper.hh +++ b/lily/include/music-wrapper.hh @@ -13,6 +13,12 @@ #include "music.hh" #include "musical-pitch.hh" +/** A Music that modifies an existing Music. This data structure + corresponds to a production that takes a single Music argument, + + Music: STUFF Music + + */ class Music_wrapper : public Music { public: @@ -23,7 +29,7 @@ public: VIRTUAL_COPY_CONS(Music); Music_wrapper (Music_wrapper const&); - virtual Moment duration () const; + virtual Moment duration () const; virtual ~Music_wrapper (); }; diff --git a/lily/include/property-iterator.hh b/lily/include/property-iterator.hh index 3dc7898c2b..b42f95c797 100644 --- a/lily/include/property-iterator.hh +++ b/lily/include/property-iterator.hh @@ -11,13 +11,13 @@ #define PROPERTY_ITERATOR_HH #include "music-iterator.hh" - +/** + Iterate a property. + */ class Property_iterator : public Music_iterator { - Translation_property *property_l() const; - public: - + // construction protected: virtual void do_process_and_next (Moment); }; -- 2.39.5