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

Method EnsureUID

Modules/MatchPointRegistration/src/Helper/mitkUIDHelper.cpp:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include <mitkBaseData.h>
21
22mitk::NodeUIDType mitk::EnsureUID(mitk::DataNode* node)
23{
24 if (!node)
25 {
26 mitkThrow() << "Cannot ensure node UID. Passed node pointer is nullptr.";
27 }
28
29 std::string propUID = "";
30 if (!node->GetStringProperty(mitk::nodeProp_UID,propUID))
31 {
32 mitk::UIDGenerator generator;
33 propUID = generator.GetUID();
34
35 node->SetStringProperty(mitk::nodeProp_UID,propUID.c_str());
36 }
37
38 return propUID;
39};
40
41bool mitk::CheckUID(const mitk::DataNode* node, const NodeUIDType& uid)
42{

Callers

nothing calls this directly

Calls 8

IsNotNullMethod · 0.80
NewFunction · 0.50
GetStringPropertyMethod · 0.45
GetUIDMethod · 0.45
SetStringPropertyMethod · 0.45
GetPropertyMethod · 0.45
GetValueAsStringMethod · 0.45
SetPropertyMethod · 0.45

Tested by

no test coverage detected