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

Function BroadcastString

IO/PIO/PIOAdaptor.cxx:62–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void BroadcastString(vtkMultiProcessController* controller, std::string& str, int rank)
63{
64 unsigned long len = static_cast<unsigned long>(str.size()) + 1;
65 controller->Broadcast(&len, 1, 0);
66 if (len)
67 {
68 if (rank)
69 {
70 std::vector<char> tmp;
71 tmp.resize(len);
72 controller->Broadcast(tmp.data(), len, 0);
73 str = tmp.data();
74 }
75 else
76 {
77 const char* start = str.c_str();
78 std::vector<char> tmp(start, start + len);
79 controller->Broadcast(tmp.data(), len, 0);
80 }
81 }
82}
83
84void BroadcastStringVector(
85 vtkMultiProcessController* controller, std::vector<std::string>& svec, int rank)

Callers 7

BroadcastStringVectorFunction · 0.70
create_geometryMethod · 0.70
CollapseFullPathMethod · 0.50
FindProgramPathMethod · 0.50
GetProgramPathMethod · 0.50
TestPSystemToolsFunction · 0.50

Calls 5

sizeMethod · 0.45
BroadcastMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
c_strMethod · 0.45

Tested by 1

TestPSystemToolsFunction · 0.40