diff --git a/Modules/include/ConfigReader.h b/Modules/include/ConfigReader.h index cd566e7cbfe11b9ca9a91bcdd02e378dd99bca1e..05018a3db29f7c6e2d4149c86f7d7eff2a784feb 100644 --- a/Modules/include/ConfigReader.h +++ b/Modules/include/ConfigReader.h @@ -2,6 +2,7 @@ #define CHIMERATK_APPLICATION_CORE_CONFIG_READER_H #include <map> +#include<unordered_map> #include <ChimeraTK/SupportedUserTypes.h> @@ -99,7 +100,7 @@ namespace ChimeraTK { /** Define type for map of std::string to Var, so we can put it into the * TemplateUserTypeMap */ template<typename T> - using MapOfVar = std::map<std::string, Var<T>>; + using MapOfVar = std::unordered_map<std::string, Var<T>>; /** Type-depending map of vectors of variables */ ChimeraTK::TemplateUserTypeMap<MapOfVar> variableMap; @@ -107,7 +108,7 @@ namespace ChimeraTK { /** Define type for map of std::string to Array, so we can put it into the * TemplateUserTypeMap */ template<typename T> - using MapOfArray = std::map<std::string, Array<T>>; + using MapOfArray = std::unordered_map<std::string, Array<T>>; /** Type-depending map of vectors of arrays */ ChimeraTK::TemplateUserTypeMap<MapOfArray> arrayMap; diff --git a/Modules/src/ConfigReader.cc b/Modules/src/ConfigReader.cc index 82c00cea940ed6e37a96538bd8ed91efb55a0c9b..6773dacccfb96d49f57f89b4ff59d576fed5964e 100644 --- a/Modules/src/ConfigReader.cc +++ b/Modules/src/ConfigReader.cc @@ -150,7 +150,7 @@ struct FunctorFill { auto varOwner = _moduleList->lookup(moduleName); // place the variable onto the vector - std::map<std::string, ConfigReader::Var<T>>& theMap = boost::fusion::at_key<T>(variableMap.table); + std::unordered_map<std::string, ConfigReader::Var<T>>& theMap = boost::fusion::at_key<T>(variableMap.table); theMap.emplace(std::make_pair(name, ConfigReader::Var<T>(varOwner, varName, convertedValue))); } @@ -164,7 +164,7 @@ struct FunctorFill { auto varOwner = _moduleList->lookup(moduleName); // place the variable onto the vector - std::map<std::string, ConfigReader::Var<std::string>>& theMap = boost::fusion::at_key<std::string>(variableMap.table); + std::unordered_map<std::string, ConfigReader::Var<std::string>>& theMap = boost::fusion::at_key<std::string>(variableMap.table); theMap.emplace(std::make_pair(name, ConfigReader::Var<std::string>(varOwner, varName, value))); } @@ -208,7 +208,7 @@ struct FunctorFill { auto arrayOwner = _moduleList->lookup(moduleName); // place the variable onto the vector - std::map<std::string, ConfigReader::Array<T>>& theMap = boost::fusion::at_key<T>(arrayMap.table); + std::unordered_map<std::string, ConfigReader::Array<T>>& theMap = boost::fusion::at_key<T>(arrayMap.table); theMap.emplace(std::make_pair( name, ConfigReader::Array<T>(arrayOwner, arrayName, Tvalues))); } @@ -238,7 +238,7 @@ struct FunctorFill { auto arrayOwner = _moduleList->lookup(moduleName); // place the variable onto the vector - std::map<std::string, ConfigReader::Array<std::string>>& theMap = boost::fusion::at_key<std::string>(arrayMap.table); + std::unordered_map<std::string, ConfigReader::Array<std::string>>& theMap = boost::fusion::at_key<std::string>(arrayMap.table); theMap.emplace(std::make_pair( name, ConfigReader::Array<std::string>(arrayOwner, arrayName, Tvalues))); } @@ -301,7 +301,7 @@ struct FunctorFill { void operator()(PAIR&) const { // get user type and vector typedef typename PAIR::first_type T; - std::map<std::string, ConfigReader::Var<T>>& theMap = boost::fusion::at_key<T>(_owner->variableMap.table); + std::unordered_map<std::string, ConfigReader::Var<T>>& theMap = boost::fusion::at_key<T>(_owner->variableMap.table); // iterate vector and set values for(auto& pair : theMap) { @@ -324,7 +324,7 @@ struct FunctorFill { void operator()(PAIR&) const { // get user type and vector typedef typename PAIR::first_type T; - std::map<std::string, ConfigReader::Array<T>>& theMap = boost::fusion::at_key<T>(_owner->arrayMap.table); + std::unordered_map<std::string, ConfigReader::Array<T>>& theMap = boost::fusion::at_key<T>(_owner->arrayMap.table); // iterate vector and set values for(auto& pair : theMap) {