/*
 * NormalizeAbstraction.hpp
 *
 *  Created on: 11. 7. 2017
 *	  Author: Jan Travnicek
 */

#ifndef _NORMALIZE_ABSTRACTION_HPP_
#define _NORMALIZE_ABSTRACTION_HPP_

#include <abstraction/NaryOperationAbstraction.hpp>
#include <abstraction/ValueOperationAbstraction.hpp>

#include <factory/NormalizeFactory.hpp>

namespace abstraction {

template < class ReturnType, class ParamType >
class NormalizeAbstraction : virtual public NaryOperationAbstraction < ParamType && >, virtual public ValueOperationAbstraction < ReturnType > {
public:
	std::shared_ptr < abstraction::Value > run ( ) override {
		std::pair < std::shared_ptr < abstraction::Value >, bool > & rawParam = std::get < 0 > ( this->getParams ( ) );
		ParamType && param = retrieveValue < ParamType && > ( rawParam.first, rawParam.second );

		return std::make_shared < abstraction::ValueHolder < ReturnType > > ( this->getProxyAbstraction ( ), factory::NormalizeFactory::normalize ( std::move ( param ) ) );
	}

};

} /* namespace abstraction */

#endif /* _NORMALIZE_ABSTRACTION_HPP_ */
