]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.65
authorfred <fred>
Sun, 18 May 1997 21:25:34 +0000 (21:25 +0000)
committerfred <fred>
Sun, 18 May 1997 21:25:34 +0000 (21:25 +0000)
flower/include/virtual-methods.hh [new file with mode: 0644]

diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh
new file mode 100644 (file)
index 0000000..e5c807e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  class-name.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CLASS_NAME_HH
+#define CLASS_NAME_HH
+
+/** a macro to declare the classes name as a static and virtual function.
+  The static_name() can *not* be inlined (this might have the effect that 
+  s->name() != S::static_name(). Overlapping strings need not be merged in C++
+ */
+#define NAME_MEMBERS(c)        \
+static char const *static_name();\
+virtual char const *name() const{ return c::static_name(); } \
+int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
+
+#define IMPLEMENT_STATIC_NAME(c)\
+    char const *c::static_name() { return #c; } 
+
+#define VIRTUAL_COPY_CONS(T, R)\
+  virtual R *clone() const { return  new T(*this); } \
+
+    
+#endif // CLASS-NAME_HH