From fd014bdbd923cc80e585bca121da55d8611ee867 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Fri, 22 Sep 2017 22:30:46 +0200
Subject: [PATCH] organize imports in abstraction

---
 alib2common/src/abstraction/AlgorithmAbstraction.hpp       | 1 -
 alib2common/src/abstraction/AlgorithmRegistry.hpp          | 1 +
 alib2common/src/abstraction/AnyaryOperationAbstraction.hpp | 1 -
 alib2common/src/abstraction/CastAbstraction.hpp            | 1 -
 alib2common/src/abstraction/CastRegistry.hpp               | 6 +++---
 alib2common/src/abstraction/ContainerRegistry.cpp          | 1 -
 alib2common/src/abstraction/ContainerRegistry.hpp          | 1 +
 alib2common/src/abstraction/DowncastAbstraction.hpp        | 1 -
 alib2common/src/abstraction/DowncastRegistry.hpp           | 2 +-
 alib2common/src/abstraction/ImmediateValueAbstraction.hpp  | 1 -
 alib2common/src/abstraction/NormalizeAbstraction.hpp       | 1 -
 alib2common/src/abstraction/OperationAbstraction.hpp       | 5 +----
 alib2common/src/abstraction/Registry.h                     | 1 +
 alib2common/src/abstraction/SetAbstraction.hpp             | 3 ---
 alib2common/src/abstraction/ValueOperationAbstraction.hpp  | 1 -
 alib2common/src/abstraction/ValuePrinterAbstraction.hpp    | 1 -
 alib2common/src/abstraction/ValuePrinterRegistry.hpp       | 1 -
 alib2common/src/abstraction/common/CastHelper.cpp          | 1 +
 18 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/alib2common/src/abstraction/AlgorithmAbstraction.hpp b/alib2common/src/abstraction/AlgorithmAbstraction.hpp
index 08ec27b27c..0ccb2a3f71 100644
--- a/alib2common/src/abstraction/AlgorithmAbstraction.hpp
+++ b/alib2common/src/abstraction/AlgorithmAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _ALGORITHM_ABSTRACTION_HPP_
 
 #include <abstraction/NaryOperationAbstraction.hpp>
-#include <tuple>
 #include <memory>
 #include <abstraction/Registry.h>
 
diff --git a/alib2common/src/abstraction/AlgorithmRegistry.hpp b/alib2common/src/abstraction/AlgorithmRegistry.hpp
index ae0c0b63d0..d0f4b8eb53 100644
--- a/alib2common/src/abstraction/AlgorithmRegistry.hpp
+++ b/alib2common/src/abstraction/AlgorithmRegistry.hpp
@@ -14,6 +14,7 @@
 #include <string>
 #include <set>
 #include <map>
+#include <tuple>
 #include <algorithm>
 
 #include <exception/CommonException.h>
diff --git a/alib2common/src/abstraction/AnyaryOperationAbstraction.hpp b/alib2common/src/abstraction/AnyaryOperationAbstraction.hpp
index 180363e540..9ac23b85d6 100644
--- a/alib2common/src/abstraction/AnyaryOperationAbstraction.hpp
+++ b/alib2common/src/abstraction/AnyaryOperationAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _ANYARY_OPERATION_ABSTRACTION_HPP_
 
 #include <abstraction/ValueOperationAbstraction.hpp>
-#include <tuple>
 #include <memory>
 #include <abstraction/Registry.h>
 
diff --git a/alib2common/src/abstraction/CastAbstraction.hpp b/alib2common/src/abstraction/CastAbstraction.hpp
index 66388e3d5b..0f97f9aaeb 100644
--- a/alib2common/src/abstraction/CastAbstraction.hpp
+++ b/alib2common/src/abstraction/CastAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _CAST_ABSTRACTION_HPP_
 
 #include <abstraction/UnaryOperationAbstraction.hpp>
-#include <tuple>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/CastRegistry.hpp b/alib2common/src/abstraction/CastRegistry.hpp
index ab4b03720b..e53379211b 100644
--- a/alib2common/src/abstraction/CastRegistry.hpp
+++ b/alib2common/src/abstraction/CastRegistry.hpp
@@ -61,7 +61,7 @@ public:
 	template < class TargetType, class ParamType >
 	static void registerCast ( std::string target, std::string param, bool normalize ) {
 		if ( ! getEntries ( ).insert ( std::make_pair ( std::make_pair ( target, param ), std::unique_ptr < Entry > ( new DefaultEntryImpl < TargetType, ParamType > ( normalize ) ) ) ).second )
-			throw ::exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
+			throw exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
 	}
 
 	template < class TargetType, class ParamType >
@@ -75,7 +75,7 @@ public:
 	template < class TargetType, class ParamType >
 	static void registerCastAlgorithm ( std::string target, std::string param, TargetType ( * callback ) ( const ParamType & ), bool normalize ) {
 		if ( ! getEntries ( ).insert ( std::make_pair ( std::make_pair ( target, param ), std::unique_ptr < Entry > ( new AlgorithmEntryImpl < TargetType, const ParamType & > ( callback, normalize ) ) ) ).second )
-			throw ::exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
+			throw exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
 	}
 
 	template < class TargetType, class ParamType >
@@ -89,7 +89,7 @@ public:
 	template < class TargetType, class ParamType >
 	static void registerCastAlgorithm ( std::string target, std::string param, TargetType ( * callback ) ( ParamType ), bool normalize ) {
 		if ( ! getEntries ( ).insert ( std::make_pair ( std::make_pair ( target, param ), std::unique_ptr < Entry > ( new AlgorithmEntryImpl < TargetType, ParamType > ( callback, normalize ) ) ) ).second )
-			throw ::exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
+			throw exception::CommonException ( "Entry from " + param + " to " + target + " already registered." );
 	}
 
 	template < class TargetType, class ParamType >
diff --git a/alib2common/src/abstraction/ContainerRegistry.cpp b/alib2common/src/abstraction/ContainerRegistry.cpp
index e3a3793aef..d017710736 100644
--- a/alib2common/src/abstraction/ContainerRegistry.cpp
+++ b/alib2common/src/abstraction/ContainerRegistry.cpp
@@ -6,7 +6,6 @@
  */
 
 #include <abstraction/ContainerRegistry.hpp>
-#include <foreach>
 #include <algorithm>
 
 namespace abstraction {
diff --git a/alib2common/src/abstraction/ContainerRegistry.hpp b/alib2common/src/abstraction/ContainerRegistry.hpp
index 24962f7eb2..3822153c28 100644
--- a/alib2common/src/abstraction/ContainerRegistry.hpp
+++ b/alib2common/src/abstraction/ContainerRegistry.hpp
@@ -13,6 +13,7 @@
 #include <vector>
 #include <string>
 #include <set>
+#include <map>
 
 #include <exception/CommonException.h>
 #include <abstraction/OperationAbstraction.hpp>
diff --git a/alib2common/src/abstraction/DowncastAbstraction.hpp b/alib2common/src/abstraction/DowncastAbstraction.hpp
index 91b15da440..6524b3ae64 100644
--- a/alib2common/src/abstraction/DowncastAbstraction.hpp
+++ b/alib2common/src/abstraction/DowncastAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _DOWNCAST_ABSTRACTION_HPP_
 
 #include <abstraction/UnaryOperationAbstraction.hpp>
-#include <memory>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/DowncastRegistry.hpp b/alib2common/src/abstraction/DowncastRegistry.hpp
index a073e5788a..d70ab37a79 100644
--- a/alib2common/src/abstraction/DowncastRegistry.hpp
+++ b/alib2common/src/abstraction/DowncastRegistry.hpp
@@ -44,7 +44,7 @@ public:
 		std::string concrete = ext::to_string < ConcreteType > ( );
 		std::string base = ext::to_string < BaseType > ( );
 		if ( ! getEntries ( ).insert ( std::make_pair ( std::make_pair ( concrete, base ), std::unique_ptr < Entry > ( new EntryImpl < ConcreteType, BaseType > ( ) ) ) ).second )
-			throw ::exception::CommonException ( "Downcasting for " + base + " to " + concrete + " already registered." );
+			throw exception::CommonException ( "Downcasting for " + base + " to " + concrete + " already registered." );
 	}
 
 	static std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & concrete, const std::string & base );
diff --git a/alib2common/src/abstraction/ImmediateValueAbstraction.hpp b/alib2common/src/abstraction/ImmediateValueAbstraction.hpp
index 8db823793f..bdaaca0a8e 100644
--- a/alib2common/src/abstraction/ImmediateValueAbstraction.hpp
+++ b/alib2common/src/abstraction/ImmediateValueAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _IMMEDIATE_VALUE_ABSTRACTION_HPP_
 
 #include <abstraction/NullaryOperationAbstraction.hpp>
-#include <tuple>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/NormalizeAbstraction.hpp b/alib2common/src/abstraction/NormalizeAbstraction.hpp
index 5997c1938b..2baeb7b6e4 100644
--- a/alib2common/src/abstraction/NormalizeAbstraction.hpp
+++ b/alib2common/src/abstraction/NormalizeAbstraction.hpp
@@ -9,7 +9,6 @@
 #define _NORMALIZE_ABSTRACTION_HPP_
 
 #include <abstraction/UnaryOperationAbstraction.hpp>
-#include <tuple>
 
 #include <core/normalize.hpp>
 
diff --git a/alib2common/src/abstraction/OperationAbstraction.hpp b/alib2common/src/abstraction/OperationAbstraction.hpp
index d37e9f12b2..44fb7ccfa7 100644
--- a/alib2common/src/abstraction/OperationAbstraction.hpp
+++ b/alib2common/src/abstraction/OperationAbstraction.hpp
@@ -10,10 +10,7 @@
 
 #include <memory>
 #include <string>
-#include <tuple>
-#include <functional>
-
-#include <exception/CommonException.h>
+#include <typeindex>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/Registry.h b/alib2common/src/abstraction/Registry.h
index 9c7fd569c1..ae3fc81cae 100644
--- a/alib2common/src/abstraction/Registry.h
+++ b/alib2common/src/abstraction/Registry.h
@@ -13,6 +13,7 @@
 #include <abstraction/common/AlgorithmCategories.hpp>
 
 #include <pair>
+#include <tuple>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/SetAbstraction.hpp b/alib2common/src/abstraction/SetAbstraction.hpp
index cf1395b788..c25caca61e 100644
--- a/alib2common/src/abstraction/SetAbstraction.hpp
+++ b/alib2common/src/abstraction/SetAbstraction.hpp
@@ -9,10 +9,7 @@
 #define _SET_ABSTRACTION_HPP_
 
 #include <abstraction/AnyaryOperationAbstraction.hpp>
-#include <tuple>
 #include <memory>
-#include <abstraction/Registry.h>
-#include <foreach>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/ValueOperationAbstraction.hpp b/alib2common/src/abstraction/ValueOperationAbstraction.hpp
index 82a482882d..1b14620b47 100644
--- a/alib2common/src/abstraction/ValueOperationAbstraction.hpp
+++ b/alib2common/src/abstraction/ValueOperationAbstraction.hpp
@@ -13,7 +13,6 @@
 #include <memory>
 #include <typeindex>
 #include <variant>
-#include <abstraction/Registry.h>
 #include <abstraction/ValueProvider.hpp>
 
 namespace abstraction {
diff --git a/alib2common/src/abstraction/ValuePrinterAbstraction.hpp b/alib2common/src/abstraction/ValuePrinterAbstraction.hpp
index 553c98167e..c5bafe2c40 100644
--- a/alib2common/src/abstraction/ValuePrinterAbstraction.hpp
+++ b/alib2common/src/abstraction/ValuePrinterAbstraction.hpp
@@ -10,7 +10,6 @@
 
 #include <abstraction/UnaryOperationAbstraction.hpp>
 #include <abstraction/NullaryOperationAbstraction.hpp>
-#include <tuple>
 
 namespace abstraction {
 
diff --git a/alib2common/src/abstraction/ValuePrinterRegistry.hpp b/alib2common/src/abstraction/ValuePrinterRegistry.hpp
index d3851708e7..c36fd4254e 100644
--- a/alib2common/src/abstraction/ValuePrinterRegistry.hpp
+++ b/alib2common/src/abstraction/ValuePrinterRegistry.hpp
@@ -12,7 +12,6 @@
 #include <string>
 #include <map>
 
-#include <exception/CommonException.h>
 #include <abstraction/OperationAbstraction.hpp>
 
 namespace abstraction {
diff --git a/alib2common/src/abstraction/common/CastHelper.cpp b/alib2common/src/abstraction/common/CastHelper.cpp
index a7711e3561..a613d7a20a 100644
--- a/alib2common/src/abstraction/common/CastHelper.cpp
+++ b/alib2common/src/abstraction/common/CastHelper.cpp
@@ -1,5 +1,6 @@
 #include <abstraction/Registry.h>
 #include <abstraction/common/CastHelper.h>
+#include <exception/CommonException.h>
 
 namespace abstraction {
 
-- 
GitLab