-// A callback wrapper creates a Scheme-callable version of a
-// non-static class member function callback which you can call with a
-// class instance and an event.
-//
-// If you have a class member function
-// void T::my_listen (SCM ev)
-// then Callback_wrapper::make_smob<&T::my_listen> ()
-// will return an SCM function roughly defined as
-// (lambda (target ev) (target->my_listen ev))
-//
-// The setup is slightly tricky since the make_smob quasi-constructor
-// call is a template function templated on the given callback, and so
-// is the trampoline it uses for redirecting the callback. The class
-// itself, however, is not templated as that would create a wagonload
-// of SCM types.
-
-class Callback_wrapper : public Simple_smob<Callback_wrapper>
-{
- // We use an ordinary function pointer pointing to a trampoline
- // function (templated on the callback in question) instead of
- // storing a member function pointer to a common base class like
- // Smob_core. The additional code for the trampolines is negligible
- // and the performance implications of using member function
- // pointers in connection with inheritance are somewhat opaque as
- // this involves an adjustment of the this pointer from Smob_core to
- // the scope containing the callback.
- void (*trampoline_) (SCM, SCM);