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

Method recvSelf

DEVELOPER/core/Vertex.cpp:184–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183
184int
185Vertex::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
186{
187 // recv the tag/ref/color/degree/tmp, an indication if weighted & size of adjacency
188 static ID idData(7);
189 if (theChannel.recvID(0, commitTag, idData) < 0) {
190 opserr << "Graph::recvSelf() - failed to receive the initial data\n";
191 return -1;
192 }
193 this->setTag(idData(0));
194 myRef = idData(1);
195 myColor = idData(2);
196 myDegree = idData(3);
197 myTmp = idData(4);
198
199 // if weighted, receive the weight
200 if (idData(5) == 1) {
201 static Vector vectData(1);
202 if (theChannel.recvVector(0, commitTag, vectData) < 0) {
203 opserr << "Graph::recvSelf() - failed to receive the weight\n";
204 return -2;
205 }
206 myWeight = vectData(0);
207 }
208
209 // resize the adjacency & receive it
210 // myAdjacency[idData(6)-1] = 0;
211 int *adjacencyData;
212 adjacencyData = new int[idData[6]];
213 myAdjacency.setData(adjacencyData, idData[6], true);
214
215 if (theChannel.recvID(0, commitTag, myAdjacency) < 0) {
216 opserr << "Graph::recvSelf() - failed to receive the initial data\n";
217 return -3;
218 }
219 return 0;
220}

Callers

nothing calls this directly

Calls 4

recvIDMethod · 0.45
setTagMethod · 0.45
recvVectorMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected