Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9924 in orxonox.OLD


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

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

Location:
branches/network/src
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/Makefile.am

    r9869 r9924  
    5959                defs/globals.h \
    6060                defs/compiler.h \
    61                 defs/class_id_DEPRECATED.h \
    6261                subprojects/benchmark.h
    6362
  • branches/network/src/lib/graphics/light.cc

    r9869 r9924  
    2626#include "debug.h"
    2727
    28 #include "class_id_DEPRECATED.h"
    29 
    30 ObjectListDefinitionID(Light, CL_LIGHT);
     28ObjectListDefinition(Light);
    3129CREATE_FACTORY(Light);
    3230
  • branches/network/src/lib/graphics/render2D/image_plane.cc

    r9869 r9924  
    2323#include "p_node.h"
    2424
    25 
    26 #include "class_id_DEPRECATED.h"
    27 
    28 ObjectListDefinitionID(ImagePlane, CL_IMAGE_PLANE);
     25ObjectListDefinition(ImagePlane);
    2926CREATE_FACTORY(ImagePlane);
    3027
  • 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}
  • branches/network/src/lib/lang/object_list.h

    r9909 r9924  
    3232 * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
    3333 * @param ClassName: the Name of the Class.
    34  * @param ID: optional set a Fixed ID.
    35  */
    36 #define ObjectListDefinitionID(ClassName, ID) \
    37    ObjectList<ClassName> ClassName::_objectList(#ClassName, ID)
    38 
    39 /**
    40  * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
    41  * @param ClassName: the Name of the Class.
    4234 */
    4335#define ObjectListDefinition(ClassName) \
    44     ObjectListDefinitionID(ClassName, -1)
     36    ObjectList<ClassName> ClassName::_objectList(#ClassName)
    4537
    4638class BaseObject;
     
    109101
    110102protected:
    111   ObjectListBase(const std::string& className, int id = -1);
     103  ObjectListBase(const std::string& className);
    112104  virtual ~ObjectListBase();
    113105
     
    133125  static NameMap*               _classesByName;     //!< A Map of all the classes in existance.
    134126  static std::list<std::string> _classNames;        //!< A list of all the registered ClassNames.
    135  
     127
    136128public:
    137129  static void replaceIDMap( const std::map<std::string, int>& str2id );
     
    203195
    204196public:
    205   ObjectList(const std::string& name, int id = -1);
     197  ObjectList(const std::string& name);
    206198  ~ObjectList();
    207199
     
    260252 */
    261253template <class T>
    262 ObjectList<T>::ObjectList(const std::string& name, int id)
    263     : ObjectListBase(name, id)
     254ObjectList<T>::ObjectList(const std::string& name)
     255    : ObjectListBase(name)
    264256{}
    265257
Note: See TracChangeset for help on using the changeset viewer.