Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7417


Ignore:
Timestamp:
Sep 11, 2010, 8:30:17 PM (9 years ago)
Author:
rgrieder
Message:

Removed StringCompare again.

Location:
code/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/StringUtils.h

    r7413 r7417  
    4848    extern _UtilExport std::string BLANKSTRING;
    4949
    50     //!< Struct that can be used as a comparison object for strings in stl containers.
    51     _UtilExport struct StringCompare
    52     {
    53         bool operator() (const std::string& lhs, const std::string& rhs) const
    54             { return lhs.compare(rhs) < 0; }
    55     };
    56 
    5750    _UtilExport std::string getUniqueNumberString();
    5851
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r7413 r7417  
    129129        for(std::map<NotificationListener*, unsigned int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) // Iterate through all NotificationListeners.
    130130        {
    131             std::set<std::string, StringCompare> set = it->first->getTargetsSet();
     131            const std::set<std::string>& set = it->first->getTargetsSet();
    132132            bool bAll = set.find(NotificationManager::ALL) != set.end();
    133133            // If either the Notification has as sender 'all', the NotificationListener displays all Notifications or the NotificationListener has the sender of the Notification as target.
     
    210210        this->listenerList_[listener] = index; // Add the NotificationListener to the list of NotificationListeners.
    211211
    212         std::set<std::string, StringCompare> set = listener->getTargetsSet();
     212        const std::set<std::string>& set = listener->getTargetsSet();
    213213
    214214        // If all senders are the target of the NotificationListener, then the list of Notifications for that specific NotificationListener is the same as the list of all Notifications.
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r7413 r7417  
    356356        bool first = true;
    357357        // Iterate through the set of targets.
    358         for(std::set<std::string, StringCompare>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
     358        for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
    359359        {
    360360            if(!first)
  • code/trunk/src/modules/notifications/NotificationQueue.h

    r7413 r7417  
    124124            @return Returns a set of strings holding the different targets.
    125125            */
    126             inline const std::set<std::string, StringCompare> & getTargetsSet()
     126            inline const std::set<std::string> & getTargetsSet()
    127127                { return this->targets_; }
    128128
     
    144144            bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.
    145145
    146             std::set<std::string, StringCompare> targets_; //!< The targets the NotificationQueue displays Notifications of.
     146            std::set<std::string> targets_; //!< The targets the NotificationQueue displays Notifications of.
    147147
    148148            std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered.
  • code/trunk/src/orxonox/interfaces/NotificationListener.h

    r7413 r7417  
    6161            virtual ~NotificationListener() {}
    6262
    63             virtual const std::set<std::string, StringCompare> & getTargetsSet() = 0;
     63            virtual const std::set<std::string> & getTargetsSet() = 0;
    6464            virtual void update(void) = 0;
    6565            virtual void update(Notification* notification, const std::time_t & time) = 0;
Note: See TracChangeset for help on using the changeset viewer.