]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/object-key-dumper.hh
* flower
[lilypond.git] / lily / include / object-key-dumper.hh
1 /*
2   object-key-dumper.hh -- declare Object_key_dumper
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef OBJECT_KEY_DUMPER_HH
10 #define OBJECT_KEY_DUMPER_HH
11
12 #include <map>
13
14 #include "object-key.hh"
15
16 typedef std::map < Object_key const *, Object_key const *, Object_key_less> Key_to_key_map;
17 typedef std::map < Object_key const *, int> Pointer_to_int_map;
18 typedef std::map < int, Object_key const *> Int_to_key_map;
19
20 class Object_key_dumper
21 {
22   SCM file_contents_;
23   Key_to_key_map serialized_keys_;
24   Pointer_to_int_map key_serial_numbers_;
25   int next_available_;
26
27   SCM key_serial (int);
28   SCM serialize_key (Object_key const *);
29   DECLARE_SMOBS (Object_key_dumper,);
30 public:
31   Object_key_dumper ();
32   SCM get_file_contents () const;
33   SCM dump_key (Object_key const *);
34 };
35
36 DECLARE_UNSMOB (Object_key_dumper, key_dumper);
37
38 #endif /* OBJECT_KEY_DUMPER_HH */
39