]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/moment.hh
release: 1.3.131
[lilypond.git] / lily / include / moment.hh
1 /*   
2   moment.hh -- declare Moment
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef MOMENT_HH
11 #define MOMENT_HH
12
13 #include "smobs.hh"
14 #include "rational.hh"
15
16 /**
17    Rationals with glue for Guilification;
18
19    FIXME: remove self_scm_ and then remove this class */
20 class Moment : public Rational
21 {
22   DECLARE_SIMPLE_SMOBS(Moment,);
23 public:
24   Moment () { }
25   Moment (int m) : Rational (m) { }
26   Moment (int m, int n) : Rational (m,n) { }
27   Moment (Rational m) : Rational (m) { }
28
29   /*
30     Deliver a copy of THIS as a smobified SCM
31    */
32   SCM smobbed_copy () const; 
33 };
34
35
36 Moment * unsmob_moment (SCM);
37
38 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
39 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
40 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * );
41 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - );
42 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
43
44 INSTANTIATE_COMPARE (Moment const&, Rational::compare);
45
46
47 #endif /* MOMENT_HH */
48