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

Method GetLabel

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

Source from the content-addressed store, hash-verified

146}
147
148std::optional<std::string> DataStorageService::GetLabel(const DataStorage* storage) const
149{
150 if (storage == nullptr)
151 {
152 return std::nullopt;
153 }
154
155 std::lock_guard<std::mutex> lock(m_Mutex);
156
157 if (m_DefaultStorage.GetStorage().GetPointer() == storage)
158 {
159 return m_DefaultStorage.GetLabel();
160 }
161
162 for (const auto& info : m_Storages)
163 {
164 if (info.GetStorage().GetPointer() == storage)
165 {
166 return info.GetLabel();
167 }
168 }
169
170 return std::nullopt;
171}
172
173std::vector<std::string> DataStorageService::GetAllLabels() const
174{

Calls 2

GetPointerMethod · 0.80
GetStorageMethod · 0.45