Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(772)

Unified Diff: lily/include/translator.hh

Issue 301980043: Reorganize listener/acknowledger initialization (Closed)
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lily/include/slur-proto-engraver.hh ('k') | lily/include/translator.icc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lily/include/translator.hh
diff --git a/lily/include/translator.hh b/lily/include/translator.hh
index dd0659bf50866ec4a9e03e86565deffc0299f7dd..cd050917123c2e52599c4c042ef23156fee0ddb0 100644
--- a/lily/include/translator.hh
+++ b/lily/include/translator.hh
@@ -38,11 +38,24 @@
/* end #define */
#define TRANSLATOR_INHERIT(BASE) \
- using BASE::method_finder
+ using BASE::method_finder; \
+ using BASE::ack_finder;
#define DECLARE_TRANSLATOR_CALLBACKS(NAME) \
template <void (NAME::*mf)()> \
- static SCM method_finder () { return method_find_base<NAME, mf> (); } \
+ static SCM method_finder () \
+ { \
+ return Callback0_wrapper::make_smob<NAME, mf> (); \
+ } \
+ template <void (NAME::*mf)(Stream_event *)> \
+ static SCM method_finder () \
+ { \
+ return Callback_wrapper::make_smob<trampoline<NAME, mf> > (); \
+ } \
+ template <void (NAME::*callback)(Grob_info)> \
+ static SCM ack_finder () { \
+ return Callback2_wrapper::make_smob<ack_trampoline <NAME, callback> > (); \
+ } \
/* end #define */
/*
@@ -146,16 +159,20 @@ protected: // should be private.
return SCM_UNSPECIFIED;
}
- template <class T, void (T::*mf)()>
- static SCM
- method_find_base () { return Callback0_wrapper::make_smob<T, mf> (); }
-
// Fallback for non-overriden callbacks for which &T::x degrades to
// &Translator::x
template <void (Translator::*)()>
static SCM
method_finder () { return SCM_UNDEFINED; }
+ // Overriden in Engraver. Don't instantiate.
+ template <class T, void (T::*)(Grob_info)>
+ static SCM ack_trampoline (SCM, SCM, SCM);
+
+ // Overriden in Engraver. Don't instantiate.
+ template <void (Translator::*)(Grob_info)>
+ static SCM ack_finder ();
+
virtual void derived_mark () const;
static SCM event_class_symbol (const char *ev_class);
SCM static_translator_description (const char *grobs,
« no previous file with comments | « lily/include/slur-proto-engraver.hh ('k') | lily/include/translator.icc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b