diff --git a/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp b/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp index 4cc47a94d8c6b3239dd0e07203e9cd0749a6e75f..a77e9439299f31c9ed03f993047a88211410110a 100644 --- a/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/NaryOperationAbstraction.hpp @@ -18,8 +18,8 @@ namespace abstraction { -template < class ReturnType, size_t N > -class NaryOperationAbstractionImpl : public ValueOperationAbstraction < ReturnType > { +template < size_t N > +class NaryOperationAbstractionImpl : virtual public OperationAbstraction { ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, N > m_params; protected: @@ -91,7 +91,7 @@ public: }; template < class ReturnType, class ... ParamTypes > -class NaryOperationAbstraction : public NaryOperationAbstractionImpl < ReturnType, sizeof ... ( ParamTypes ) > { +class NaryOperationAbstraction : virtual public NaryOperationAbstractionImpl < sizeof ... ( ParamTypes ) >, virtual public ValueOperationAbstraction < ReturnType > { bool checkInput ( const std::shared_ptr < OperationAbstraction > & input, size_t index ) const override { return abstraction::checkInput < ValueProvider < ParamTypes > ... > ( input, index ); } diff --git a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp index a6d17f47f1d17a9c51c8293b89014ed5953d79a3..8e95282b802ffa5c9172cf1574fb8921848a4413 100644 --- a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp @@ -24,7 +24,7 @@ class UnspecifiedType { }; template < class ReturnType > -class ValueOperationAbstraction : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { mutable std::optional < ReturnType > m_data; protected: @@ -77,7 +77,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType > : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { mutable std::optional < ReturnType > m_data; protected: @@ -130,7 +130,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < ReturnType & > : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < ReturnType & > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { mutable std::optional < std::reference_wrapper < ReturnType > > m_data; protected: @@ -183,7 +183,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType & > : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType & > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { mutable std::optional < std::reference_wrapper < const ReturnType > > m_data; protected: @@ -236,7 +236,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < ReturnType && > : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < ReturnType && > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < ReturnType && >, public ValueProvider < const ReturnType && > { mutable std::optional < std::reference_wrapper < ReturnType > > m_data; protected: @@ -289,7 +289,7 @@ public: }; template < class ReturnType > -class ValueOperationAbstraction < const ReturnType && > : public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { +class ValueOperationAbstraction < const ReturnType && > : virtual public OperationAbstraction, public ValueProvider < ReturnType >, public ValueProvider < const ReturnType & >, public ValueProvider < const ReturnType && > { mutable std::optional < std::reference_wrapper < const ReturnType > > m_data; protected: @@ -342,7 +342,7 @@ public: }; template < > -class ValueOperationAbstraction < void > : public OperationAbstraction { +class ValueOperationAbstraction < void > : virtual public OperationAbstraction { public: template < typename ... ParamTypes, typename Callable > inline void run_helper ( Callable callback, const ext::array < std::pair < std::shared_ptr < OperationAbstraction >, bool >, sizeof ... ( ParamTypes ) > & inputs ) {