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

Method Set

Common/Core/vtkInformationVariantVectorKey.cxx:56–80  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

54
55//------------------------------------------------------------------------------
56void vtkInformationVariantVectorKey::Set(vtkInformation* info, const vtkVariant* value, int length)
57{
58 if (value)
59 {
60 if (this->RequiredLength >= 0 && length != this->RequiredLength)
61 {
62 vtkErrorWithObjectMacro(info,
63 "Cannot store vtkVariant vector of length "
64 << length << " with key " << this->Location << "::" << this->Name
65 << " which requires a vector of length " << this->RequiredLength
66 << ". Removing the key instead.");
67 this->SetAsObjectBase(info, nullptr);
68 return;
69 }
70 vtkInformationVariantVectorValue* v = new vtkInformationVariantVectorValue;
71 v->InitializeObjectBase();
72 v->Value.insert(v->Value.begin(), value, value + length);
73 this->SetAsObjectBase(info, v);
74 v->Delete();
75 }
76 else
77 {
78 this->SetAsObjectBase(info, nullptr);
79 }
80}
81
82//------------------------------------------------------------------------------
83const vtkVariant* vtkInformationVariantVectorKey::Get(vtkInformation* info) const

Callers 2

AppendMethod · 0.95
ShallowCopyMethod · 0.95

Calls 5

InitializeObjectBaseMethod · 0.80
DeleteMethod · 0.65
SetAsObjectBaseMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected