Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9924 in orxonox.OLD for branches/network/src/lib/lang/object_list.cc


Ignore:
Timestamp:
Nov 9, 2006, 7:16:15 PM (17 years ago)
Author:
bensch
Message:

network: removed obsolete class_id_DEPRECATED.h and adapted the objectList… now the compile bugs have to be fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/lang/object_list.cc

    r9910 r9924  
    2525 * @return a new NewObejctList
    2626 */
    27 ObjectListBase::ObjectListBase(const std::string& className, int id)
     27ObjectListBase::ObjectListBase(const std::string& className)
    2828    : _name(className)
    2929{
     
    3636  assert(!ObjectListBase::classNameExists(className) && "Classes should only be included once, and no two classes should have the same name (key value)");
    3737
    38   if (id == -1)
    39   {
    40     id = ObjectListBase::_classesByID->size();
    41     // searching for a free ID
    42     while (ObjectListBase::classIDExists(id)) ++id;
    43   }
     38  int id = ObjectListBase::_classesByID->size();
     39  // searching for a free ID
     40  while (ObjectListBase::classIDExists(id)) ++id;
     41
    4442  assert(!ObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");
    4543
     
    342340    assert( false && "size of str2id does not match" );
    343341  }
    344  
     342
    345343  IDMap * map = new IDMap();
    346  
     344
    347345  std::map< std::string, int >::const_iterator it;
    348346  for ( it = str2id.begin(); it != str2id.end(); it++ )
     
    352350    (*map)[ it->second ]->_id = it->second;
    353351  }
    354  
     352
    355353  delete _classesByID;
    356354  _classesByID = map;
     
    358356
    359357/**
    360  * 
    361  * @return 
     358 *
     359 * @return
    362360 */
    363361std::map< std::string, int > * ObjectListBase::createStrToId( )
    364362{
    365363  std::map< std::string, int > * res = new std::map< std::string, int >();
    366  
     364
    367365  NameMap::const_iterator it;
    368366  for ( it = _classesByName->begin(); it != _classesByName->end(); it++ )
     
    378376      }
    379377    }
    380    
     378
    381379    assert( id != -1 );
    382380    (*res)[ it->first ] = id;
    383381  }
    384  
     382
    385383  return res;
    386384}
Note: See TracChangeset for help on using the changeset viewer.