MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / checkDefaults

Method checkDefaults

src/openms/source/DATASTRUCTURES/Param.cpp:1043–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041 }
1042
1043 void Param::checkDefaults(const std::string& name, const Param& defaults, const std::string& prefix) const
1044 {
1045 //Extract right parameters
1046 std::string prefix2 = prefix;
1047 if (!prefix2.empty())
1048 {
1049 if (prefix2.back() != ':')
1050 {
1051 prefix2 += ':';
1052 }
1053 }
1054 Param check_values = copy(prefix2, true);
1055
1056 //check
1057 for (ParamIterator it = check_values.begin(); it != check_values.end(); ++it)
1058 {
1059 //unknown parameter
1060 if (!defaults.exists(it.getName()))
1061 {
1062 OPENMS_LOG_WARN << "Warning: " << name << " received the unknown parameter '" << it.getName() << "'";
1063 if (!prefix2.empty())
1064 {
1065 OPENMS_LOG_WARN << " in '" << prefix2 << "'";
1066 }
1067 OPENMS_LOG_WARN << "!" << std::endl;
1068 }
1069
1070 //different types
1071 ParamEntry* default_value = defaults.root_.findEntryRecursive(prefix2 + it.getName());
1072 if (default_value == nullptr)
1073 {
1074 continue;
1075 }
1076 if (default_value->value.valueType() != it->value.valueType())
1077 {
1078 std::string d_type;
1079 if (default_value->value.valueType() == ParamValue::STRING_VALUE)
1080 {
1081 d_type = "string";
1082 }
1083 if (default_value->value.valueType() == ParamValue::STRING_LIST)
1084 {
1085 d_type = "string list";
1086 }
1087 if (default_value->value.valueType() == ParamValue::EMPTY_VALUE)
1088 {
1089 d_type = "empty";
1090 }
1091 if (default_value->value.valueType() == ParamValue::INT_VALUE)
1092 {
1093 d_type = "integer";
1094 }
1095 if (default_value->value.valueType() == ParamValue::INT_LIST)
1096 {
1097 d_type = "integer list";
1098 }
1099 if (default_value->value.valueType() == ParamValue::DOUBLE_VALUE)
1100 {

Callers 2

setParametersMethod · 0.80
Param_test.cppFile · 0.80

Calls 8

backMethod · 0.80
findEntryRecursiveMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
existsMethod · 0.45
getNameMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected