- Timestamp:
- Oct 29, 2008, 5:19:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/Synchronisable.cc
r2041 r2062 147 147 synchronisableHeader *header = (synchronisableHeader *)mem; 148 148 149 if(!header->dataAvailable) 150 { 151 mem += header->size; 152 return 0; 153 } 154 149 155 COUT(4) << "fabricating object with id: " << header->objectID << std::endl; 150 156 … … 314 320 } 315 321 // if the variable gets synchronised bidirectional, then add the reference to the bytestream 316 if( ( (*i)->mode & direction::bidirectional ) )322 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 317 323 { 318 324 *(uint8_t*)mem = (*i)->varReference; 319 325 mem += sizeof( (*i)->varReference ); 326 tempsize += sizeof( (*i)->varReference ); 320 327 } 321 328 switch((*i)->type){ … … 323 330 memcpy( (void *)(mem), (void*)((*i)->var), (*i)->size); 324 331 mem+=(*i)->size; 325 tempsize+=(*i)->size + sizeof( (*i)->varReference );332 tempsize+=(*i)->size; 326 333 break; 327 334 case STRING: … … 332 339 COUT(5) << "synchronisable: char: " << (const char *)(mem) << " data: " << data << " string: " << *(std::string *)((*i)->var) << std::endl; 333 340 mem+=(*i)->size; 334 tempsize+=(*i)->size + sizeof( (*i)->varReference ) + sizeof(size_t);341 tempsize+=(*i)->size + sizeof(size_t); 335 342 break; 336 343 } … … 381 388 switch((*i)->type){ 382 389 case DATA: 383 if( ( (*i)->mode & direction::bidirectional ) )390 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 384 391 { 385 392 if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \ … … 406 413 break; 407 414 case STRING: 408 if( ( (*i)->mode & direction::bidirectional ) )415 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 409 416 { 410 417 if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \ … … 469 476 break; 470 477 } 471 if( ( (*i)->mode & direction::bidirectional ) != 0)478 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 472 479 { 473 480 tsize+=sizeof( (*i)->varReference );
Note: See TracChangeset
for help on using the changeset viewer.