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

Method storeMetaInfo_

src/openms/source/FORMAT/OMSFileStore.cpp:223–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223 void OMSFileStore::storeMetaInfo_(const MetaInfoInterface& info, const String& parent_table, Key parent_id)
224 {
225 if (info.isMetaEmpty()) return;
226
227 // this assumes the "..._MetaInfo" and "DataValue_DataType" tables exist already!
228 auto& query = *prepared_queries_[parent_table + "_MetaInfo"];
229 query.bind(":parent_id", parent_id);
230 // this is inefficient, but MetaInfoInterface doesn't support iteration:
231 vector<String> info_keys;
232 info.getKeys(info_keys);
233 for (const String& info_key : info_keys)
234 {
235 query.bind(":name", info_key);
236
237 const DataValue& value = info.getMetaValue(info_key);
238 if (value.isEmpty()) // use NULL as the type for empty values
239 {
240 query.bind(":data_type_id");
241 }
242 else
243 {
244 query.bind(":data_type_id", int(value.valueType()) + 1);
245 }
246 query.bind(":value", value.toString());
247 execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data");
248 }
249 }
250
251
252 void OMSFileStore::createTableAppliedProcessingStep_(const String& parent_table)

Callers

nothing calls this directly

Calls 6

isMetaEmptyMethod · 0.80
getMetaValueMethod · 0.80
getKeysMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected