2 music-constructor.cc -- implement Music_constructor
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include <map> // UGH.
11 #include "music-constructor.hh"
12 typedef Music
* (*Music_ctor
) ();
14 static std::map
<String
,Music_ctor
> *ctors_map_
;
17 add_music_ctor (String s
, Music_ctor c
)
20 ctors_map_
= new std::map
<String
, Music_ctor
>;
27 get_music_ctor (String s
)
29 if (ctors_map_
->find (s
) == ctors_map_
->end ())
32 return (* ctors_map_
)[s
];
38 return (*get_music_ctor (s
)) () ;