MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / sendSelf

Method sendSelf

DEVELOPER/core/Vertex.cpp:143–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142
143int
144Vertex::sendSelf(int commitTag, Channel &theChannel)
145{
146 // send the tag/ref/color/degree/tmp, an indication if weighted & size of adjacency
147 static ID idData(7);
148 idData(0) = this->getTag();
149 idData(1) = myRef;
150 idData(2) = myColor;
151 idData(3) = myDegree;
152 idData(4) = myTmp;
153 if (myWeight == 0.0)
154 idData(5) = 0;
155 else
156 idData(5) = 1;
157 idData(6) = myAdjacency.Size();
158
159 if (theChannel.sendID(0, commitTag, idData) < 0) {
160 opserr << "Graph::sendSelf() - failed to receive the initial data\n";
161 return -1;
162 }
163
164 // if weighted, send the weight
165 if (myWeight != 0.0) {
166 static Vector vectData(1);
167 vectData(0) = myWeight;
168 if (theChannel.sendVector(0, commitTag, vectData) < 0) {
169 opserr << "Graph::rendSelf() - failed to receive the weight\n";
170 return -2;
171 }
172 }
173
174 // finally send the adjacency
175 if (theChannel.sendID(0, commitTag, myAdjacency) < 0) {
176 opserr << "Graph::sendSelf() - failed to receive the adjacency data\n";
177 return -1;
178 }
179
180 return 0;
181}
182
183
184int

Callers

nothing calls this directly

Calls 4

getTagMethod · 0.45
SizeMethod · 0.45
sendIDMethod · 0.45
sendVectorMethod · 0.45

Tested by

no test coverage detected