From: fred Date: Tue, 25 Mar 1997 11:28:13 +0000 (+0000) Subject: lilypond-0.0.46.jcn1 X-Git-Tag: release/1.5.59~6179 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9af74b8292392b7d2ddc81a5b9540c0c061595dc;p=lilypond.git lilypond-0.0.46.jcn1 --- diff --git a/flower/include/class-name.hh b/flower/include/class-name.hh new file mode 100644 index 0000000000..14ebf4c927 --- /dev/null +++ b/flower/include/class-name.hh @@ -0,0 +1,25 @@ +/* + class-name.hh -- declare + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#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