2 identifier.hh -- part of GNU LilyPond
4 (c) 1996--2000 Han-Wen Nienhuys
10 #include "lily-proto.hh"
11 #include "lily-guile.hh"
14 #include "virtual-methods.hh"
18 class Translator_group_identifier;
19 class Output_def_identifier;
20 class Score_identifier;
21 class Duration_identifier;
25 #define IDACCESSOR(Class)\
26 virtual Class * access_content_ ## Class (bool) const { error (#Class + String ("_identifier")); return 0; }\
30 A declarable data structure in mudela.
32 TODO: use SMOBS for the union type, and junk all derived classes.
34 struct Identifier : public Input {
39 Identifier (Identifier const&);
40 Identifier (int code) ;
44 void error (String) const;
46 IDACCESSOR(Translator_group)
47 IDACCESSOR(Music_output_def)
50 VIRTUAL_COPY_CONS(Identifier);
52 DECLARE_SMOBS(Identifier, foo);
54 virtual void do_print () const;
55 virtual String do_str () const;
58 #define DECLARE_ID_CLASS(Class) \
59 struct Class ## _identifier : Identifier {\
62 Class ## _identifier (Class ## _identifier const&);\
63 Class ## _identifier (Class*st, int code);\
64 VIRTUAL_COPY_CONS(Identifier);\
65 virtual Class* access_content_ ## Class (bool copy_b) const;\
66 ~Class ## _identifier();\
67 virtual void do_print () const; \
68 virtual String do_str () const; \
72 DECLARE_ID_CLASS(Translator_group);
73 DECLARE_ID_CLASS(Duration);
74 DECLARE_ID_CLASS(Score);
75 DECLARE_ID_CLASS(Music_output_def);
77 Identifier * unsmob_identifier (SCM);
78 SCM smobify (Identifier*);
80 #endif // IDENTIFIER_HH