Changeset 2143 for code/branches/objecthierarchy/src/network
- Timestamp:
- Nov 5, 2008, 3:43:16 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/Synchronisable.cc
r2133 r2143 251 251 * @param cb callback object that should get called, if the value of the variable changes 252 252 */ 253 void Synchronisable::registerVar (void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){253 void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){ 254 254 assert( mode==direction::toclient || mode==direction::toserver || mode==direction::serverMaster || mode==direction::clientMaster); 255 255 // create temporary synch.Var struct … … 285 285 #endif 286 286 } 287 288 void Synchronisable::unregisterVariable(void *var){ 289 std::list<synchronisableVariable *>::iterator it = syncList->begin(); 290 while(it!=syncList->end()){ 291 if( (*it)->var == var ){ 292 delete *it; 293 syncList->erase(it); 294 return; 295 } 296 else 297 it++; 298 } 299 assert(0); //if we reach this point something went wrong 300 } 301 287 302 288 303 /** -
code/branches/objecthierarchy/src/network/Synchronisable.h
r2132 r2143 42 42 43 43 #define REGISTERDATA(varname, ...) \ 44 registerVar ((void*)&varname, sizeof(varname), DATA, __VA_ARGS__)44 registerVariable((void*)&varname, sizeof(varname), DATA, __VA_ARGS__) 45 45 #define REGISTERSTRING(stringname, ...) \ 46 registerVar (&stringname, stringname.length()+1, STRING, __VA_ARGS__)46 registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__) 47 47 48 48 namespace orxonox … … 115 115 protected: 116 116 Synchronisable(BaseObject* creator); 117 void registerVar(void *var, int size, variableType t, uint8_t mode=0x1, NetworkCallbackBase *cb=0); 117 void registerVariable(void *var, int size, variableType t, uint8_t mode=0x1, NetworkCallbackBase *cb=0); 118 void unregisterVariable(void *var); 118 119 void setObjectMode(uint8_t mode); 119 120 void setObjectFrequency(unsigned int freq){ objectFrequency_ = freq; }
Note: See TracChangeset
for help on using the changeset viewer.