- Timestamp:
- May 25, 2015, 2:41:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/network/NetworkFunction.cc
r10474 r10475 32 32 namespace orxonox 33 33 { 34 NetworkFunctionBase::NetworkFunctionBase(const std::string& name, const NetworkFunctionPointer& p )34 NetworkFunctionBase::NetworkFunctionBase(const std::string& name, const NetworkFunctionPointer& pointer) 35 35 { 36 36 static uint32_t networkID = 0; 37 37 this->networkID_ = networkID++; 38 39 38 this->name_ = name; 40 NetworkFunctionManager::getInstance().getNameMap()[name] = this; 41 NetworkFunctionManager::getInstance().getFunctorMap()[p] = this; 42 NetworkFunctionManager::getInstance().getIdMap()[this->getNetworkID()] = this; 39 this->pointer_ = pointer; 40 NetworkFunctionManager::getInstance().registerFunction(this); 43 41 } 44 42 45 43 void NetworkFunctionBase::setNetworkID(uint32_t id) 46 44 { 47 NetworkFunctionManager::getInstance(). getIdMap().erase(this->networkID_); // removeold id45 NetworkFunctionManager::getInstance().unregisterFunction(this); // unregister with old id 48 46 this->networkID_ = id; 49 NetworkFunctionManager::getInstance(). getIdMap()[this->networkID_] = this; // addnew id47 NetworkFunctionManager::getInstance().registerFunction(this); // register with new id 50 48 } 51 49 }
Note: See TracChangeset
for help on using the changeset viewer.