Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

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  
    6969    {
    7070        // Destroys all Notifications.
    71         for(auto & elem : this->allNotificationsList_)
    72             elem.second->destroy();
     71        for(auto& mapEntry : this->allNotificationsList_)
     72            mapEntry.second->destroy();
    7373        this->allNotificationsList_.clear();
    7474
     
    152152        bool executed = false;
    153153        // 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();
    157157            // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target.
    158158            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;
    160160        }
    161161
     
    187187
    188188        // 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();
    192192            bool bAll = set.find(NotificationListener::ALL) != set.end();
    193193            // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target.
     
    195195            {
    196196                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.
    199199            }
    200200        }
     
    345345
    346346        // 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));
    351351        }
    352352
  • code/branches/cpp11_v2/src/modules/notifications/NotificationQueue.cc

    r10821 r10916  
    206206        {
    207207            // Add all Notifications that have been created after this NotificationQueue was created.
    208             for(auto & notification : *notifications)
     208            for(auto& mapEntry : *notifications)
    209209            {
    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);
    212212            }
    213213        }
     
    336336        this->ordering_.clear();
    337337        // Delete all NotificationContainers in the list.
    338         for(auto & elem : this->notifications_)
    339             delete elem;
     338        for(NotificationContainer* notification : this->notifications_)
     339            delete notification;
    340340
    341341        this->notifications_.clear();
     
    426426        bool first = true;
    427427        // Iterate through the set of targets.
    428         for(const auto & elem : this->targets_)
     428        for(const std::string& target : this->targets_)
    429429        {
    430430            if(!first)
     
    432432            else
    433433                first = false;
    434             stream << elem;
     434            stream << target;
    435435        }
    436436
Note: See TracChangeset for help on using the changeset viewer.