From: fred Date: Sun, 18 May 1997 21:25:34 +0000 (+0000) Subject: lilypond-0.0.65 X-Git-Tag: release/1.5.59~6136 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=378d15930d75f58ed7b1d6865bbe46ac1552172c;p=lilypond.git lilypond-0.0.65 --- diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh new file mode 100644 index 0000000000..e5c807e8a9 --- /dev/null +++ b/flower/include/virtual-methods.hh @@ -0,0 +1,29 @@ +/* + 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; } + +#define VIRTUAL_COPY_CONS(T, R)\ + virtual R *clone() const { return new T(*this); } \ + + +#endif // CLASS-NAME_HH