]> git.donarmstrong.com Git - lilypond.git/blobdiff - hdr/identparent.hh
partial: 0.0.38.jcn
[lilypond.git] / hdr / identparent.hh
index d8d3cb17356463dec1bf160ac404e2d236f474ab..da7ab7012cb88ece848d2dbb1c2e64ccbf99ddbf 100644 (file)
@@ -1,7 +1,7 @@
 /*
   identparent.hh -- part of LilyPond
 
-  (c) 1996 Han-Wen Nienhuys
+  (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef IDENTPARENT_HH
 #include "proto.hh"
 #include "string.hh"
 
-struct Identifier
-{
+/* boolean argument to accesor is copy_b..*/
+#define IDACCESSOR( Input_staff, staff)\
+    virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
+
+struct Identifier {
     void *data;
     String name;
     
     Identifier(String n) : name(n) { }
     virtual ~Identifier() {}
-    virtual Input_staff * staff() { assert(false); }
-    virtual Voice_list * voices() { assert(false); }
-    virtual Horizontal_music*hmusic() { assert(false); }
-    virtual Vertical_music*vmusic() { assert(false); }
-    virtual Music_voice *mvoice() { assert(false); }
-    virtual Music_general_chord *mchord() { assert(false); }    
+    virtual const char*classname() { return "new Identifier"; }
+    void error(String);
+    IDACCESSOR(Input_staff, staff)
+    IDACCESSOR(Input_music, music)
+    IDACCESSOR(Music_voice, mvoice)
+    IDACCESSOR(Script_def, script)     
+    IDACCESSOR(Symtables, symtables)
+    IDACCESSOR(Music_general_chord, mchord)
+    IDACCESSOR(Lookup,lookup)
+    IDACCESSOR(Real,real)
+    IDACCESSOR(Notename_tab, notename_tab)
+private:
+    Identifier(Identifier const&){}
 };
 #endif // IDENTPARENT_HH