Changeset 10469 for code/branches/core7
- Timestamp:
- May 25, 2015, 12:16:43 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.h
r10468 r10469 98 98 virtual void setNetworkID( uint32_t id ) 99 99 { NetworkFunctionBase::setNetworkID( id ); NetworkFunctionStatic::getIdMap()[id] = this; } 100 static inline NetworkFunctionStatic* getNetworkFunction( uint32_t id)101 { assert( NetworkFunctionStatic::getIdMap().find(id)!=NetworkFunctionStatic::getIdMap().end() ); return NetworkFunctionStatic::getIdMap()[id]; }102 100 static NetworkFunctionStatic* getFunction( uint32_t id ) 103 101 { assert( NetworkFunctionStatic::getIdMap().find(id) != NetworkFunctionStatic::getIdMap().end() ); return NetworkFunctionStatic::getIdMap()[id]; } … … 119 117 120 118 virtual void setNetworkID( uint32_t id ){ NetworkFunctionBase::setNetworkID( id ); idMap_[id] = this; } 121 static inline NetworkMemberFunctionBase* getNetworkFunction( uint32_t id){ assert( idMap_.find(id)!=idMap_.end() ); return idMap_[id]; }122 119 static NetworkMemberFunctionBase* getFunction( uint32_t id ){ assert( idMap_.find(id) != idMap_.end() ); return idMap_[id]; } 123 120 static NetworkMemberFunctionBase* getFunction( const NetworkFunctionPointer& p ){ assert( functorMap_.find(p) != functorMap_.end() ); return functorMap_[p]; } -
code/branches/core7/src/libraries/network/NetworkFunctionManager.cc
r10468 r10469 32 32 namespace orxonox 33 33 { 34 std::map<uint32_t, bool> NetworkFunctionManager::isStaticMap_;35 36 34 /* static */NetworkFunctionManager& NetworkFunctionManager::getInstance() 37 35 { -
code/branches/core7/src/libraries/network/NetworkFunctionManager.h
r10468 r10469 42 42 static NetworkFunctionManager& getInstance(); 43 43 44 static inline bool isStatic( uint32_t networkID ) { return isStaticMap_[networkID]; }45 44 static void setNetworkID(const std::string& name, uint32_t id); 46 45 static void destroyAllNetworkFunctions(); 47 46 static std::map<std::string, NetworkFunctionBase*>& getNameMap(); 48 49 private:50 static std::map<uint32_t, bool> isStaticMap_;51 47 }; 52 48 }
Note: See TracChangeset
for help on using the changeset viewer.