Changeset 10470
- Timestamp:
- May 25, 2015, 12:25:29 PM (10 years ago)
- Location:
- code/branches/core7/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/network/NetworkFunction.cc
r10468 r10470 29 29 #include "NetworkFunction.h" 30 30 #include "NetworkFunctionManager.h" 31 #include "core/CoreIncludes.h"32 31 33 32 namespace orxonox … … 36 35 std::map<uint32_t, NetworkMemberFunctionBase*> NetworkMemberFunctionBase::idMap_; 37 36 38 // no suitable factory for NetworkFunctionBase (and children), so we declare it abstract39 RegisterAbstractClass(NetworkFunctionBase).inheritsFrom<Listable>();40 RegisterAbstractClass(NetworkFunctionStatic).inheritsFrom<NetworkFunctionBase>();41 RegisterAbstractClass(NetworkMemberFunctionBase).inheritsFrom<NetworkFunctionBase>();42 43 37 NetworkFunctionBase::NetworkFunctionBase(const std::string& name) 44 38 { 45 RegisterObject(NetworkFunctionBase);46 47 39 static uint32_t networkID = 0; 48 40 this->networkID_ = networkID++; … … 59 51 NetworkFunctionBase(name) 60 52 { 61 RegisterObject(NetworkFunctionStatic);62 63 53 this->functor_ = functor; 64 54 NetworkFunctionStatic::getFunctorMap()[p] = this; … … 82 72 NetworkFunctionBase(name) 83 73 { 84 RegisterObject(NetworkMemberFunctionBase);85 86 74 this->functorMap_[p] = this; 87 75 this->idMap_[ this->getNetworkID() ] = this; -
code/branches/core7/src/libraries/network/NetworkFunction.h
r10469 r10470 37 37 #include <string> 38 38 39 #include "core/object/Listable.h"40 #include "core/class/Identifier.h"41 39 #include "core/command/Functor.h" 42 40 #include "FunctionCallManager.h" … … 69 67 70 68 71 class _NetworkExport NetworkFunctionBase : virtual public Listable{69 class _NetworkExport NetworkFunctionBase { 72 70 public: 73 71 NetworkFunctionBase(const std::string& name); 74 ~NetworkFunctionBase();72 virtual ~NetworkFunctionBase(); 75 73 76 74 virtual void setNetworkID(uint32_t id) { this->networkID_ = id; } -
code/branches/core7/src/libraries/network/packet/FunctionIDs.cc
r10468 r10470 56 56 57 57 //calculate total needed size (for all strings and integers) 58 ObjectList<NetworkFunctionBase>::iterator it; 59 for(it = ObjectList<NetworkFunctionBase>::begin(); it; ++it) 58 std::map<std::string, NetworkFunctionBase*>& map = NetworkFunctionManager::getNameMap(); 59 std::map<std::string, NetworkFunctionBase*>::iterator it; 60 for (it = map.begin(); it != map.end(); ++it) 60 61 { 61 const std::string& functionname = it-> getName();62 networkID = it-> getNetworkID();62 const std::string& functionname = it->second->getName(); 63 networkID = it->second->getNetworkID(); 63 64 // now push the network id and the classname to the stack 64 65 tempQueue.push( std::pair<unsigned int, std::string>(networkID, functionname) );
Note: See TracChangeset
for help on using the changeset viewer.