- for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()); it != itend ; ++it) {
-
- CpuTiAction *action = &*it;
- if (action->getState() == Action::State::running
- || action->getState() == Action::State::ready
- || action->getState() == Action::State::not_in_the_system) {
- action->setFinishTime(date);
- action->setState(Action::State::failed);
- if (action->indexHeap_ >= 0) {
- CpuTiAction* heap_act = static_cast<CpuTiAction*>(
- xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->indexHeap_));
- if (heap_act != action)
- DIE_IMPOSSIBLE;
- }
+ for (CpuTiAction& action : actionSet_) {
+ if (action.get_state() == kernel::resource::Action::State::running ||
+ action.get_state() == kernel::resource::Action::State::ready ||
+ action.get_state() == kernel::resource::Action::State::not_in_the_system) {
+ action.set_finish_time(date);
+ action.set_state(kernel::resource::Action::State::failed);
+ action.heapRemove();