From 9cae28884de99db99accf8ac59b1cb3e0e85b0e3 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Thu, 7 Sep 2017 21:23:49 +0200
Subject: [PATCH] allow exact name specification for container type

---
 .../src/abstraction/ContainerRegistry.hpp       | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/alib2common/src/abstraction/ContainerRegistry.hpp b/alib2common/src/abstraction/ContainerRegistry.hpp
index 74c286a147..9a2d3b7a54 100644
--- a/alib2common/src/abstraction/ContainerRegistry.hpp
+++ b/alib2common/src/abstraction/ContainerRegistry.hpp
@@ -39,22 +39,27 @@ class ContainerRegistry {
 		static ext::map < std::string, ext::vector < ext::pair < std::string, std::shared_ptr < Entry > > > > containerGroups;
 		return containerGroups;
 	};
+
 public:
 	template < class ParamTypes >
-	static void registerSet ( ) {
+	static void registerSet ( std::string param ) {
 		std::string container = "Set";
 
-		std::string paramName = ext::to_string < typename std::decay < ParamTypes >::type > ( );
-
 		auto & group = getEntries ( ) [ container ];
 		for ( const ext::pair < std::string, std::shared_ptr < Entry > > & entry : group )
-			if ( entry.first == paramName )
+			if ( entry.first == param )
 				throw exception::CommonException ( "Callback for " + container + " already registered." );
 
 		std::shared_ptr < Entry > entryValue = std::make_shared < SetEntryImpl < ParamTypes > > ( );
-		group.push_back ( ext::make_pair ( paramName, entryValue ) );
+		group.push_back ( ext::make_pair ( param, entryValue ) );
+	}
+
+	template < class ParamTypes >
+	static void registerSet ( ) {
+		std::string param = ext::to_string < typename std::decay < ParamTypes >::type > ( );
+		registerSet < ParamTypes > ( param );
 	}
-	
+
 	static bool hasAbstraction ( const std::string & container );
 
 	static std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( const std::string & container, const std::string & paramType );
-- 
GitLab