Take advantage of variadic templates to implement interface bookkeeping and interface casting
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
Activity
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.
LHCb validation running: https://buildlhcb.cern.ch/nightlies/index.html?slot=lhcb-gaudi-merge&build_id=4
Reassigned to @clemenci
Added 14 commits:
-
54783eb2...70dc41d9 - 12 commits from branch
gaudi:master
- 8c91511c - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi into dev-variadic-interface-base
- 138ed5f9 - alternate fix to GAUDI-1081 was already included in this branch...
-
54783eb2...70dc41d9 - 12 commits from branch
Thanks, I started a new build: https://buildlhcb.cern.ch/nightlies/index.html?slot=lhcb-gaudi-merge&build_id=6
Added 12 commits:
-
6433a2ac...d53e7505 - 11 commits from branch
gaudi:master
- 3083c397 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi into dev-variadic-interface-base
-
6433a2ac...d53e7505 - 11 commits from branch
You should have it soon as https://buildlhcb.cern.ch/nightlies/index.html?slot=lhcb-gaudi-merge&build_id=8
@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...
Added 8 commits:
-
3083c397...850d8016 - 7 commits from branch
gaudi:master
- 7c08af34 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi into dev-variadic-interface-base
-
3083c397...850d8016 - 7 commits from branch
Added 24 commits:
-
7c08af34...35dd00c0 - 23 commits from branch
gaudi:master
- 7c98e4d8 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi into dev-variadic-interface-base
-
7c08af34...35dd00c0 - 23 commits from branch
Added 6 commits:
-
7c98e4d8...c1d7111d - 5 commits from branch
gaudi:master
- 73c1da77 - Merge branch 'master' of ssh://gitlab.cern.ch:7999/gaudi/Gaudi into dev-variadic-interface-base
-
7c98e4d8...c1d7111d - 5 commits from branch
OK, done, see https://svnweb.cern.ch/trac/lhcb/changeset/195326 -- can you please start a new build on 73c1da77?
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.
Validation started with lhcb-gaudi-merge#16
Added 9 commits:
-
73c1da77...70dd6a76 - 8 commits from branch
gaudi:master
- 8717e423 - Merge remote branch 'Gaudi/master' into dev-variadic-interface-base
-
73c1da77...70dd6a76 - 8 commits from branch
Validation started with lhcb-gaudi-merge#17
mentioned in commit 328c078a
mentioned in commit 4a18175b
Mentioned in commit 775353a4