]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.46.jcn1
authorfred <fred>
Tue, 25 Mar 1997 11:28:13 +0000 (11:28 +0000)
committerfred <fred>
Tue, 25 Mar 1997 11:28:13 +0000 (11:28 +0000)
flower/include/class-name.hh [new file with mode: 0644]

diff --git a/flower/include/class-name.hh b/flower/include/class-name.hh
new file mode 100644 (file)
index 0000000..14ebf4c
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  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; } 
+    
+#endif // CLASS-NAME_HH