Skip to content
Snippets Groups Projects

Take advantage of variadic templates to implement interface bookkeeping and interface casting

Merged Gerhard Raven requested to merge graven/Gaudi:dev-variadic-interface-base into master

This patch updates the implementation of the interface bookkeeping and casting from the current macros + boost mpl code to use variadic templates.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
195 185 template <typename I, typename... Is> struct iid_cast_t<I,Is...> {
196 186 template <typename P>
197 187 inline void* operator()(const InterfaceID& tid, P* ptr) const {
188 // can we inject a (very!) strict compile-time match prior to falling back to runtime?
  • To answer my own question: No, we cannot, as we're not comparing InterfaceId<...> to InterfaceId<...> but InterfaceID to InterfaceId<...> and the conversion between those is a one way street, namely InterfaceId<...> -> InterfaceID.

    What could be done (which is a variation on what is currently there) is to add some type-erasure, and require an interface to check for matches, but that will always involve runtime polymorphism. So I don't think this can ever be implemented at compile time.

  • Gerhard Raven Title changed from Dev variadic interface base to Use variadic templates to interface bookkeeping and interface casting

    Title changed from Dev variadic interface base to Use variadic templates to interface bookkeeping and interface casting

  • Gerhard Raven Title changed from Use variadic templates to interface bookkeeping and interface casting to Take advantage of variadic templates to implement interface bookkeeping and interface casting

    Title changed from Use variadic templates to interface bookkeeping and interface casting to Take advantage of variadic templates to implement interface bookkeeping and interface casting

  • Gerhard Raven Title changed from Take advantage of variadic templates to implement interface bookkeeping and interface casting to [WIP] Take advantage of variadic templates to implement interface bookkeeping and interface casting

    Title changed from Take advantage of variadic templates to implement interface bookkeeping and interface casting to [WIP] Take advantage of variadic templates to implement interface bookkeeping and interface casting

  • Gerhard Raven Title changed from [WIP] Take advantage of variadic templates to implement interface bookkeeping and interface casting to Take advantage of variadic templates to implement interface bookkeeping and interface casting

    Title changed from [WIP] Take advantage of variadic templates to implement interface bookkeeping and interface casting to Take advantage of variadic templates to implement interface bookkeeping and interface casting

  • Reassigned to @clemenci

  • The build fails in several places, possibly because of f6ed9be3.

  • Gerhard Raven Added 14 commits:

    Added 14 commits:

  • Author Developer

    I have an alternative for f6ed9be3, namely 76739f8d which is (was) already part of this branch (but not in the modernize one -- sorry). I've merged the master branch into this branch, reverted f6ed9be3, and it compiles, and the Gaudi tests all pass

  • Gerhard Raven Added 3 commits:

    Added 3 commits:

    • e36e6a01 - 1 commit from branch gaudi:master
    • 31cd7962 - Merge branch 'master', remote branch 'origin' into dev-variadic-interface-base
    • 6433a2ac - restore Gaudi::Cast
  • Author Developer

    With 6433a2ac included, it compiles cleanly with x86_64-slc6-gcc48-dbg as well...

  • Gerhard Raven Added 12 commits:

    Added 12 commits:

  • Author Developer

    @clemenci could you please start a new build based on 3083c397?

  • Author Developer

    @clemenci the LHCb test fail because there is a request to add the following to a dictionary:

      <class name =        "implements1<IIncidentListener>" />
      <class name = "extend_interfaces1<IIncidentListener>" />

    I'm not sure I understand why this is done: I can imagine why IIncidentLister would be added, I can imagine why some actual implementation would be added, but not why the above mixin would be included... so is there any reason to not just delete those two lines?

    as an aside: it is a bit strange that cling does a SEGV when it encounters this...

  • Gerhard Raven Added 8 commits:

    Added 8 commits:

  • Gerhard Raven Added 24 commits:

    Added 24 commits:

  • Gerhard Raven Added 6 commits:

    Added 6 commits:

  • Sorry for the late reply. These dictionaries were needed at the time of ROOT 5 for interactivity (see GAUDI-1098). Moreover, when I added those lines, implements1 and extend_interfaces1 were mandatory, but with some later update (if I'm not mistaken) they became unnecessary.

    Just remove them.

  • Author Developer

    OK, done, see https://svnweb.cern.ch/trac/lhcb/changeset/195326 -- can you please start a new build on 73c1da77?

  • Author Developer

    I've removed a few items from dictionaries in Phys, see https://svnweb.cern.ch/trac/lhcb/changeset/195356 and https://svnweb.cern.ch/trac/lhcb/changeset/195355 which should fix the Phys build.

  • Gerhard Raven Added 9 commits:

    Added 9 commits:

    • 73c1da77...70dd6a76 - 8 commits from branch gaudi:master
    • 8717e423 - Merge remote branch 'Gaudi/master' into dev-variadic-interface-base
  • Marco Clemencic Status changed to merged

    Status changed to merged

  • Marco Clemencic mentioned in commit 328c078a

    mentioned in commit 328c078a

  • Marco Clemencic mentioned in commit 4a18175b

    mentioned in commit 4a18175b

  • Marco Clemencic Mentioned in commit 775353a4

    Mentioned in commit 775353a4

  • Please register or sign in to reply
    Loading