Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 17, 2008, 5:05:54 PM (16 years ago)
Author:
landauf
Message:
  • added == and != operator to the ClassTreeMask
  • Included the Namespace in the Loader
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/ClassTreeMask.cc

    r876 r896  
    561561
    562562    /**
     563        @brief Compares the mask with another mask and returns true if they represent the same logic.
     564        @param other The other mask
     565        @return True if both masks represent the same logic
     566    */
     567    bool ClassTreeMask::operator==(const ClassTreeMask& other) const
     568    {
     569        ClassTreeMask temp1 = other;
     570        ClassTreeMask temp2 = (*this);
     571
     572        temp1.clean();
     573        temp2.clean();
     574
     575        ClassTreeMaskIterator it1 = temp1.root_;
     576        ClassTreeMaskIterator it2 = temp2.root_;
     577
     578        for ( ; it1 && it2; ++it1, ++it2)
     579            if (it1->getClass() != it2->getClass())
     580                return false;
     581
     582        return true;
     583    }
     584
     585    /**
     586        @brief Compares the mask with another mask and returns true if they represent different logics.
     587        @param other The other mask
     588        @return True if the masks represent different logics
     589    */
     590    bool ClassTreeMask::operator!=(const ClassTreeMask& other) const
     591    {
     592        return (!((*this) == other));
     593    }
     594
     595    /**
    563596        @brief Prefix operator + does nothing.
    564597        @return A reference to the mask itself
Note: See TracChangeset for help on using the changeset viewer.