]> git.donarmstrong.com Git - lilypond.git/blob - hdr/identifier.hh
release: 0.0.15
[lilypond.git] / hdr / identifier.hh
1
2 /*
3   identifier.hh -- part of LilyPond
4
5   (c) 1996 Han-Wen Nienhuys
6 */
7
8 #ifndef IDENTIFIER_HH
9 #define IDENTIFIER_HH
10 #include "identparent.hh"
11 #include "symtable.hh"
12 #include "inputstaff.hh"
13 #include "inputmusic.hh"
14
15 #define make_id_class(Idclass, Class, accessor) \
16 struct Idclass : Identifier {\
17     Idclass(String s, Class*st):Identifier(s) { data = st; }\
18     virtual Class* accessor(bool copy=false) {\
19         if (copy)\
20             return new Class(* (Class*) data);\
21         else\
22             return (Class*) data;\
23     }\
24     ~Idclass() { delete accessor(); }\
25 }\
26
27 make_id_class(Lookup_id, Lookup, lookup);
28 make_id_class(Symtables_id, Symtables, symtables);
29 make_id_class(Staff_id, Input_staff, staff);
30 make_id_class(M_chord_id, Music_general_chord, mchord);
31 make_id_class(M_voice_id, Music_voice, mvoice);
32
33 #endif // IDENTIFIER_HH
34