Changeset 11071 for code/trunk/src/libraries/network/NetworkFunction.h
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/NetworkFunction.h
r10624 r11071 45 45 46 46 #if defined(ORXONOX_COMPILER_GCC) && defined(ORXONOX_ARCH_32) 47 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 8;47 static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 8; 48 48 #else 49 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 16;49 static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 16; 50 50 #endif //ORXONOX_COMPILER_GCC 51 static const unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1;51 static constexpr unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1; 52 52 53 53 struct _NetworkExport NetworkFunctionPointer { … … 114 114 115 115 // ignore the objectID because its a static function 116 virtual bool call(uint32_t objectID) { (*this->functor_)(); return true; }117 virtual bool call(uint32_t objectID, const MultiType& mt1) { (*this->functor_)(mt1); return true; }118 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) { (*this->functor_)(mt1, mt2); return true; }119 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) { (*this->functor_)(mt1, mt2, mt3); return true; }120 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) { (*this->functor_)(mt1, mt2, mt3, mt4); return true; }121 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) { (*this->functor_)(mt1, mt2, mt3, mt4, mt5); return true; }116 virtual bool call(uint32_t objectID) override{ (*this->functor_)(); return true; } 117 virtual bool call(uint32_t objectID, const MultiType& mt1) override{ (*this->functor_)(mt1); return true; } 118 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) override{ (*this->functor_)(mt1, mt2); return true; } 119 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) override{ (*this->functor_)(mt1, mt2, mt3); return true; } 120 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) override{ (*this->functor_)(mt1, mt2, mt3, mt4); return true; } 121 virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) override{ (*this->functor_)(mt1, mt2, mt3, mt4, mt5); return true; } 122 122 123 123 private: … … 142 142 { } 143 143 144 inline bool call(uint32_t objectID)145 { 146 if ( Synchronisable::getSynchronisable(objectID)!= 0)144 virtual inline bool call(uint32_t objectID) override 145 { 146 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 147 147 { 148 148 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID))); … … 152 152 return false; 153 153 } 154 inline bool call(uint32_t objectID, const MultiType& mt1)155 { 156 if ( Synchronisable::getSynchronisable(objectID)!= 0)154 virtual inline bool call(uint32_t objectID, const MultiType& mt1) override 155 { 156 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 157 157 { 158 158 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1); … … 162 162 return false; 163 163 } 164 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)165 { 166 if ( Synchronisable::getSynchronisable(objectID)!= 0)164 virtual inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) override 165 { 166 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 167 167 { 168 168 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2); … … 172 172 return false; 173 173 } 174 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)175 { 176 if ( Synchronisable::getSynchronisable(objectID)!= 0)174 virtual inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) override 175 { 176 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 177 177 { 178 178 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3); … … 182 182 return false; 183 183 } 184 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)185 { 186 if ( Synchronisable::getSynchronisable(objectID)!= 0)184 virtual inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) override 185 { 186 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 187 187 { 188 188 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4); … … 192 192 return false; 193 193 } 194 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)195 { 196 if ( Synchronisable::getSynchronisable(objectID)!= 0)194 virtual inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) override 195 { 196 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 197 197 { 198 198 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
Note: See TracChangeset
for help on using the changeset viewer.