Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 1:34:31 AM (18 years ago)
Author:
bensch
Message:

orxonox/branches/new_class_id: slowly but surely reimplementing to the new groove… way to go

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/lang/new_object_list.h

    r9682 r9684  
    1616
    1717#define NewObjectListDeclaration(ClassName) \
    18    static NewObjectList<ClassName> objectList
     18  public: \
     19   static const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
     20  private: \
     21   static NewObjectList<ClassName> _objectList
    1922
    2023#define NewObjectListDefinitionID(ClassName, ID) \
    21    NewObjectList<ClassName> ClassName::objectList(#ClassName, ID)
     24   NewObjectList<ClassName> ClassName::_objectList(#ClassName, ID)
    2225
    2326
     
    157160T* NewObjectList<T>::getObject(const std::string& name) const
    158161{
    159   iterator it = std::find(this->_objects.begin(), this->_objects.end(), name);
    160   if (it != this->_objects.end())
    161     return *it;
    162   else
    163     return NULL;
     162  const_iterator it;
     163  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
     164    if ((*it)->getName() == name)
     165      return (*it);
     166  return NULL;
    164167}
    165168
Note: See TracChangeset for help on using the changeset viewer.