12 #include <framework/logging/Logger.h>
33 template <
class BaseMeasurementCreatorType>
34 class MeasurementCreatorFactory {
43 const std::string& creatorName = creatorWithParameterDictionary.first;
44 const std::map<std::string, std::string>& parameterDictionary = creatorWithParameterDictionary.second;
46 B2DEBUG(100,
"Creating measurement creator with name " << creatorName);
49 if (creatorPointer ==
nullptr) {
50 B2FATAL(
"Can not create a measurement creator with the name " << creatorName <<
". Creator not known to the factory.");
52 m_measurementCreators.push_back(std::move(std::shared_ptr<BaseMeasurementCreatorType>(creatorPointer)));
54 for (
const auto& parameterWithValue : parameterDictionary) {
55 const std::string& parameterName = parameterWithValue.first;
56 const std::string& parameterValue = parameterWithValue.second;
57 creatorPointer->setParameter(parameterName, parameterValue);
69 const std::vector<std::shared_ptr<BaseMeasurementCreatorType>>&
getCreators()
const
75 std::map<std::string, std::map<std::string, std::string>>&
getParameters()
81 void setParameters(
const std::map<std::string, std::map<std::string, std::string>>& creatorsWithParametersDictionary)