Changeset 4423
- Timestamp:
- 07/07/10 08:58:10 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4410 r4423 158 158 char* marshalled_dataset=NULL; 159 159 int i; 160 int flaghook; 160 161 161 162 /*recover marshalled_dataset: */ … … 172 173 /*demarshall hooks: */ 173 174 for(i=0;i<numanalyses;i++){ 174 hnodes[i]=new Hook(); 175 hnodes[i]->Demarshall(&marshalled_dataset); 175 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 176 if(flaghook){ // there is a hook so demarshall it 177 hnodes[i]=new Hook(); 178 hnodes[i]->Demarshall(&marshalled_dataset); 179 } 180 else hnodes[i]=NULL; //There is no hook so it is NULL 176 181 } 177 182 hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset); … … 225 230 char* marshalled_results=NULL; 226 231 int marshalled_results_size; 232 int flaghook; //to indicate if hook is NULL or exists 227 233 228 234 /*recover marshalled_dataset: */ … … 240 246 241 247 /*Marshall hooks: */ 242 for(i=0;i<numanalyses;i++)hnodes[i]->Marshall(&marshalled_dataset); 248 for(i=0;i<numanalyses;i++){ 249 if(hnodes[i]){ 250 /*Set flag to 1 as there is a hook */ 251 flaghook=1; 252 memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 253 hnodes[i]->Marshall(&marshalled_dataset); 254 } 255 else{ 256 /*Set flag to 0 and do not marshall flag as there is no Hook */ 257 flaghook=0; 258 memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 259 } 260 } 243 261 hmatice->Marshall(&marshalled_dataset); 244 262 hmatpar->Marshall(&marshalled_dataset); … … 271 289 int hnodes_size=0;; 272 290 273 for(i=0;i<numanalyses;i++)hnodes_size+=hnodes[i]->MarshallSize(); 291 for(i=0;i<numanalyses;i++){ 292 hnodes_size+=sizeof(int); //Flag 0 or 1 293 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize(); 294 } 274 295 275 296 return sizeof(id)
Note:
See TracChangeset
for help on using the changeset viewer.