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

Issue 551780043: Obviate method_finder methods

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years ago by dak
Modified:
4 years ago
Reviewers:
Dan Eble, lemzwerg, hahnjo
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Obviate method_finder methods The inheritance of various Translator::method_finder functions was a comparatively fragile mess. A helper class mfp_baseclass is able to figure out the proper baseclass for a given member function pointer. That allows removing the method_finder functions from the various Translator-derived classes.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Polish and extend tools in callback.hh #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -61 lines) Patch
M lily/auto-beam-engraver.cc View 1 chunk +0 lines, -1 line 0 comments Download
M lily/beam-engraver.cc View 1 chunk +0 lines, -1 line 0 comments Download
M lily/context.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M lily/include/callback.hh View 1 1 chunk +50 lines, -0 lines 0 comments Download
M lily/include/coherent-ligature-engraver.hh View 1 chunk +0 lines, -2 lines 0 comments Download
M lily/include/engraver.hh View 1 chunk +0 lines, -1 line 0 comments Download
M lily/include/gregorian-ligature-engraver.hh View 1 chunk +0 lines, -2 lines 0 comments Download
M lily/include/ligature-engraver.hh View 1 chunk +0 lines, -1 line 0 comments Download
M lily/include/translator.hh View 1 chunk +0 lines, -28 lines 0 comments Download
M lily/include/translator.icc View 4 chunks +7 lines, -7 lines 0 comments Download
M lily/kievan-ligature-engraver.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M lily/mensural-ligature-engraver.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M lily/phrasing-slur-engraver.cc View 1 chunk +0 lines, -1 line 0 comments Download
M lily/repeat-tie-engraver.cc View 1 chunk +0 lines, -1 line 0 comments Download
M lily/score-engraver.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/score-performer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/translator-group.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/vaticana-ligature-engraver.cc View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 12
lemzwerg
Nice! I don't really understand the C++ wizardry, but having to type less macros in ...
4 years ago (2020-04-19 05:53:34 UTC) #1
dak
On 2020/04/19 05:53:34, lemzwerg wrote: > Nice! I don't really understand the C++ wizardry, but ...
4 years ago (2020-04-19 07:56:36 UTC) #2
hahnjo
A huge THANK YOU for this cleanup and getting rid of my 'TRANSLATOR_INHERIT' workaround. One ...
4 years ago (2020-04-19 09:22:44 UTC) #3
dak
https://codereview.appspot.com/551780043/diff/573720045/lily/include/callback.hh File lily/include/callback.hh (right): https://codereview.appspot.com/551780043/diff/573720045/lily/include/callback.hh#newcode166 lily/include/callback.hh:166: typedef typename remove_pointer<decltype(strip_mfp (static_cast<T> (nullptr)))>::type type; On 2020/04/19 09:22:44, ...
4 years ago (2020-04-19 09:39:00 UTC) #4
hahnjo
On 2020/04/19 09:39:00, dak wrote: > https://codereview.appspot.com/551780043/diff/573720045/lily/include/callback.hh > File lily/include/callback.hh (right): > > https://codereview.appspot.com/551780043/diff/573720045/lily/include/callback.hh#newcode166 > ...
4 years ago (2020-04-19 09:55:03 UTC) #5
dak
On 2020/04/19 09:55:03, hahnjo wrote: > On 2020/04/19 09:39:00, dak wrote: > > > https://codereview.appspot.com/551780043/diff/573720045/lily/include/callback.hh ...
4 years ago (2020-04-19 10:55:52 UTC) #6
hahnjo
On 2020/04/19 10:55:52, dak wrote: > On 2020/04/19 09:55:03, hahnjo wrote: > > On 2020/04/19 ...
4 years ago (2020-04-19 11:03:35 UTC) #7
dak
On 2020/04/19 11:03:35, hahnjo wrote: > On 2020/04/19 10:55:52, dak wrote: > I have the ...
4 years ago (2020-04-19 12:24:32 UTC) #8
dak
Polish and extend tools in callback.hh
4 years ago (2020-04-20 19:36:39 UTC) #9
Dan Eble
On 2020/04/20 19:36:39, dak wrote: > Polish and extend tools in callback.hh LGTM. I have ...
4 years ago (2020-04-20 23:26:07 UTC) #10
dak
On 2020/04/20 23:26:07, Dan Eble wrote: > On 2020/04/20 19:36:39, dak wrote: > > Polish ...
4 years ago (2020-04-21 00:43:02 UTC) #11
dak
4 years ago (2020-04-21 00:56:30 UTC) #12
On 2020/04/21 00:43:02, dak wrote:
> On 2020/04/20 23:26:07, Dan Eble wrote:
> > On 2020/04/20 19:36:39, dak wrote:
> > > Polish and extend tools in callback.hh
> > 
> > LGTM.
> > 
> > I have a hunch that the MFPn_WRAP macros could be turned into something more
> > typical of C++, but I don't blame you for resting at this point.
> 
> Not without a lot of effort since MFP1_WRAP and MFP2_WRAP rely on "trampoline"
> in the current lexical scope doing something sensible.  They are unclean
macros.
>  So one would have to overhaul the whole trampoline concept to collect all
> trampolines in one scope (either :: or Callback?::) and scatter
specialisations
> over the files that want them.  A lot of work for what does not really look
like
> a whole lot of gain.

Also if you were thinking of turning MFP0_WRAP into a _function_ taking a
pointer to member function argument, that will not work since the whole
trampoline creation concept relies on the particular pointer to member being a
template argument and thus fixed.  There is a separate trampoline generated for
each member function.
Sign in to reply to this message.

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