Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
NormalizeAbstraction.hpp 880 B
/*
 * NormalizeAbstraction.hpp
 *
 *  Created on: 11. 7. 2017
 *	  Author: Jan Travnicek
 */

#ifndef _NORMALIZE_ABSTRACTION_HPP_
#define _NORMALIZE_ABSTRACTION_HPP_

#include <abstraction/UnaryOperationAbstraction.hpp>

#include <factory/NormalizeFactory.hpp>

namespace abstraction {

template < class ReturnType, class ParamType >
class NormalizeAbstraction : public UnaryOperationAbstraction < ReturnType, ParamType && > {
public:
	bool run ( ) override {
		std::pair < std::shared_ptr < OperationAbstraction >, bool > & rawParam = std::get < 0 > ( this->getParams ( ) );
		ParamType && param = retrieveValue < ParamType && > ( rawParam.first, rawParam.second );
		ReturnType res = factory::NormalizeFactory::normalize ( std::move ( param ) );

		this->m_data = std::move ( res );

		return true;
	}
};

} /* namespace abstraction */

#endif /* _NORMALIZE_ABSTRACTION_HPP_ */