]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/class-name.hh
14ebf4c927435096e0e5265a51b1070ff0d6d48c
[lilypond.git] / lily / include / class-name.hh
1 /*
2   class-name.hh -- declare 
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef CLASS_NAME_HH
11 #define CLASS_NAME_HH
12
13 /** a macro to declare the classes name as a static and virtual function.
14   The static_name() can *not* be inlined (this might have the effect that 
15   s->name() != S::static_name(). Overlapping strings need not be merged in C++
16  */
17 #define NAME_MEMBERS(c) \
18 static char const *static_name();\
19 virtual char const *name() const{ return c::static_name(); } \
20 int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
21
22 #define IMPLEMENT_STATIC_NAME(c)\
23     char const *c::static_name() { return #c; } 
24     
25 #endif // CLASS-NAME_HH