Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/NetworkFunction.h

    r10624 r11071  
    4545
    4646#if defined(ORXONOX_COMPILER_GCC) && defined(ORXONOX_ARCH_32)
    47 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 8;
     47static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 8;
    4848#else
    49 static const unsigned int MAX_FUNCTION_POINTER_SIZE = 16;
     49static constexpr unsigned int MAX_FUNCTION_POINTER_SIZE = 16;
    5050#endif //ORXONOX_COMPILER_GCC
    51 static const unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1;
     51static constexpr unsigned int MAX_FUNCTION_POINTER_INTS = (MAX_FUNCTION_POINTER_SIZE-1)/4+1;
    5252
    5353struct _NetworkExport NetworkFunctionPointer {
     
    114114
    115115    // 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; }
    122122
    123123  private:
     
    142142    { }
    143143
    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 )
    147147      {
    148148        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)));
     
    152152        return false;
    153153    }
    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 )
    157157      {
    158158        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1);
     
    162162        return false;
    163163    }
    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 )
    167167      {
    168168        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2);
     
    172172        return false;
    173173    }
    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 )
    177177      {
    178178        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3);
     
    182182        return false;
    183183    }
    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 )
    187187      {
    188188        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4);
     
    192192        return false;
    193193    }
    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 )
    197197      {
    198198        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
Note: See TracChangeset for help on using the changeset viewer.