2 object-key.hh -- declare Object_key
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
15 Object_keys are read-only values, suitable for storing references to
16 transient objects (such as grobs or contexts) on disk.
18 In the future, they might also act as handles for external processes
19 requesting notation to be drawn.
23 DECLARE_SMOBS (Object_key
,);
27 virtual void derived_mark () const;
28 virtual int get_type () const;
29 virtual int do_compare (Object_key
const *other
) const;
30 virtual SCM
as_scheme () const;
32 static Object_key
*from_scheme (SCM
);
33 static Object_key
*undump (SCM
);
34 int compare (Object_key
const *other
) const;
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
69 bool operator () (Object_key
const *const &t1
, Object_key
const *const &t2
) const
71 return t1
->compare (t2
);
75 #endif /* OBJECT_KEY_HH */