| 61 | //## Parse all transitions and find the State that matches the String-Name. |
| 62 | |
| 63 | bool mitk::StateMachineState::ConnectTransitions(StateMap *allStates) |
| 64 | { |
| 65 | for (auto transIt = m_Transitions.begin(); transIt != m_Transitions.end(); ++transIt) |
| 66 | { |
| 67 | bool found = false; |
| 68 | for (auto stateIt = allStates->begin(); stateIt != allStates->end(); ++stateIt) |
| 69 | { |
| 70 | if ((*stateIt)->GetName() == (*transIt)->GetNextStateName()) |
| 71 | { |
| 72 | (*transIt)->SetNextState(*stateIt); |
| 73 | found = true; |
| 74 | break; |
| 75 | } |
| 76 | } |
| 77 | if (!found) |
| 78 | { |
| 79 | MITK_WARN << "Target State not found in StateMachine."; |
| 80 | return false; // only reached if no state matching the string is found |
| 81 | } |
| 82 | } |
| 83 | return true; |
| 84 | } |
no test coverage detected