From f05b3f56c05caeeeaf1cf073ed4350dce17f3441 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 23 Dec 2017 18:55:26 +0100 Subject: [PATCH] Library/IterSource: allow for mix-in extension of the IterSource interface ...at least when using a wrapped Lumiera Iterator as source. Generally speaking, this is a tricky problem, since real mix-in interfaces would require the base interface (IterSource) to be declared virtual. Which incurres a performance penalty on each and every user of IterSource, even without any mix-in additions. The tricky part with this is to quantify the relevance of such a performance penalty, since IterSource is meant to be a generic library facility and is a fundamental building block on several component interfaces within the architecture. --- src/lib/iter-source.hpp | 7 +++---- tests/library/iter-tree-explorer-test.cpp | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/iter-source.hpp b/src/lib/iter-source.hpp index 5a4caec07..810a50553 100644 --- a/src/lib/iter-source.hpp +++ b/src/lib/iter-source.hpp @@ -229,13 +229,12 @@ namespace lib { * is passed to one of the IterSource's builder functions, thereby * erasing the specific type information of the template parameter IT */ - template + template> class WrappedLumieraIter - : public IterSource + : public ISO , boost::noncopyable { - using _Base = IterSource; - using Pos = typename _Base::Pos; + using Pos = typename ISO::Pos; IT src_; diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index d30cab277..30dd26ffa 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -856,15 +856,15 @@ namespace test{ verify_IterSource() { class PrivateSource -// : public IterSource /////////////////////////////////////TODO linearised Mix-in problem + : public IterSource { public: virtual PrivateSource* expandChildren() const =0; }; class VerySpecivicIter - : public WrappedLumieraIter - , public PrivateSource + : public WrappedLumieraIter { public: VerySpecivicIter(uint start)