From a05cff43382f7603da914e0aeaf0d38b73bb111d Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Tue, 5 Sep 2017 11:59:11 +0200
Subject: [PATCH] improvements in abstraction

---
 alib2common/src/abstraction/CastRegistry.cpp             | 2 ++
 alib2common/src/abstraction/CastRegistry.hpp             | 2 --
 alib2common/src/abstraction/NaryOperationAbstraction.hpp | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/alib2common/src/abstraction/CastRegistry.cpp b/alib2common/src/abstraction/CastRegistry.cpp
index 251ff90e4b..4ba258e807 100644
--- a/alib2common/src/abstraction/CastRegistry.cpp
+++ b/alib2common/src/abstraction/CastRegistry.cpp
@@ -7,6 +7,8 @@
 
 #include <abstraction/CastRegistry.hpp>
 
+#include <core/namingApi.hpp>
+
 namespace abstraction {
 
 std::shared_ptr < abstraction::OperationAbstraction > CastRegistry::getAbstraction ( const std::string & target, const std::string & param, bool & normalize ) {
diff --git a/alib2common/src/abstraction/CastRegistry.hpp b/alib2common/src/abstraction/CastRegistry.hpp
index 09651e1208..b685188769 100644
--- a/alib2common/src/abstraction/CastRegistry.hpp
+++ b/alib2common/src/abstraction/CastRegistry.hpp
@@ -15,8 +15,6 @@
 #include <exception/CommonException.h>
 #include <abstraction/OperationAbstraction.hpp>
 
-#include <core/namingApi.hpp>
-
 namespace abstraction {
 
 class CastRegistry {
diff --git a/alib2common/src/abstraction/NaryOperationAbstraction.hpp b/alib2common/src/abstraction/NaryOperationAbstraction.hpp
index 49bcce1964..f82fba2932 100644
--- a/alib2common/src/abstraction/NaryOperationAbstraction.hpp
+++ b/alib2common/src/abstraction/NaryOperationAbstraction.hpp
@@ -26,14 +26,13 @@ private:
 		if ( index >= m_moves.size ( ) )
 			throw exception::CommonException ( "Parameter index out of bounds.");
 
-		m_moves [ index ] = move;
-
 		auto attachCallback = [ & ] ( auto & param ) {
 			if ( param != nullptr )
 				return false;
 
 			typename std::decay < decltype ( param )>::type validData = std::dynamic_pointer_cast < typename std::decay < decltype ( param ) >::type::element_type > ( input );
 			if ( validData ) {
+				m_moves [ index ] = move;
 				param = validData;
 				return true;
 			} else {
-- 
GitLab