Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5626 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Nov 17, 2005, 12:01:45 PM (19 years ago)
Author:
bensch
Message:

trunk: optimizations, and operator== in BaseObject to compare ObjectNames

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

Legend:

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

    r5513 r5626  
    137137}
    138138
     139/**
     140 * compares the ObjectName with an external name
     141 * @param objectName: the name to check.
     142 * @returns true on match, false otherwise.
     143 */
     144bool BaseObject::operator ==(const char* objectName)
     145{
     146  if (likely(this->objectName != NULL && objectName != NULL))
     147    return (strcmp(this->objectName, objectName)) ? false : true;
     148}
     149
    139150
    140151/**
  • trunk/src/lib/lang/base_object.h

    r5513 r5626  
    3939  void whatIs() const;
    4040
     41  //
     42  bool operator== (const char* objectName);
     43
    4144 protected:
    4245  void setClassID(long classID, const char* className);
Note: See TracChangeset for help on using the changeset viewer.