MCPcopy Create free account
hub / github.com/MITK/MITK / CreateDataStorage

Method CreateDataStorage

Modules/Core/src/DataManagement/mitkDataStorageService.cpp:108–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108std::optional<DataStorageReference> DataStorageService::CreateDataStorage(const std::string& label)
109{
110 if (label.empty())
111 {
112 return std::nullopt;
113 }
114
115 std::lock_guard<std::mutex> lock(m_Mutex);
116
117 // Check for duplicate label
118 if (label == DEFAULT_LABEL || this->FindStorageByLabel(label).IsValid())
119 {
120 return std::nullopt;
121 }
122
123 auto storage = StandaloneDataStorage::New();
124 DataStorageReference dsRef(label, storage.GetPointer(), false);
125 m_Storages.push_back(dsRef);
126
127 return dsRef;
128}
129
130std::optional<DataStorageReference> DataStorageService::GetDataStorageReference(const std::string& label) const
131{

Calls 5

FindStorageByLabelMethod · 0.95
GetPointerMethod · 0.80
NewFunction · 0.50
emptyMethod · 0.45
IsValidMethod · 0.45