Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8271 in orxonox.OLD for trunk/src/lib/lang


Ignore:
Timestamp:
Jun 8, 2006, 4:50:50 PM (19 years ago)
Author:
bensch
Message:

merge

Location:
trunk/src/lib/lang
Files:
2 edited

Legend:

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

    r8145 r8271  
    221221          return (*bo);
    222222    }
     223  }
     224  return NULL;
     225}
     226
     227
     228/**
     229 * @brief checks if the BaseObject* object exists.
     230 * @param objectName the name of the BaseObject to look for
     231 * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere.
     232 * @return true, if the Object Exists in the specified ClassID, false otherwise
     233 * @todo: speed this up!!
     234 */
     235BaseObject* ClassList::getObject(const std::string& objectName, const std::string& className)
     236{
     237  ClassList* cl = ClassList::getClassList(className);
     238  if (cl != NULL)
     239  {
     240    std::list<BaseObject*>::iterator bo;
     241    for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++)
     242      if ((*bo)->getName() != NULL && objectName == (*bo)->getName())
     243        return (*bo);
    223244  }
    224245  return NULL;
  • trunk/src/lib/lang/class_list.h

    r7429 r8271  
    4242    static const std::list<BaseObject*>*  getList(const std::string& className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
    4343    static const std::list<std::string>*  getClassNames();
    44     static BaseObject*                    getObject(const std::string& name, ClassID classID = CL_NULL);
     44    static BaseObject*                    getObject(const std::string& objectName, ClassID classID = CL_NULL);
     45    static BaseObject*                    getObject(const std::string& objectName, const std::string& className);
    4546    static bool                           exists(const BaseObject* object, ClassID classID = CL_NULL);
    4647    static bool                           exists(const std::string& className, const std::string& objectName);
Note: See TracChangeset for help on using the changeset viewer.