]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/smobs.tcc
Doc-es: various updates.
[lilypond.git] / lily / include / smobs.tcc
index 940f0032ae975ee47d6f202951f55d30527df825..818c0900a56bac154476b49282eae6bf529241b8 100644 (file)
 // included from smobs.hh, but other template expansion systems might
 // make it feasible to compile this only a single time.
 
-#include "lily-guile-macros.hh"
-#include "smobs.hh"
 #include <typeinfo>
 
 template <class Super>
 SCM
 Smob_base<Super>::mark_trampoline (SCM arg)
 {
-  Super *ptr = Super::unsmob (arg);
+  Super *ptr = unsmob<Super> (arg);
   if (ptr)
     return ptr->mark_smob ();
   return SCM_UNDEFINED;
@@ -42,7 +40,7 @@ template <class Super>
 int
 Smob_base<Super>::print_trampoline (SCM arg, SCM port, scm_print_state *p)
 {
-  Super *ptr = Super::unsmob (arg);
+  Super *ptr = unsmob<Super> (arg);
   if (ptr)
     return ptr->print_smob (port, p);
   return 0;
@@ -65,7 +63,7 @@ Smob_base<Super>::register_ptr (Super *p)
 // Defaults, should not actually get called
 template <class Super>
 SCM
-Smob_base<Super>::mark_smob ()
+Smob_base<Super>::mark_smob () const
 {
   return SCM_UNSPECIFIED;
 }
@@ -88,7 +86,7 @@ Smob_base<Super>::equal_p (SCM, SCM)
 
 template <class Super>
 int
-Smob_base<Super>::print_smob (SCM p, scm_print_state *)
+Smob_base<Super>::print_smob (SCM p, scm_print_state *) const
 {
   scm_puts ("#<", p);
   scm_puts (smob_name_.c_str (), p);
@@ -115,6 +113,9 @@ Scm_init Smob_base<Super>::scm_init_ (init);
 template <class Super>
 string Smob_base<Super>::smob_name_;
 
+template <class Super>
+const char * const Smob_base<Super>::type_p_name_ = 0;
+
 template <class Super>
 void Smob_base<Super>::init ()
 {
@@ -151,11 +152,6 @@ void Smob_base<Super>::init ()
       scm_c_export (Super::type_p_name_, NULL);
     }
   ly_add_type_predicate ((void *) is_smob, smob_name_.c_str ());
-  if (Super::smob_proc_signature_ >= 0)
-    scm_set_smob_apply (smob_tag_,
-                        (scm_t_subr)Super::smob_proc,
-                        Super::smob_proc_signature_ >> 8,
-                        (Super::smob_proc_signature_ >> 4)&0xf,
-                        Super::smob_proc_signature_ & 0xf);
+  Super::smob_proc_init (smob_tag_);
 }
 #endif