- Timestamp:
- Sep 11, 2010, 8:30:17 PM (14 years ago)
- Location:
- code/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/util/StringUtils.h
r7413 r7417 48 48 extern _UtilExport std::string BLANKSTRING; 49 49 50 //!< Struct that can be used as a comparison object for strings in stl containers.51 _UtilExport struct StringCompare52 {53 bool operator() (const std::string& lhs, const std::string& rhs) const54 { return lhs.compare(rhs) < 0; }55 };56 57 50 _UtilExport std::string getUniqueNumberString(); 58 51 -
code/trunk/src/modules/notifications/NotificationManager.cc
r7413 r7417 129 129 for(std::map<NotificationListener*, unsigned int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) // Iterate through all NotificationListeners. 130 130 { 131 std::set<std::string, StringCompare>set = it->first->getTargetsSet();131 const std::set<std::string>& set = it->first->getTargetsSet(); 132 132 bool bAll = set.find(NotificationManager::ALL) != set.end(); 133 133 // If either the Notification has as sender 'all', the NotificationListener displays all Notifications or the NotificationListener has the sender of the Notification as target. … … 210 210 this->listenerList_[listener] = index; // Add the NotificationListener to the list of NotificationListeners. 211 211 212 std::set<std::string, StringCompare>set = listener->getTargetsSet();212 const std::set<std::string>& set = listener->getTargetsSet(); 213 213 214 214 // 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 356 356 bool first = true; 357 357 // 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++) 359 359 { 360 360 if(!first) -
code/trunk/src/modules/notifications/NotificationQueue.h
r7413 r7417 124 124 @return Returns a set of strings holding the different targets. 125 125 */ 126 inline const std::set<std::string , StringCompare> & getTargetsSet()126 inline const std::set<std::string> & getTargetsSet() 127 127 { return this->targets_; } 128 128 … … 144 144 bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already. 145 145 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. 147 147 148 148 std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered. -
code/trunk/src/orxonox/interfaces/NotificationListener.h
r7413 r7417 61 61 virtual ~NotificationListener() {} 62 62 63 virtual const std::set<std::string , StringCompare> & getTargetsSet() = 0;63 virtual const std::set<std::string> & getTargetsSet() = 0; 64 64 virtual void update(void) = 0; 65 65 virtual void update(Notification* notification, const std::time_t & time) = 0;
Note: See TracChangeset
for help on using the changeset viewer.