diff --git a/alib2common/src/abstraction/ValueOperationAbstraction.hpp b/alib2common/src/abstraction/ValueOperationAbstraction.hpp index b25e55e2ca4b20c5c7740487fb09de4a6cdf4881..b01990da898dd4cc0184a3296ed9f3a5dde566fd 100644 --- a/alib2common/src/abstraction/ValueOperationAbstraction.hpp +++ b/alib2common/src/abstraction/ValueOperationAbstraction.hpp @@ -287,60 +287,6 @@ public: } }; -template < class ReturnType > -class ValueOperationAbstraction < ReturnType * > : public OperationAbstraction, public ValueProvider < ReturnType & >, public ValueProvider < const ReturnType & > { -protected: - virtual ReturnType & getData ( ) const override { - return * m_data; - } - - virtual const ReturnType & getConstData ( ) const override { - return * m_data; - } - - std::unique_ptr < ReturnType > m_data; - -public: - template < typename Callable, typename Object, typename ... Ts, size_t ... Indexes > - inline void member_run_helper ( Callable callback, const ext::tuple < Object, Ts ... > & inputs, const std::array < bool, 1 + sizeof ... ( Indexes ) > moves, std::index_sequence < Indexes ... > ) { - /* make unused parameter warning go away in case of sizeof ... ( Ts ) == 0 */ - ( void ) inputs; - ( void ) moves; - - if ( ! isReady ( ) ) - m_data = std::unique_ptr < ReturnType > ( callback ( & std::get < 0 > ( inputs )->getValue ( false ), std::get < Indexes + 1 > ( inputs )->getValue ( std::get < Indexes + 1 > ( moves ) ) ... ) ); - } - - template < typename Callable, typename ... Ts, size_t ... Indexes > - inline void run_helper ( Callable callback, const ext::tuple < Ts ... > & inputs, const std::array < bool, sizeof ... ( Indexes ) > moves, std::index_sequence < Indexes ... > ) { - /* make unused parameter warning go away in case of sizeof ... ( Ts ) == 0 */ - ( void ) inputs; - ( void ) moves; - - if ( ! isReady ( ) ) - m_data = std::unique_ptr < ReturnType > ( callback ( std::get < Indexes > ( inputs )->getValue ( std::get < Indexes > ( moves ) ) ... ) ); - } - - virtual bool isReady ( ) const override { - return m_data != nullptr; - } - - virtual ext::type_index getReturnTypeIndex ( ) const override { - return ext::type_index ( typeid ( ReturnType ) ); - } - - virtual ext::type_index getRuntimeReturnTypeIndex ( ) const override { - if ( isReady ( ) ) - return ext::type_index ( typeid ( getData ( ) ) ); - else - throw exception::CommonException ( "Runtime type unknown before evaluation." ); - } - - virtual bool cached ( ) const override { - return isReady ( ); - } -}; - template < > class ValueOperationAbstraction < void > : public OperationAbstraction { public: