Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6077 in orxonox.OLD for trunk/src/lib/lang/class_list.cc


Ignore:
Timestamp:
Dec 13, 2005, 2:53:22 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: better and faster BaseObject/ClassList

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/class_list.cc

    r5885 r6077  
    3737 *  Creates a new ClassList
    3838*/
    39 ClassList::ClassList(const long& classID, const char* className)
     39ClassList::ClassList(ClassID classID, const char* className)
    4040{
    4141  this->className = className;
     
    9494    if (objectPointer->isA((*cl).classID))
    9595    {
    96       std::list<BaseObject*>::iterator bo;
    97       for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++)
    98       {
    99         if ((*bo) == objectPointer)
    100         {
     96      std::list<BaseObject*>::iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), objectPointer);
     97      if (bo != (*cl).objectList.end())
    10198          (*cl).objectList.erase(bo);
    102           break;
    103         }
    104       }
    10599    }
    106100  }
     
    175169}
    176170
    177 
     171/**
     172 * !!PRIVATE!!
     173 * @param classID the ClassID to search for
     174 * @returns the ClassList with classID as specifyer, or NULL if not
     175 */
    178176ClassList* ClassList::getClassList(ClassID classID)
    179177{
     
    183181
    184182
     183/**
     184 * !!PRIVATE!!
     185 * @param className the ClassName to search for
     186 * @returns the ClassList with className as specifyer, or NULL if not
     187 */
    185188ClassList* ClassList::getClassList(const char* className)
    186189{
     
    288291 * @return the ClassID. CL_NULL, if the class was not found.
    289292 */
    290 long ClassList::StringToID(const char* className)
     293ClassID ClassList::StringToID(const char* className)
    291294{
    292295  ClassList* cl = ClassList::getClassList(className);
     
    314317 * @param classID the class that should be displayed (if CL_NULL (default) all classes will be displayed)
    315318 */
    316 void ClassList::debug(unsigned int debugLevel, long classID)
     319void ClassList::debug(unsigned int debugLevel, ClassID classID)
    317320{
    318321  if (debugLevel > 3)
Note: See TracChangeset for help on using the changeset viewer.