Changeset 4421
- Timestamp:
- 07/07/10 08:34:02 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk/src/c/objects/Elements/Tria.cpp ¶
r4420 r4421 145 145 char* marshalled_dataset=NULL; 146 146 int i; 147 int flaghook; 147 148 148 149 /*recover marshalled_dataset: */ … … 159 160 /*demarshall hooks: */ 160 161 for(i=0;i<numanalyses;i++){ 161 hnodes[i]=new Hook(); 162 hnodes[i]->Demarshall(&marshalled_dataset); 162 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 163 if(flaghook){ // there is a hook so demarshall it 164 hnodes[i]=new Hook(); 165 hnodes[i]->Demarshall(&marshalled_dataset); 166 } 167 else hnodes[i]=NULL; //There is no hook so it is NULL 163 168 } 164 169 hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset); … … 231 236 char* marshalled_results=NULL; 232 237 int marshalled_results_size; 238 int flaghook; //to indicate if hook is NULL or exists 233 239 234 240 /*recover marshalled_dataset: */ … … 246 252 memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses); 247 253 248 /*Marshall hooks: */ 249 for(i=0;i<numanalyses;i++)hnodes[i]->Marshall(&marshalled_dataset); 254 /*Marshall hooks: */ 255 for(i=0;i<numanalyses;i++){ 256 if(hnodes[i]){ 257 /*Set flag to 1 as there is a hook */ 258 flaghook=1; 259 memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 260 hnodes[i]->Marshall(&marshalled_dataset); 261 } 262 else{ 263 /*Set flag to 0 and do not marshall flag as there is no Hook */ 264 flaghook=0; 265 memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook); 266 } 267 } 250 268 hmatice->Marshall(&marshalled_dataset); 251 269 hmatpar->Marshall(&marshalled_dataset); … … 278 296 int hnodes_size=0;; 279 297 280 for(i=0;i<numanalyses;i++)hnodes_size+=hnodes[i]->MarshallSize(); 298 for(i=0;i<numanalyses;i++){ 299 hnodes_size+=sizeof(int); //Flag 0 or 1 300 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize(); 301 } 281 302 282 303 return sizeof(id)
Note:
See TracChangeset
for help on using the changeset viewer.