Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 22, 2005, 5:26:29 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: class-autocompletion is nice now

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

Legend:

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

    r4942 r5102  
    5252  //  delete []this->className;
    5353  if (this->objectName)
    54     delete []this->objectName;}
     54    delete[] this->objectName;}
    5555
    5656/**
     
    8484{
    8585  if (this->objectName)
    86     delete []this->objectName;
     86    delete[] this->objectName;
    8787  if (objectName)
    8888  {
  • trunk/src/lib/lang/base_object.h

    r5039 r5102  
    2727
    2828  void setName (const char* newName);
    29   /** \brief returns the Name of this Object */
     29  /** returns the Name of this Object */
    3030  inline const char* getName ()const { return this->objectName; };
    3131
  • trunk/src/lib/lang/class_list.cc

    r4874 r5102  
    109109}
    110110
     111/**
     112 * searches for classID and returns the list of Entities
     113 * @param classID the ID of the class to get the list from
     114 * @return the List accessed by classID, or NULL if not found
     115 */
    111116tList<BaseObject>* ClassList::getList(long classID)
    112117{
     
    119124    {
    120125      if (unlikely(tmpCL->classID == classID))
     126        return tmpCL->objectList;
     127      tmpCL = tmpCL->next;
     128    }
     129  }
     130  return NULL;
     131}
     132
     133/**
     134 * searches for className and returns the list of Entities
     135 * @param className the name of the class to get the list from
     136 * @return the List accessed by classID, or NULL if not found
     137 */tList<BaseObject>* ClassList::getList(const char* className)
     138{
     139  if(unlikely(ClassList::first == NULL))
     140    return NULL;
     141  else
     142  {
     143    ClassList* tmpCL = ClassList::first;
     144    while (likely(tmpCL != NULL))
     145    {
     146      if (unlikely(!strcmp(tmpCL->className, className)))
    121147        return tmpCL->objectList;
    122148      tmpCL = tmpCL->next;
     
    205231}
    206232
    207 
    208233/**
    209234 * prints out a string of all the types this Object matches
  • trunk/src/lib/lang/class_list.h

    r5039 r5102  
    3939
    4040    static tList<BaseObject>* getList(long classID = CL_NULL);
     41    static tList<BaseObject>* getList(const char* className);
    4142    static BaseObject*        getObject(const char* name, long classID = CL_NULL);
    4243    static bool               exists(const BaseObject* object, long classID = CL_NULL);
Note: See TracChangeset for help on using the changeset viewer.