- Timestamp:
- Jan 22, 2010, 3:49:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network2/src/libraries/network/synchronisable/Synchronisable.h
r6450 r6455 177 177 Synchronisable(BaseObject* creator); 178 178 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false); 179 template <class T> void unregisterVariable(T& var); 179 180 180 181 void setPriority(unsigned int freq){ objectFrequency_ = freq; } … … 219 220 } 220 221 } 222 223 template <class T> void Synchronisable::unregisterVariable(T& variable){ 224 std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin(); 225 while(it!=syncList_.end()){ 226 if( ((*it)->getReference()) == &variable ){ 227 delete (*it); 228 syncList_.erase(it); 229 return; 230 } 231 else 232 it++; 233 } 234 bool unregistered_nonexistent_variable = false; 235 assert(unregistered_nonexistent_variable); //if we reach this point something went wrong: 236 // the variable has not been registered before 237 } 221 238 222 239 template <> _NetworkExport void Synchronisable::registerVariable( std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional); 240 template <> _NetworkExport void Synchronisable::unregisterVariable( std::string& variable ); 223 241 224 242
Note: See TracChangeset
for help on using the changeset viewer.