Changeset 10624 for code/trunk/src/libraries/network/packet
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/network/packet/FunctionCalls.cc
r8351 r10624 82 82 } 83 83 84 void FunctionCalls::addCall Static( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType*mt5)84 void FunctionCalls::addCall( uint32_t networkID, uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) 85 85 { 86 86 assert(!isDataENetAllocated()); 87 87 88 88 this->functionCalls_.push(orxonox::FunctionCall()); 89 this->functionCalls_.back().setCallStatic( networkID, mt1, mt2, mt3, mt4, mt5 ); 90 this->currentSize_ += this->functionCalls_.back().getSize(); 91 } 92 93 void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5) 94 { 95 assert(!isDataENetAllocated()); 96 97 this->functionCalls_.push(orxonox::FunctionCall()); 98 this->functionCalls_.back().setCallMember( networkID, objectID, mt1, mt2, mt3, mt4, mt5 ); 89 this->functionCalls_.back().setCall( networkID, objectID, mt1, mt2, mt3, mt4, mt5 ); 99 90 this->currentSize_ += this->functionCalls_.back().getSize(); 100 91 } -
code/trunk/src/libraries/network/packet/FunctionCalls.h
r7801 r10624 56 56 virtual bool process(orxonox::Host* host); 57 57 58 void addCallStatic( uint32_t networkID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0); 59 void addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0); 58 void addCall( uint32_t networkID, uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5); 60 59 virtual bool send(orxonox::Host* host); 61 60 private: -
code/trunk/src/libraries/network/packet/FunctionIDs.cc
r9667 r10624 37 37 #include "core/object/ObjectList.h" 38 38 #include "network/NetworkFunction.h" 39 #include "network/NetworkFunctionManager.h" 39 40 40 41 namespace orxonox { … … 55 56 56 57 //calculate total needed size (for all strings and integers) 57 ObjectList<NetworkFunctionBase>::iterator it; 58 for(it = ObjectList<NetworkFunctionBase>::begin(); it; ++it) 58 const std::set<NetworkFunctionBase*>& set = NetworkFunctionManager::getInstance().getAllFunctions(); 59 std::set<NetworkFunctionBase*>::const_iterator it; 60 for (it = set.begin(); it != set.end(); ++it) 59 61 { 60 const std::string& functionname = it->getName();61 networkID = it->getNetworkID();62 const std::string& functionname = (*it)->getName(); 63 networkID = (*it)->getNetworkID(); 62 64 // now push the network id and the classname to the stack 63 65 tempQueue.push( std::pair<unsigned int, std::string>(networkID, functionname) ); … … 126 128 unsigned char *functionname; 127 129 130 //clear the map of network ids 131 NetworkFunctionManager::getInstance().clearNetworkIDs(); 132 128 133 orxout(verbose, context::packets) << "=== processing functionids: " << endl; 129 134 std::pair<uint32_t, std::string> tempPair; … … 138 143 functionname = temp+2*sizeof(uint32_t); 139 144 orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl; 140 NetworkFunction Base::setNetworkID((const char*)functionname,networkID);145 NetworkFunctionManager::getInstance().getFunctionByName((const char*)functionname)->setNetworkID(networkID); 141 146 temp += 2*sizeof(uint32_t) + stringsize; 142 147 }
Note: See TracChangeset
for help on using the changeset viewer.