Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2008, 12:55:35 PM (16 years ago)
Author:
dumenim
Message:

changed some comments and catched some return values and maybe some stuff we have to unchange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Synchronisable.cc

    r871 r1008  
    4444    // increase datasize
    4545    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;
    4747    syncList.push_back(temp);
    4848  }
     
    104104  */
    105105  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;
    107108    syncData retVal;
    108109    retVal.objectID=this->objectID;
     
    113114    int n=0;
    114115    for(i=syncList.begin(); n<datasize && i!=syncList.end(); ++i){
    115       //COUT(2) << "size of variable: " << i->size << std::endl;
    116116      //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
    117117      memcpy( (void *)(retVal.data+n), (const void*)&(i->size), sizeof(int) );
     
    166166  int Synchronisable::getSize(){
    167167    int tsize=0;
    168     std::list<synchronisableVariable>::iterator i;
     168    std::list<SYNCVAR>::iterator i;
    169169    for(i=syncList.begin(); i!=syncList.end(); i++){
    170170      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;
    179179      }
    180180    }
Note: See TracChangeset for help on using the changeset viewer.