2 lilypond-key.cc -- implement Lilypond_{grob,context}_key
4 source file of the GNU LilyPond music typesetter
6 (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "object-key.hh"
12 #include "lilypond-key.hh"
14 Lilypond_grob_key::Lilypond_grob_key (Object_key const *context,
17 // int ambiguity_count,
20 creation_moment_ = start;
22 // ambiguity_count_ = ambiguity_count;
26 Lilypond_grob_key::derived_mark () const
28 scm_gc_mark (context_->self_scm ());
32 Lilypond_grob_key::do_compare (Object_key const* key) const
34 Lilypond_grob_key const * other = dynamic_cast<Lilypond_grob_key const*> (key);
37 c = context_->compare (other->context_);
41 c = Moment::compare (creation_moment_, other->creation_moment_);
45 c = String::compare (grob_name_, other->grob_name_);
49 c = sign (ambiguity_count_ - other->ambiguity_count_);
59 Lilypond_grob_key::get_type () const
64 /****************************************************************/
68 Lilypond_context_key::derived_mark () const
71 scm_gc_mark (parent_context_->self_scm ());
74 Lilypond_context_key::Lilypond_context_key (Object_key const *parent,
81 parent_context_ = parent;
82 start_moment_ = start;
89 Lilypond_context_key::do_compare (Object_key const *key) const
91 Lilypond_context_key const * other
92 = dynamic_cast<Lilypond_context_key const*> (key);
97 c = parent_context_->compare (other->parent_context_);
102 c = Moment::compare (start_moment_, other->start_moment_);
106 c = String::compare (context_name_, other->context_name_);
110 c = String::compare (id_, other->id_);
115 c = sign (ambiguity_count_ - other->ambiguity_count_);
124 Lilypond_context_key::get_type () const