Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4874 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jul 15, 2005, 1:01:10 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: whatIs implemented in ClassList is better than in BaseObject

Location:
orxonox/trunk/src/lib/lang
Files:
3 edited

Legend:

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

    r4837 r4874  
    6363  // name setup
    6464  LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)
    65   .describe("the name of the Object at hand");
     65      .describe("the name of the Object at hand");
    6666}
    6767
     
    148148    if (this->isA(CL_STORY_ENTITY))
    149149      PRINT(0)(" =StoryEntity=");
     150    if (this->isA(CL_ELEMENT_2D))
     151      PRINT(0)(" =Element2D=");
    150152    PRINT(0)("\n");
    151153  }
  • orxonox/trunk/src/lib/lang/class_list.cc

    r4873 r4874  
    124124  }
    125125  return NULL;
    126 
    127126}
    128127
     
    175174 * @todo: speed this up!!
    176175 */
    177 bool ClassList::exists(BaseObject* object, long classID)
     176bool ClassList::exists(const BaseObject* object, long classID)
    178177{
    179178  if(unlikely(ClassList::first == NULL))
     
    206205}
    207206
     207
     208/**
     209 * prints out a string of all the types this Object matches
     210 * @param object a Pointer to the object to analyze
     211 */
     212void ClassList::whatIs(const BaseObject* object)
     213{
     214  ClassList* tmp = ClassList::first;
     215  while (likely(tmp != NULL))
     216  {
     217    if (object->isA(tmp->classID))
     218    {
     219      PRINT(0)("=%s=-", tmp->className);
     220    }
     221    tmp = tmp->next;
     222  }
     223}
     224
    208225/**
    209226 * Print out some very nice debug information
     
    246263          PRINT(0)("|   (class %s): NAME(%s)->%p ", enumBO->getClassName(), enumBO->getName(), enumBO);
    247264          if (debugLevel == 3)
    248             enumBO->whatIs();
    249           else
    250           {
    251             PRINT(0)("\n");
    252           }
     265            ClassList::whatIs(enumBO);
     266          PRINT(0)("\n");
    253267          enumBO = iterator->nextElement();
    254268        }
  • orxonox/trunk/src/lib/lang/class_list.h

    r4871 r4874  
    4040    static tList<BaseObject>* getList(long classID = CL_NULL);
    4141    static BaseObject*        getObject(const char* name, long classID = CL_NULL);
    42     static bool               exists(BaseObject* object, long classID = CL_NULL);
     42    static bool               exists(const BaseObject* object, long classID = CL_NULL);
    4343
     44    static void               whatIs(const BaseObject* object);
    4445    static void debug(unsigned int debugLevel = 0, long classID = CL_NULL);
    4546
Note: See TracChangeset for help on using the changeset viewer.