Add convenience functions to convert between ECbmModuleId and std::string
This (minor) MR adds functions to convert the ECbmModuleId enum type to and from std::string. It can be used to configure ECbmModuleId-type variables from text files that are not Root macro files.
Merge request reports
Activity
assigned to @v.friese
mentioned in merge request !772 (merged)
requested review from @v.friese
- Resolved by Jan de Cuveland
What is the motivation to use std::unordered_map instead of std::map? Is this because the enum class ECbmModuleId does not provide a comparison operator?
We have now, in CbmDefs, coded the list of modules/detectors thrice, once in the enum class and twice in your maps. Not very nice, and error-prone for potential future extensions. In addition, we have, for ECbmModuleId, the ++ and << operators defined as global functions. This suggests to me that the introduction of a class cbm::defs::ModuleId with static methods would be a better choice. In this context, we could also think of a better way of separating active detectors from passive modules, which is done now by the artificial element kNofSystems. Also, we should think of uniting with the respective enum in flesnet.
In short, thinking of a better design. This should not block this MR, which is fine for me, but be on our agenda in some way.
Edited by Volker Friese- Resolved by Jan de Cuveland
the compilation error on macosx 10.15 is obviously due to a defect in the standard, and was fixed in C++14.
Probably for most of the compilers the problem was also fixed for C++11, unfortunately not for the clang version used in macosx 10.15.
There are now several solutions for the problem.
- Don't use C++11 any longer.
- Remove macosx 10.15 from the CI.
- Use std::map instead of std::unordered_map.
added 8 commits
-
30b7d8ac...8fcb9dfc - 5 commits from branch
computing:master
- 727c8575 - Add convenience functions to convert between ECbmModuleId and std::string
- 1c324d14 - Use more cbmroot-style function names
- aa5566a3 - Use array instead of unordered_map for ECbmModuleId/string conversion
Toggle commit list-
30b7d8ac...8fcb9dfc - 5 commits from branch
Dear @f.uhlig, @v.friese, @p.-a.loizeau,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label