Changeset 3304 for code/trunk/src/network/synchronisable
- Timestamp:
- Jul 18, 2009, 6:23:31 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/netp6 (added) merged: 3215,3226-3227,3229-3231,3240,3242,3251-3252,3256,3258-3259,3263-3264,3267-3268,3277,3283-3284,3289,3298-3299,3302
- Property svn:mergeinfo changed
-
code/trunk/src/network/synchronisable/NetworkCallbackManager.cc
r3214 r3304 44 44 if (it != callbackSet_.end()) 45 45 { 46 delete (*it);47 46 callbackSet_.erase(it); 47 delete cb; 48 48 } 49 49 } -
code/trunk/src/network/synchronisable/Synchronisable.cc
r3280 r3304 96 96 if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer())) 97 97 deletedObjects_.push(objectID); 98 // delete all Synchronisable Variables from syncList ( which are also in stringList )99 for(std::vector<SynchronisableVariableBase*>::iterator it = syncList.begin(); it!=syncList.end(); it++)100 delete (*it);101 syncList.clear();102 stringList.clear();103 }98 } 99 // delete all Synchronisable Variables from syncList ( which are also in stringList ) 100 for(std::vector<SynchronisableVariableBase*>::iterator it = syncList.begin(); it!=syncList.end(); it++) 101 delete (*it); 102 syncList.clear(); 103 stringList.clear(); 104 104 std::map<uint32_t, Synchronisable*>::iterator it; 105 105 it = objectMap_.find(objectID); … … 247 247 return 0; 248 248 uint32_t tempsize = 0; 249 #ifndef NDEBUG 249 250 if (this->classID==0) 250 251 COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl; 252 #endif 251 253 252 254 if (this->classID == static_cast<uint32_t>(-1)) -
code/trunk/src/network/synchronisable/Synchronisable.h
r3301 r3304 43 43 #include "NetworkCallback.h" 44 44 45 /*#define REGISTERDATA(varname, ...) \46 registerVariable(static_cast<void*>(&varname), sizeof(varname), DATA, __VA_ARGS__)47 #define REGISTERSTRING(stringname, ...) \48 registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__)*/49 45 50 46 namespace orxonox -
code/trunk/src/network/synchronisable/SynchronisableSpecialisations.cc
r3214 r3304 38 38 namespace orxonox{ 39 39 40 // template <> void Synchronisable::registerVariable( const std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)41 // {42 // if (bidirectional)43 // syncList.push_back(new SynchronisableVariableBidirectional<const std::string>(variable, mode, cb));44 // else45 // syncList.push_back(new SynchronisableVariable<const std::string>(variable, mode, cb));46 // stringList.push_back(syncList.back());47 // }48 49 40 template <> void Synchronisable::registerVariable( std::string& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional) 50 41 { 42 SynchronisableVariableBase* sv; 51 43 if (bidirectional) 52 s yncList.push_back(new SynchronisableVariableBidirectional<const std::string>(variable, mode, cb));44 sv = new SynchronisableVariableBidirectional<const std::string>(variable, mode, cb); 53 45 else 54 syncList.push_back(new SynchronisableVariable<const std::string>(variable, mode, cb)); 55 stringList.push_back(syncList.back()); 46 sv = new SynchronisableVariable<const std::string>(variable, mode, cb); 47 syncList.push_back(sv); 48 stringList.push_back(sv); 56 49 } 57 50 … … 73 66 registerVariable(variable.y, mode, cb, bidirectional); 74 67 } 75 // template <> void Synchronisable::registerVariable( Vector2& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional)76 // {77 // registerVariable( (const ColourValue&)variable, mode, cb, bidirectional);78 // }79 68 80 69 template <> void Synchronisable::registerVariable( const Vector3& variable, uint8_t mode, NetworkCallbackBase* cb, bool bidirectional) -
code/trunk/src/network/synchronisable/SynchronisableVariable.h
r3301 r3304 117 117 { 118 118 if (this->callback_ != 0) 119 { 119 120 NetworkCallbackManager::deleteCallback(this->callback_); //safe call for deletion 121 // this is neccessary because for example for a Vector3 all 3 components of the vector use the same callback 122 } 120 123 } 121 124
Note: See TracChangeset
for help on using the changeset viewer.