2 object-key.hh -- declare Object_key
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
16 Object_keys are read-only values, suitable for storing references to
17 transient objects (such as grobs or contexts) on disk.
19 In the future, they might also act as handles for external processes
20 requesting notation to be drawn.
24 DECLARE_SMOBS(Object_key, );
28 virtual void derived_mark () const;
29 virtual int get_type () const;
30 virtual int do_compare (Object_key const * other) const;
31 virtual SCM as_scheme () const;
33 static Object_key *from_scheme (SCM);
34 static Object_key *undump (SCM);
35 int compare (Object_key const *other) const;
39 enum Object_key_type {
48 class Copied_key : public Object_key
52 Object_key const * original_;
56 virtual void derived_mark () const;
57 virtual int get_type () const;
58 virtual int do_compare (Object_key const * other) const;
59 virtual SCM as_scheme () const;
61 static Object_key *from_scheme (SCM);
62 Copied_key (Object_key const*, int);
65 DECLARE_UNSMOB(Object_key, key);
67 struct Object_key_less {
68 bool operator () (Object_key const *const &t1, Object_key const *const &t2) const
70 return t1->compare (t2);
75 #endif /* OBJECT_KEY_HH */