| 1372 | } |
| 1373 | |
| 1374 | std::string DataStorageBridge::BuildNodePath(const DataNode* node) const |
| 1375 | { |
| 1376 | // Note: caller must hold m_Mutex |
| 1377 | auto dataStorage = m_DataStorage.Lock(); |
| 1378 | if (dataStorage.IsNull()) |
| 1379 | mitkThrow() << "BuildNodePath called without a valid DataStorage."; |
| 1380 | |
| 1381 | constexpr int maxDepth = 256; |
| 1382 | |
| 1383 | std::string path = "/" + node->GetName(); |
| 1384 | |
| 1385 | auto sources = dataStorage->GetSources(node); |
| 1386 | int depth = 0; |
| 1387 | while (sources->Size() > 0 && depth < maxDepth) |
| 1388 | { |
| 1389 | auto parent = sources->ElementAt(0).GetPointer(); |
| 1390 | path = "/" + parent->GetName() + path; |
| 1391 | sources = dataStorage->GetSources(parent); |
| 1392 | ++depth; |
| 1393 | } |
| 1394 | |
| 1395 | return path; |
| 1396 | } |
| 1397 | |
| 1398 | int DataStorageBridge::GetChildrenCount(const DataNode* node) const |
| 1399 | { |
no test coverage detected