3 identifier.hh -- part of LilyPond
5 (c) 1996,97 Han-Wen Nienhuys
10 #include "identparent.hh"
11 #include "symtable.hh"
12 #include "inputstaff.hh"
13 #include "inputmusic.hh"
14 #include "notename.hh"
16 #include "scriptdef.hh"
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) {\
24 return new Class(* (Class*) data);\
26 return (Class*) data;\
28 ~Idclass() { delete accessor(false); }\
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);
40 #endif // IDENTIFIER_HH