MCPcopy Create free account
hub / github.com/Kitware/VTK / Set

Method Set

Common/Core/vtkInformationUnsignedLongKey.cxx:33–57  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

31
32//------------------------------------------------------------------------------
33void vtkInformationUnsignedLongKey::Set(vtkInformation* info, unsigned long value)
34{
35 if (vtkInformationUnsignedLongValue* oldv =
36 static_cast<vtkInformationUnsignedLongValue*>(this->GetAsObjectBase(info)))
37 {
38 if (oldv->Value != value)
39 {
40 // Replace the existing value.
41 oldv->Value = value;
42 // Since this sets a value without call SetAsObjectBase(),
43 // the info has to be modified here (instead of
44 // vtkInformation::SetAsObjectBase()
45 info->Modified(this);
46 }
47 }
48 else
49 {
50 // Allocate a new value.
51 vtkInformationUnsignedLongValue* v = new vtkInformationUnsignedLongValue;
52 v->InitializeObjectBase();
53 v->Value = value;
54 this->SetAsObjectBase(info, v);
55 v->Delete();
56 }
57}
58
59//------------------------------------------------------------------------------
60unsigned long vtkInformationUnsignedLongKey::Get(vtkInformation* info)

Callers 1

ShallowCopyMethod · 0.95

Calls 5

InitializeObjectBaseMethod · 0.80
DeleteMethod · 0.65
GetAsObjectBaseMethod · 0.45
ModifiedMethod · 0.45
SetAsObjectBaseMethod · 0.45

Tested by

no test coverage detected