]> git.donarmstrong.com Git - lilypond.git/blob - hdr/identifier.hh
release: 0.0.27
[lilypond.git] / hdr / identifier.hh
1
2 /*
3   identifier.hh -- part of LilyPond
4
5   (c) 1996,97 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 #include "notename.hh"
15 #include "lookup.hh"
16 #include "scriptdef.hh"
17
18 #define make_id_class(Idclass, Class, accessor) \
19 struct Idclass : Identifier {\
20     virtual const char *classname() { return #Class; }\
21     Idclass(String s, Class*st):Identifier(s) { data = st; }\
22     virtual Class* accessor(bool copy) {\
23         if (copy)\
24             return new Class(* (Class*) data);\
25         else\
26             return (Class*) data;\
27     }\
28     ~Idclass() { delete accessor(false); }\
29 }\
30
31 make_id_class(Real_id, Real, real);
32 make_id_class(Script_id, Script_def, script);
33 make_id_class(Lookup_id, Lookup, lookup);
34 make_id_class(Symtables_id, Symtables, symtables);
35 make_id_class(Staff_id, Input_staff, staff);
36 make_id_class(M_chord_id, Music_general_chord, mchord);
37 make_id_class(M_voice_id, Music_voice, mvoice);
38 make_id_class(Notetab_id, Notename_tab, notename_tab);
39
40 #endif // IDENTIFIER_HH
41