Changeset 1082 for code/branches/network/src
- Timestamp:
- Apr 16, 2008, 5:14:58 PM (17 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Synchronisable.cc
r1047 r1082 27 27 datasize=0; 28 28 objectID=idCounter++; 29 syncList = new std::list<synchronisableVariable *>; 29 30 //registerAllVariables(); 30 31 } … … 49 50 datasize+=sizeof(int)+size; 50 51 //std::cout << "push temp to syncList (at the bottom) " << datasize << std::endl; 51 syncList.push_back(temp); 52 COUT(5) << "objectID: " << objectID << " this: " << this << " name: " << this->getIdentifier()->getName() << " networkID: " << this->getIdentifier()->getNetworkID() << std::endl; 53 syncList->push_back(temp); 52 54 } 53 55 … … 65 67 // int totalsize=0; 66 68 // //figure out size of data to be allocated 67 // for(i=syncList .begin(); i!=syncList.end(); i++){69 // for(i=syncList->begin(); i!=syncList->end(); i++){ 68 70 // // increase size (size of variable and size of size of variable ;) 69 71 // if(i->type == STRING) … … 81 83 // //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP 82 84 // int n=0; 83 // for(i=syncList .begin(); n<totalsize && i!=syncList.end(); i++){85 // for(i=syncList->begin(); n<totalsize && i!=syncList->end(); i++){ 84 86 // std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int)); 85 87 // n+=sizeof(int); … … 117 119 // copy to location 118 120 int n=0; 119 for(i=syncList .begin(); n<datasize && i!=syncList.end(); ++i){121 for(i=syncList->begin(); n<datasize && i!=syncList->end(); ++i){ 120 122 //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int)); 121 123 memcpy( (void *)(retVal.data+n), (const void *)&((*i)->size), sizeof(int) ); … … 143 145 unsigned char *data=vars.data; 144 146 std::list<synchronisableVariable *>::iterator i; 145 if(syncList .empty()){147 if(syncList->empty()){ 146 148 COUT(4) << "Synchronisable::updateData syncList is empty" << std::endl; 147 149 return false; 148 150 } 149 151 COUT(5) << "Synchronisable: synchronising data" << std::endl; 150 i=syncList .begin();151 COUT(5) << "element size: " << (*syncList .begin())->size << std::endl;152 i=syncList->begin(); 153 COUT(5) << "element size: " << (*syncList->begin())->size << std::endl; 152 154 COUT(5) << "*i.size" << (*i)->size << std::endl; 153 for(; i!=syncList .end(); i++){155 for(; i!=syncList->end(); i++){ 154 156 if(*(int *)data==(*i)->size || (*i)->type==STRING){ 155 157 switch((*i)->type){ … … 179 181 int tsize=0; 180 182 std::list<synchronisableVariable *>::iterator i; 181 for(i=syncList .begin(); i!=syncList.end(); i++){183 for(i=syncList->begin(); i!=syncList->end(); i++){ 182 184 switch((*i)->type){ 183 185 case DATA: -
code/branches/network/src/network/Synchronisable.h
r1047 r1082 63 63 /* bool removeObject(Iterator<Synchronisable> it);*/ 64 64 65 std::list<synchronisableVariable *> syncList;65 std::list<synchronisableVariable *> *syncList; 66 66 int datasize; 67 67 }; -
code/branches/network/src/orxonox/objects/Model.cc
r974 r1082 95 95 96 96 void Model::registerAllVariables(){ 97 WorldEntity::registerAllVariables(); 97 // WorldEntity::registerAllVariables(); 98 COUT(5) << "registering new meshsrc with size: " << meshSrc_.length()+1 << std::endl; 98 99 registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING); 99 100 }
Note: See TracChangeset
for help on using the changeset viewer.