Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/network/synchronisable/Synchronisable.cc

    r10624 r11054  
    8888    }
    8989    // delete all Synchronisable Variables from syncList_ ( which are also in stringList_ )
    90     for(std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin(); it!=syncList_.end(); it++)
    91       delete (*it);
     90    for(SynchronisableVariableBase* variable : syncList_)
     91      delete variable;
    9292    syncList_.clear();
    9393    stringList_.clear();
     
    105105  uint32_t Synchronisable::findContextID(Context* context)
    106106  {
    107       if (context == NULL)
     107      if (context == nullptr)
    108108          return OBJECTID_UNKNOWN;
    109109
    110110      Synchronisable* synchronisableContext = orxonox_cast<Synchronisable*>(context);
    111       if (synchronisableContext != NULL)
     111      if (synchronisableContext != nullptr)
    112112          return synchronisableContext->getObjectID();
    113113      else
     
    140140    {
    141141      mem += header.getDataSize() + header.getSize();
    142       return 0;
     142      return nullptr;
    143143    }
    144144//     assert( !header.isDiffed() );
     
    156156    }
    157157    assert(id);
    158     Context* context = 0;
     158    Context* context = nullptr;
    159159    if (header.getContextID() != OBJECTID_UNKNOWN)
    160160    {
     
    164164        mem += header.getDataSize()+SynchronisableHeader::getSize(); //.TODO: this suckz.... remove size from header
    165165        assert(0); // TODO: uncomment this if we have a clean objecthierarchy (with destruction of children of objects) ^^
    166         return 0;
     166        return nullptr;
    167167      }
    168168      else
     
    172172      context = Context::getRootContext();
    173173
    174     assert(getSynchronisable(header.getObjectID())==0);   //make sure no object with this id exists
     174    assert(getSynchronisable(header.getObjectID())==nullptr);   //make sure no object with this id exists
    175175    BaseObject *bo = orxonox_cast<BaseObject*>(id->fabricate(context));
    176176    assert(bo);
     
    226226      return it1->second;
    227227    // if the objects not in the map it should'nt exist at all anymore
    228     return NULL;
     228    return nullptr;
    229229  }
    230230
     
    266266    assert(this->classID_==this->getIdentifier()->getNetworkID());
    267267    assert(this->objectID_!=OBJECTID_UNKNOWN);
    268     std::vector<SynchronisableVariableBase*>::iterator i;
    269268
    270269    // start copy header
     
    276275//     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
    277276    // copy to location
    278     for(i=syncList_.begin(); i!=syncList_.end(); ++i)
    279     {
    280       uint32_t varsize = (*i)->getData( mem, mode );
     277    for(SynchronisableVariableBase* variable : syncList_)
     278    {
     279      uint32_t varsize = variable->getData( mem, mode );
    281280//       orxout(verbose, context::network) << " " << varsize;
    282281      tempsize += varsize;
     
    348347      assert( this->getContextID() == syncHeader2.getContextID() );
    349348      mem += SynchronisableHeader::getSize();
    350       std::vector<SynchronisableVariableBase *>::iterator i;
    351       for(i=syncList_.begin(); i!=syncList_.end(); ++i)
     349      for(SynchronisableVariableBase* variable : syncList_)
    352350      {
    353351        assert( mem <= data+syncHeader2.getDataSize()+SynchronisableHeader::getSize() ); // always make sure we don't exceed the datasize in our stream
    354         (*i)->putData( mem, mode, forceCallback );
     352        variable->putData( mem, mode, forceCallback );
    355353      }
    356354      assert(mem == data+syncHeaderLight.getDataSize()+SynchronisableHeader::getSize() );
     
    388386    assert( mode==state_ );
    389387    tsize += this->dataSize_;
    390     std::vector<SynchronisableVariableBase*>::iterator i;
    391     for(i=stringList_.begin(); i!=stringList_.end(); ++i)
    392     {
    393       tsize += (*i)->getSize( mode );
     388    for(SynchronisableVariableBase* variable : stringList_)
     389    {
     390      tsize += variable->getSize( mode );
    394391    }
    395392    return tsize;
Note: See TracChangeset for help on using the changeset viewer.