Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2010, 9:48:32 PM (14 years ago)
Author:
scheusso
Message:

buffering incoming function calls for non-existing objects works now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/network/NetworkFunction.h

    r7284 r7495  
    139139
    140140    //
    141     virtual void call(uint32_t objectID)=0;
    142     virtual void call(uint32_t objectID, const MultiType& mt1)=0;
    143     virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)=0;
    144     virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)=0;
    145     virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)=0;
    146     virtual void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)=0;
     141    virtual bool call(uint32_t objectID)=0;
     142    virtual bool call(uint32_t objectID, const MultiType& mt1)=0;
     143    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)=0;
     144    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)=0;
     145    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)=0;
     146    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)=0;
    147147
    148148  private:
     
    156156    NetworkMemberFunction(const FunctorMemberPtr<T>& functor, const std::string& name, const NetworkFunctionPointer& p);
    157157
    158     inline void call(uint32_t objectID)
    159     {
    160       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     158    inline bool call(uint32_t objectID)
     159    {
     160      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     161      {
    161162        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)));
    162     }
    163     inline void call(uint32_t objectID, const MultiType& mt1)
    164     {
    165       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     163        return true;
     164      }
     165      else
     166        return false;
     167    }
     168    inline bool call(uint32_t objectID, const MultiType& mt1)
     169    {
     170      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     171      {
    166172        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1);
    167     }
    168     inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)
    169     {
    170       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     173        return true;
     174      }
     175      else
     176        return false;
     177    }
     178    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)
     179    {
     180      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     181      {
    171182        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2);
    172     }
    173     inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)
    174     {
    175       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     183        return true;
     184      }
     185      else
     186        return false;
     187    }
     188    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)
     189    {
     190      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     191      {
    176192        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3);
    177     }
    178     inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)
    179     {
    180       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     193        return true;
     194      }
     195      else
     196        return false;
     197    }
     198    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)
     199    {
     200      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     201      {
    181202        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4);
    182     }
    183     inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)
    184     {
    185       if ( Synchronisable::getSynchronisable(objectID)!=0 )
     203        return true;
     204      }
     205      else
     206        return false;
     207    }
     208    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)
     209    {
     210      if ( Synchronisable::getSynchronisable(objectID)!=0 )
     211      {
    186212        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
     213        return true;
     214      }
     215      else
     216        return false;
    187217    }
    188218
Note: See TracChangeset for help on using the changeset viewer.