Changeset 10916 for code/branches/cpp11_v2/src/modules/notifications
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/notifications
- Files:
-
- 2 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 -
code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc
r10821 r10916 206 206 { 207 207 // Add all Notifications that have been created after this NotificationQueue was created. 208 for(auto & notification: *notifications)208 for(auto& mapEntry : *notifications) 209 209 { 210 if( notification.first >= this->creationTime_)211 this->push( notification.second, notification.first);210 if(mapEntry.first >= this->creationTime_) 211 this->push(mapEntry.second, mapEntry.first); 212 212 } 213 213 } … … 336 336 this->ordering_.clear(); 337 337 // Delete all NotificationContainers in the list. 338 for( auto & elem: this->notifications_)339 delete elem;338 for(NotificationContainer* notification : this->notifications_) 339 delete notification; 340 340 341 341 this->notifications_.clear(); … … 426 426 bool first = true; 427 427 // Iterate through the set of targets. 428 for(const auto & elem: this->targets_)428 for(const std::string& target : this->targets_) 429 429 { 430 430 if(!first) … … 432 432 else 433 433 first = false; 434 stream << elem;434 stream << target; 435 435 } 436 436
Note: See TracChangeset
for help on using the changeset viewer.