MCPcopy Create free account
hub / github.com/Kitware/ParaView / Pull

Method Pull

Remoting/ServerManager/vtkSIStringVectorProperty.cxx:62–125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

60
61//---------------------------------------------------------------------------
62bool vtkSIStringVectorProperty::Pull(vtkSMMessage* message)
63{
64 if (!this->InformationOnly)
65 {
66 return this->Superclass::Pull(message);
67 }
68
69 if (!this->GetCommand())
70 {
71 // I would say that we should return false since an InformationOnly property
72 // as no meaning if no command is set, but for some legacy reason we just
73 // skip the processing if no command is provided.
74 return true;
75 }
76
77 // Invoke property's method on the root node of the server
78 vtkClientServerStream str;
79 str << vtkClientServerStream::Invoke << this->GetVTKObject() << this->GetCommand()
80 << vtkClientServerStream::End;
81
82 this->ProcessMessage(str);
83
84 // Get the result
85 const vtkClientServerStream& res = this->GetLastResult();
86
87 int numMsgs = res.GetNumberOfMessages();
88 if (numMsgs < 1)
89 {
90 return true;
91 }
92
93 const int numArgs = res.GetNumberOfArguments(0);
94 if (numArgs < 1)
95 {
96 return true;
97 }
98
99 // now add the single 'value' to the message.
100 ProxyState_Property* prop = message->AddExtension(ProxyState::property);
101 prop->set_name(this->GetXMLName());
102 Variant* var = prop->mutable_value();
103 var->set_type(Variant_Type_STRING);
104
105 for (int argIdx = 0; argIdx < numArgs; ++argIdx)
106 {
107 const char* arg = nullptr;
108 int retVal = res.GetArgument(0, argIdx, &arg);
109 if (retVal == 0)
110 {
111 // failed to parse as string.
112 return false;
113 }
114
115 if (!arg)
116 {
117 var->add_txt(std::string());
118 }
119 else

Callers

nothing calls this directly

Calls 10

GetNumberOfMessagesMethod · 0.80
GetNumberOfArgumentsMethod · 0.80
set_typeMethod · 0.80
GetArgumentMethod · 0.80
GetCommandMethod · 0.45
GetVTKObjectMethod · 0.45
ProcessMessageMethod · 0.45
AddExtensionMethod · 0.45
set_nameMethod · 0.45
mutable_valueMethod · 0.45

Tested by

no test coverage detected