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

Method AddDataStorage

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

Source from the content-addressed store, hash-verified

87}
88
89bool DataStorageService::AddDataStorage(const std::string& label, DataStorage::Pointer storage)
90{
91 if (label.empty() || storage.IsNull())
92 {
93 return false;
94 }
95
96 std::lock_guard<std::mutex> lock(m_Mutex);
97
98 // Check for duplicate label
99 if (label == DEFAULT_LABEL || this->FindStorageByLabel(label).IsValid())
100 {
101 return false;
102 }
103
104 m_Storages.emplace_back(label, storage);
105 return true;
106}
107
108std::optional<DataStorageReference> DataStorageService::CreateDataStorage(const std::string& label)
109{

Calls 4

FindStorageByLabelMethod · 0.95
emptyMethod · 0.45
IsNullMethod · 0.45
IsValidMethod · 0.45