Changeset 11071 for code/trunk/src/modules/objects/eventsystem
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/objects/eventsystem/EventDispatcher.cc
r9667 r11071 45 45 { 46 46 if (this->isInitialized()) 47 for ( std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)48 (*it)->destroy();47 for (BaseObject* target : this->targets_) 48 target->destroy(); 49 49 } 50 50 … … 61 61 void EventDispatcher::processEvent(Event& event) 62 62 { 63 for ( std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)64 (*it)->processEvent(event);63 for (BaseObject* target : this->targets_) 64 target->processEvent(event); 65 65 } 66 66 … … 73 73 { 74 74 unsigned int i = 0; 75 for ( std::list<BaseObject*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)75 for (BaseObject* target : this->targets_) 76 76 { 77 77 if (i == index) 78 return (*it);78 return target; 79 79 ++i; 80 80 } 81 return 0;81 return nullptr; 82 82 } 83 83 } -
code/trunk/src/modules/objects/eventsystem/EventFilter.cc
r9667 r11071 70 70 { 71 71 bool success = false; 72 for ( std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)72 for (EventName* name : this->names_) 73 73 { 74 if ( (*it)->getName() == event.name_)74 if (name->getName() == event.name_) 75 75 { 76 76 success = true; … … 96 96 { 97 97 unsigned int i = 0; 98 for ( std::list<BaseObject*>::const_iterator it = this->sources_.begin(); it != this->sources_.end(); ++it)98 for (BaseObject* source : this->sources_) 99 99 { 100 100 if (i == index) 101 return (*it);101 return source; 102 102 ++i; 103 103 } 104 return 0;104 return nullptr; 105 105 } 106 106 … … 113 113 { 114 114 unsigned int i = 0; 115 for ( std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)115 for (EventName* name : this->names_) 116 116 { 117 117 if (i == index) 118 return (*it);118 return name; 119 119 ++i; 120 120 } 121 return 0;121 return nullptr; 122 122 } 123 123 } -
code/trunk/src/modules/objects/eventsystem/EventListener.cc
r9667 r11071 78 78 return; 79 79 80 for ( ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)81 if ( it->getName() == this->eventName_)82 this->addEventSource( *it, "");80 for (BaseObject* object : ObjectList<BaseObject>()) 81 if (object->getName() == this->eventName_) 82 this->addEventSource(object, ""); 83 83 } 84 84 -
code/trunk/src/modules/objects/eventsystem/EventTarget.cc
r9667 r11071 73 73 this->target_ = name; 74 74 75 for ( ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)76 if ( it->getName() == this->target_)77 this->addEventTarget( *it);75 for (BaseObject* object : ObjectList<BaseObject>()) 76 if (object->getName() == this->target_) 77 this->addEventTarget(object); 78 78 } 79 79
Note: See TracChangeset
for help on using the changeset viewer.