- Timestamp:
- Feb 28, 2009, 12:35:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem3/src/network/synchronisable/Synchronisable.cc
r2662 r2706 236 236 return NULL; 237 237 } 238 239 240 /**241 * This function is used to register a variable to be synchronized242 * also counts the total datasize needed to save the variables243 * @param var pointer to the variable244 * @param size size of the datatype the variable consists of245 * @param t the type of the variable (DATA or STRING246 * @param mode same as in getData247 * @param cb callback object that should get called, if the value of the variable changes248 */249 250 /* void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){251 assert( mode==variableDirection::toclient || mode==variableDirection::toserver || mode==variableDirection::serverMaster || mode==variableDirection::clientMaster);252 // create temporary synch.Var struct253 synchronisableVariable *temp = new synchronisableVariable;254 temp->size = size;255 temp->var = var;256 temp->mode = mode;257 temp->type = t;258 temp->callback = cb;259 if( ( mode & variableDirection::bidirectional ) )260 {261 if(t!=STRING)262 {263 temp->varBuffer = new uint8_t[size];264 memcpy(temp->varBuffer, temp->var, size); //now fill the buffer for the first time265 }266 else267 {268 temp->varBuffer=new std::string( *static_cast<std::string*>(var) );269 }270 temp->varReference = 0;271 }272 COUT(5) << "Syncronisable::registering var with size: " << temp->size << " and type: " << temp->type << std::endl;273 //std::cout << "push temp to syncList (at the bottom) " << datasize << std::endl;274 COUT(5) << "Syncronisable::objectID: " << objectID << " this: " << this << " name: " << this->getIdentifier()->getName() << " networkID: " << this->getIdentifier()->getNetworkID() << std::endl;275 syncList->push_back(temp);276 #ifndef NDEBUG277 std::list<synchronisableVariable *>::iterator it = syncList->begin();278 while(it!=syncList->end()){279 assert(*it!=var);280 it++;281 }282 #endif283 }*/284 238 285 239
Note: See TracChangeset
for help on using the changeset viewer.