- Timestamp:
- Mar 23, 2009, 10:28:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp/src/network/synchronisable/Synchronisable.cc
r2773 r2822 66 66 objectID=OBJECTID_UNKNOWN; 67 67 classID = static_cast<uint32_t>(-1); 68 68 69 // set dataSize to 0 70 this->dataSize_ = 0; 69 71 // set standard priority 70 72 this->setPriority( priority::normal ); … … 251 253 assert(this->classID==this->getIdentifier()->getNetworkID()); 252 254 std::list<SynchronisableVariableBase*>::iterator i; 253 uint32_t size;254 size=getSize(id, mode);255 255 256 256 // start copy header 257 257 SynchronisableHeader header(mem); 258 header.setDataSize( size ); 258 mem += SynchronisableHeader::getSize(); 259 // end copy header 260 261 262 COUT(5) << "Synchronisable getting data from objectID: " << objectID << " classID: " << classID << std::endl; 263 // copy to location 264 for(i=syncList.begin(); i!=syncList.end(); ++i){ 265 tempsize += (*i)->getData( mem, mode ); 266 //tempsize += (*i)->getSize( mode ); 267 } 268 269 tempsize += SynchronisableHeader::getSize(); 259 270 header.setObjectID( this->objectID ); 260 271 header.setCreatorID( this->creatorID ); 261 272 header.setClassID( this->classID ); 262 273 header.setDataAvailable( true ); 263 tempsize += SynchronisableHeader::getSize(); 264 mem += SynchronisableHeader::getSize(); 265 // end copy header 266 267 268 COUT(5) << "Synchronisable getting data from objectID: " << objectID << " classID: " << classID << " length: " << size << std::endl; 269 // copy to location 270 for(i=syncList.begin(); i!=syncList.end(); ++i){ 271 (*i)->getData( mem, mode ); 272 tempsize += (*i)->getSize( mode ); 273 } 274 header.setDataSize( tempsize ); 275 276 #ifndef NDEBUG 277 uint32_t size; 278 size=getSize(id, mode); 274 279 assert(tempsize==size); 280 #endif 275 281 return true; 276 282 } … … 325 331 uint32_t Synchronisable::getSize(int32_t id, uint8_t mode){ 326 332 int tsize=SynchronisableHeader::getSize(); 327 if (mode==0x0)333 if (mode==0x0) 328 334 mode=state_; 329 if (!doSync(id, mode))335 if (!doSync(id, mode)) 330 336 return 0; 337 assert( mode==state_ ); 338 tsize += this->dataSize_; 331 339 std::list<SynchronisableVariableBase*>::iterator i; 332 for(i=s yncList.begin(); i!=syncList.end(); i++){340 for(i=stringList.begin(); i!=stringList.end(); ++i){ 333 341 tsize += (*i)->getSize( mode ); 334 342 }
Note: See TracChangeset
for help on using the changeset viewer.