- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/notifications/NotificationManager.cc
r10821 r10916 69 69 { 70 70 // Destroys all Notifications. 71 for(auto & elem: this->allNotificationsList_)72 elem.second->destroy();71 for(auto& mapEntry : this->allNotificationsList_) 72 mapEntry.second->destroy(); 73 73 this->allNotificationsList_.clear(); 74 74 … … 152 152 bool executed = false; 153 153 // Clear all NotificationQueues that have the input sender as target. 154 for(auto & elem: this->queues_) // Iterate through all NotificationQueues.155 { 156 const std::set<std::string>& set = elem.second->getTargetsSet();154 for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 155 { 156 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); 157 157 // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target. 158 158 if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end()) 159 executed = elem.second->tidy() || executed;159 executed = mapEntry.second->tidy() || executed; 160 160 } 161 161 … … 187 187 188 188 // Insert the Notification in all NotificationQueues that have its sender as target. 189 for(auto & elem: this->queues_) // Iterate through all NotificationQueues.190 { 191 const std::set<std::string>& set = elem.second->getTargetsSet();189 for(auto& mapEntry : this->queues_) // Iterate through all NotificationQueues. 190 { 191 const std::set<std::string>& set = mapEntry.second->getTargetsSet(); 192 192 bool bAll = set.find(NotificationListener::ALL) != set.end(); 193 193 // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target. … … 195 195 { 196 196 if(!bAll) 197 this->notificationLists_[ elem.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.198 elem.second->update(notification, time); // Update the NotificationQueue.197 this->notificationLists_[mapEntry.second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue. 198 mapEntry.second->update(notification, time); // Update the NotificationQueue. 199 199 } 200 200 } … … 345 345 346 346 // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue. 347 for(auto & elem: this->allNotificationsList_)348 { 349 if(!bAll && set.find( elem.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.350 map->insert(std::pair<std::time_t, Notification*>( elem.first, elem.second));347 for(auto& mapEntry : this->allNotificationsList_) 348 { 349 if(!bAll && set.find(mapEntry.second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target. 350 map->insert(std::pair<std::time_t, Notification*>(mapEntry.first, mapEntry.second)); 351 351 } 352 352
Note: See TracChangeset
for help on using the changeset viewer.