2 protected-scm.cc -- implement Protected_scm
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "protected-scm.hh"
10 #include "lily-guile.hh"
13 Protected_scm::Protected_scm ()
18 Protected_scm::Protected_scm (SCM s
)
20 object_
= s
? scm_protect_object (s
): 0;
23 Protected_scm::Protected_scm (Protected_scm
const &s
)
25 object_
= s
.object_
? scm_protect_object (s
.object_
) : 0;
29 Protected_scm::operator =(SCM s
)
34 scm_unprotect_object(object_
);
36 object_
= s
? scm_protect_object (s
): 0;
41 Protected_scm::operator = (Protected_scm
const &s
)
43 return operator= (s
.object_
);
47 Protected_scm::~Protected_scm ()
51 scm_unprotect_object (object_
);
55 Protected_scm::operator SCM () const
61 Protected_scm::to_SCM () const