Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 12, 2005, 3:11:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: derivation of superclasses is more clear now. lets see, if this will hold out for some time (about 115 classes long)

File:
1 edited

Legend:

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

    r4836 r4837  
    103103bool BaseObject::isA (long classID) const
    104104{
    105   // if classID is a derivable object
    106   if ( likely(classID & CL_MASK_SUPER_CLASS || classID & CL_MASK_SUBSUPER_CLASS))
     105  // if classID is a derivable object from a SUPERCLASS
     106  if (classID & CL_MASK_SUPER_CLASS)
    107107  {
    108     if( this->classID & classID)
     108    if( likely(this->classID & classID))
    109109      return true;
    110   } // if classID is a LOWLEVEL-class
     110  }
     111  // if classID is a SubSuperClass, and
     112  else if (classID & CL_MASK_SUBSUPER_CLASS)
     113  {
     114    if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_ID) == (this->classID & CL_MASK_SUBSUPER_CLASS_ID)) &&
     115        this->classID & classID & CL_MASK_SUBSUPER_CLASS_ID2))
     116      return true;
     117  }
     118  // if classID is a LOWLEVEL-class
    111119  else
    112120  {
    113     if( (this->classID & CL_MASK_LOWLEVEL_CLASS) == classID)
     121    if( likely((this->classID & CL_MASK_LOWLEVEL_CLASS) == classID))
    114122      return true;
    115123  }
Note: See TracChangeset for help on using the changeset viewer.