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

Method AreSameClasses

Modules/SceneSerialization/test/mitkBaseDataCompare.cpp:45–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45bool mitk::BaseDataCompare::AreSameClasses(const BaseData *left, const BaseData *right, bool verbose)
46{
47 if (left == nullptr && right == nullptr)
48 return true;
49
50 if (left == nullptr && right != nullptr)
51 {
52 if (verbose)
53 MITK_WARN << "Left data is nullptr, right data is not (type " << right->GetNameOfClass() << ")";
54 return false;
55 }
56
57 if (left != nullptr && right == nullptr)
58 {
59 if (verbose)
60 MITK_WARN << "Right data is nullptr, left data is not (type " << left->GetNameOfClass() << ")";
61 return false;
62 }
63
64 // two real BaseData objects, need to really compare
65 if (left->GetNameOfClass() != right->GetNameOfClass())
66 {
67 if (verbose)
68 MITK_WARN << "Mismatch: Left data is '" << left->GetNameOfClass() << "', "
69 << "right data is '" << right->GetNameOfClass() << "'";
70 return false;
71 }
72
73 return true;
74}
75
76void mitk::BaseDataCompare::RegisterCoreEquals()
77{

Callers

nothing calls this directly

Calls 1

GetNameOfClassMethod · 0.45

Tested by

no test coverage detected