Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 9, 2005, 12:22:43 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: color adaption in the shell
isA also with String (slow)

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

Legend:

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

    r5447 r5513  
    126126
    127127/**
     128 *  checks if the class is a classID
     129 * @param classID the Identifier to check for
     130 * @returns true if it is, false otherwise
     131 */
     132bool BaseObject::isA (const char* className) const
     133{
     134  long classID = ClassList::StringToID(className);
     135  if (classID != CL_NULL)
     136    return this->isA(classID);
     137}
     138
     139
     140/**
    128141 *  displays everything this class is
    129142 */
  • trunk/src/lib/lang/base_object.h

    r5511 r5513  
    2626
    2727  void loadParams(const TiXmlElement* root);
    28 
    2928  void setName (const char* newName);
    3029  /** returns the Name of this Object */
     
    3736
    3837  bool isA (long classID) const;
     38  bool isA (const char* className) const;
    3939  void whatIs() const;
    4040
  • trunk/src/lib/lang/class_list.cc

    r5352 r5513  
    242242bool ClassList::exists(const BaseObject* object, long classID)
    243243{
    244   if(unlikely(ClassList::first == NULL))
     244  if(unlikely(ClassList::first == NULL) || object == NULL)
    245245    return false;
    246246  else
     
    252252      {
    253253        tIterator<BaseObject>* iterator = tmp->objectList->getIterator();
    254         BaseObject* enumBO = iterator->firstElement();
     254        const BaseObject* enumBO = iterator->firstElement();
    255255        while (enumBO != NULL)
    256256        {
Note: See TracChangeset for help on using the changeset viewer.