diff --git a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp index 1fc7115deb9b7d8b17fc9031c85b5164ed47a72d..96fdb0cc1434ed93951ec280dd99da170003f1f2 100644 --- a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp +++ b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp @@ -33,6 +33,13 @@ protected: return m_abstraction; } + void attachInputsToAbstraction ( ) { + for ( size_t index = 0; index < sizeof ... ( ParamTypes ); ++ index ) + if ( ! this->m_abstraction->attachInput ( m_params [ index ].first, index, m_params [ index ].second, true ) ) + throw std::invalid_argument ( "Can't connect param " + this->m_abstraction->getParamType ( index ) + " at " + ext::to_string ( index ) + " of wrapped algorithm with result of type " + m_params [ index ].first->getReturnType ( ) + "." ); + + } + public: BaseWrapperAbstraction ( std::function < std::shared_ptr < OperationAbstraction > ( ParamTypes ... ) > wrapperFinder ) : m_WrapperFinder ( std::move ( wrapperFinder ) ) { for ( size_t i = 0; i < sizeof ... ( ParamTypes ); ++ i ) { @@ -123,13 +130,6 @@ public: throw std::domain_error ( "Proxy abstraction not avaiable before evaluation." ); } - void attachInputsToAbstraction ( ) { - for ( size_t index = 0; index < sizeof ... ( ParamTypes ); ++ index ) - if ( ! this->m_abstraction->attachInput ( m_params [ index ].first, index, m_params [ index ].second, true ) ) - throw std::invalid_argument ( "Can't connect param " + this->m_abstraction->getParamType ( index ) + " at " + ext::to_string ( index ) + " of wrapped algorithm with result of type " + m_params [ index ].first->getReturnType ( ) + "." ); - - } - }; template < class ReturnType, class ... ParamTypes >