Skip to content
Snippets Groups Projects
Commit fbafe2df authored by Jan Trávníček's avatar Jan Trávníček
Browse files

delete not needed ValueOperation specialisation

parent ce660561
No related branches found
No related tags found
No related merge requests found
...@@ -287,60 +287,6 @@ public: ...@@ -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 < > template < >
class ValueOperationAbstraction < void > : public OperationAbstraction { class ValueOperationAbstraction < void > : public OperationAbstraction {
public: public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment