Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2009, 2:45:37 PM (15 years ago)
Author:
rgrieder
Message:

Found a way to write orxonox_cast<T*> instead of orxonox_cast<T> so that the syntax resembles dynamic_cast<T*>.

Location:
code/branches/core4/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/network/NetworkFunction.h

    r3224 r3239  
    150150    {
    151151      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    152         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)));
     152        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)));
    153153    }
    154154    inline void call(uint32_t objectID, const MultiType& mt1)
    155155    {
    156156      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    157         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)), mt1);
     157        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1);
    158158    }
    159159    inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)
    160160    {
    161161      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    162         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)), mt1, mt2);
     162        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2);
    163163    }
    164164    inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)
    165165    {
    166166      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    167         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3);
     167        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3);
    168168    }
    169169    inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)
    170170    {
    171171      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    172         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4);
     172        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4);
    173173    }
    174174    inline void call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)
    175175    {
    176176      if ( Synchronisable::getSynchronisable(objectID)!=0 )
    177         (*this->functor_)(orxonox_cast<T>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
     177        (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5);
    178178    }
    179179   
  • code/branches/core4/src/network/synchronisable/Synchronisable.cc

    r3223 r3239  
    7373    if (creator)
    7474    {
    75         Synchronisable* synchronisable_creator = orxonox_cast<Synchronisable>(creator);
     75        Synchronisable* synchronisable_creator = orxonox_cast<Synchronisable*>(creator);
    7676        if (synchronisable_creator && synchronisable_creator->objectMode_)
    7777        {
     
    161161      }
    162162      else
    163         creator = orxonox_cast<BaseObject>(synchronisable_creator);
     163        creator = orxonox_cast<BaseObject*>(synchronisable_creator);
    164164    }
    165165    assert(getSynchronisable(header.getObjectID())==0);   //make sure no object with this id exists
    166166    BaseObject *bo = id->fabricate(creator);
    167167    assert(bo);
    168     Synchronisable *no = orxonox_cast<Synchronisable>(bo);
     168    Synchronisable *no = orxonox_cast<Synchronisable*>(bo);
    169169    assert(no);
    170170    no->objectID=header.getObjectID();
Note: See TracChangeset for help on using the changeset viewer.