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

Method BuildNodePath

Modules/RESTAPI/src/mitkDataStorageBridge.cpp:1374–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

BuildNodePredicateMethod · 0.95
GetNodesMethod · 0.95
NodeToJsonMethod · 0.95

Calls 6

GetSourcesMethod · 0.80
GetPointerMethod · 0.80
LockMethod · 0.45
IsNullMethod · 0.45
GetNameMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected