Changeset 6123 for code/branches/presentation2/src/libraries/network
- Timestamp:
- Nov 23, 2009, 8:19:58 PM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries/network/synchronisable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/network/synchronisable/CMakeLists.txt
r5781 r6123 10 10 NetworkCallbackManager.h 11 11 Synchronisable.h 12 SynchronisablePointer.h 12 13 SynchronisableVariable.h 13 14 ) -
code/branches/presentation2/src/libraries/network/synchronisable/Synchronisable.h
r5929 r6123 138 138 Synchronisable(BaseObject* creator); 139 139 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false); 140 //template <class T> void unregisterVariable(T& var);141 140 void setPriority(unsigned int freq){ objectFrequency_ = freq; } 142 141 … … 187 186 if (bidirectional) 188 187 { 189 syncList.push_back(new SynchronisableVariableBidirectional< constT>(variable, mode, cb));188 syncList.push_back(new SynchronisableVariableBidirectional<T>(variable, mode, cb)); 190 189 this->dataSize_ += syncList.back()->getSize(state_); 191 190 } 192 191 else 193 192 { 194 syncList.push_back(new SynchronisableVariable< constT>(variable, mode, cb));193 syncList.push_back(new SynchronisableVariable<T>(variable, mode, cb)); 195 194 if ( this->state_ == mode ) 196 195 this->dataSize_ += syncList.back()->getSize(state_); 197 196 } 198 197 } 199 200 201 202 // template <class T> void Synchronisable::unregisterVariable(T& var){203 // std::vector<SynchronisableVariableBase*>::iterator it = syncList.begin();204 // while(it!=syncList.end()){205 // if( ((*it)->getReference()) == &var ){206 // delete (*it);207 // syncList.erase(it);208 // return;209 // }210 // else211 // it++;212 // }213 // bool unregistered_nonexistent_variable = false;214 // assert(unregistered_nonexistent_variable); //if we reach this point something went wrong:215 // // the variable has not been registered before216 // }217 198 218 199 -
code/branches/presentation2/src/libraries/network/synchronisable/SynchronisableVariable.h
r5781 r6123 35 35 #include <cassert> 36 36 #include <cstring> 37 #include " util/Serialise.h"37 #include "Serialise.h" 38 38 #include "util/TypeTraits.h" 39 39 #include "core/GameMode.h" … … 143 143 if ( this->callback_ != 0 ) 144 144 { 145 if( forceCallback || !checkEquality( this->variable_, mem ) ) 146 callback = true; 145 callback = forceCallback || !checkEquality( this->variable_, mem ); 147 146 } 148 147 // write the data
Note: See TracChangeset
for help on using the changeset viewer.