lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue 4564: make Grob an abstract class (issue 260810043 by address@hidd


From: nine . fierce . ballads
Subject: Issue 4564: make Grob an abstract class (issue 260810043 by address@hidden)
Date: Sun, 16 Aug 2015 13:42:07 +0000

Reviewers: ,

Description:
... in preparation for deriving grob interface classes
(e.g. Accidental_interface) from Grob without risking unintentional
instantiation anywhere.

Please review this at https://codereview.appspot.com/260810043/

Affected files (+5, -9 lines):
  M lily/grob.cc
  M lily/include/grob.hh


Index: lily/grob.cc
diff --git a/lily/grob.cc b/lily/grob.cc
index f7bf31f2868db17937bfa33d1a64b4d35d2c9602..ab1495c8104fed10f8eca79b5f36c8de9d33d4dc 100644
--- a/lily/grob.cc
+++ b/lily/grob.cc
@@ -41,12 +41,6 @@
 #include "lily-imports.hh"


-Grob *
-Grob::clone () const
-{
-  return new Grob (*this);
-}
-
 Grob::Grob (SCM basicprops)
 {

Index: lily/include/grob.hh
diff --git a/lily/include/grob.hh b/lily/include/grob.hh
index db51e02e73cb0a0c5ec6ce1f4e91d56d5bc69bbe..f964840581aad29e88a19fee697738e430da137f 100644
--- a/lily/include/grob.hh
+++ b/lily/include/grob.hh
@@ -56,6 +56,10 @@ protected:
   */
   SCM interfaces_;

+  /* life & death */
+  Grob (SCM basic_props);
+  Grob (Grob const &);
+
   void substitute_object_links (SCM, SCM);
   Real get_offset (Axis a) const;
   SCM try_callback (SCM, SCM);
@@ -93,9 +97,7 @@ public:
   SCM interfaces () const { return interfaces_; }

   /* life & death */
-  Grob (SCM basic_props);
-  Grob (Grob const &);
-  virtual Grob *clone () const;
+  virtual Grob *clone () const = 0;

   /* forced death */
   void suicide ();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]