]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/interpretation-context-handle.cc
2002-08-08 Rune Zedeler <rune@zedeler.dk>
[lilypond.git] / lily / interpretation-context-handle.cc
index ca1071ae0f11a2540c2854954fbfa8c9c2f53f52..3c1e38153ae250b76b472a20570f25e5b3d97a50 100644 (file)
@@ -3,71 +3,79 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
+  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  */
 
 #include "interpretation-context-handle.hh"
 #include "translator-group.hh"
 
+Interpretation_context_handle::Interpretation_context_handle ()
+{
+  report_to_ =0;
+}
+
+Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const&s)
+{
+  report_to_ =0;
+  if (s.report_to_)
+    up (s.report_to_);
+}
+
+Interpretation_context_handle*
+Interpretation_context_handle::clone () const
+{
+  Interpretation_context_handle* handle = new Interpretation_context_handle;
+  handle->report_to_ = this->report_to_;
+  return handle;
+}
+
+Interpretation_context_handle::~Interpretation_context_handle ()
+{
+  if (report_to_)
+    down ();
+}
+
 void
 Interpretation_context_handle::up (Translator_group*t)
 {
-  report_to_l_ = t;
+  report_to_ = t;
   t->iterator_count_ ++;
 }
 
 void
-Interpretation_context_handle::down()
+Interpretation_context_handle::down ()
 {
-  report_to_l_->iterator_count_ --;
-  report_to_l_ = 0;
+  report_to_->iterator_count_ --;
+  report_to_ = 0;
 }
 
 bool
 Interpretation_context_handle::try_music (Music *m)
 {
-  return  report_to_l_->try_music (m);
-}
-
-Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const&s)
-{
-  report_to_l_ =0;
-  if (s.report_to_l_)
-    up (s.report_to_l_ );
+  return  report_to_->try_music (m);
 }
 
 void
 Interpretation_context_handle::operator = (Interpretation_context_handle const &s)
 {
-  set_translator (s.report_to_l_);
+  set_translator (s.report_to_);
 }
 
 void
 Interpretation_context_handle::set_translator (Translator_group*trans)
 {
-  if (report_to_l_ ==trans)
+  if (report_to_ ==trans)
     return;
-  if (report_to_l_)
+  if (report_to_)
     down ();
   if (trans)
     up (trans);
 }
 
 Translator_group*
-Interpretation_context_handle::report_to_l ()const
+Interpretation_context_handle::report_to ()const
 {
-  return report_to_l_;
+  return report_to_;
 }
 
-Interpretation_context_handle::Interpretation_context_handle()
-{
-  report_to_l_ =0;
-}
-
-Interpretation_context_handle::~Interpretation_context_handle ()
-{
-  if (report_to_l_)
-    down ();
-}