Changeset 1008 for code/branches/network/src/network/Synchronisable.cc
- Timestamp:
- Apr 10, 2008, 12:55:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Synchronisable.cc
r871 r1008 44 44 // increase datasize 45 45 datasize+=sizeof(int)+size; 46 // push temp to syncList (at the bottom)46 //std::cout << "push temp to syncList (at the bottom) " << datasize << std::endl; 47 47 syncList.push_back(temp); 48 48 } … … 104 104 */ 105 105 syncData Synchronisable::getData(unsigned char *mem){ 106 std::list<synchronisableVariable>::iterator i; 106 //std::cout << "inside getData" << std::endl; 107 std::list<SYNCVAR>::iterator i; 107 108 syncData retVal; 108 109 retVal.objectID=this->objectID; … … 113 114 int n=0; 114 115 for(i=syncList.begin(); n<datasize && i!=syncList.end(); ++i){ 115 //COUT(2) << "size of variable: " << i->size << std::endl;116 116 //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int)); 117 117 memcpy( (void *)(retVal.data+n), (const void*)&(i->size), sizeof(int) ); … … 166 166 int Synchronisable::getSize(){ 167 167 int tsize=0; 168 std::list< synchronisableVariable>::iterator i;168 std::list<SYNCVAR>::iterator i; 169 169 for(i=syncList.begin(); i!=syncList.end(); i++){ 170 170 switch(i->type){ 171 case DATA:172 tsize+=sizeof(int);173 tsize+=i->size;174 break;175 case STRING:176 tsize+=sizeof(int);177 tsize+=((std::string *)i->var)->length()+1;178 break;171 case DATA: 172 tsize+=sizeof(int); 173 tsize+=i->size; 174 break; 175 case STRING: 176 tsize+=sizeof(int); 177 tsize+=((std::string *)i->var)->length()+1; 178 break; 179 179 } 180 180 }
Note: See TracChangeset
for help on using the changeset viewer.