@@ -219,6 +219,7 @@ void ContainerBasePrivate::setStatus(const InterfaceState* s, InterfaceState::St
219219
220220 // if possible (i.e. if state s has an external counterpart), escalate setStatus to external interface
221221 if (parent () && trajectories<dir>(*s).empty ()) {
222+ // TODO: This was coded with SerialContainer in mind. Not sure, it works for ParallelContainers
222223 auto external{ internalToExternalMap ().find (s) };
223224 if (external != internalToExternalMap ().end ()) { // do we have an external state?
224225 // only escalate if there is no other *enabled* internal state connected to the same external one
@@ -928,6 +929,11 @@ void FallbacksPrivate::onNewFailure(const Stage& child, const InterfaceState* /*
928929 (void )child;
929930}
930931
932+ void FallbacksPrivate::nextChild () {
933+ if (std::next (current_) != children ().end ())
934+ ROS_DEBUG_STREAM_NAMED (" Fallbacks" , " Child '" << (*current_)->name () << " ' failed, trying next one." );
935+ ++current_; // advance to next child
936+ }
931937
932938FallbacksPrivateGenerator::FallbacksPrivateGenerator (FallbacksPrivate&& old)
933939 : FallbacksPrivate(std::move(old)) { reset (); }
@@ -941,11 +947,8 @@ bool FallbacksPrivateGenerator::nextJob() {
941947 return false ;
942948 }
943949
944- do {
945- if (std::next (current_) != children ().end ())
946- ROS_DEBUG_STREAM_NAMED (" Fallbacks" , " Generator '" << (*current_)->name () << " ' failed, trying next one." );
947- ++current_; // advance to next child
948- } while (current_ != children ().end () && !(*current_)->pimpl ()->canCompute ());
950+ do { nextChild (); }
951+ while (current_ != children ().end () && !(*current_)->pimpl ()->canCompute ());
949952
950953 // return value shall indicate current_->canCompute()
951954 return current_ != children ().end ();
@@ -979,11 +982,9 @@ bool FallbacksPrivatePropagator::nextJob() {
979982 const auto jobs = pullInterface (dir_);
980983
981984 if (job_ != jobs->end ()) { // current job exists, but is exhausted on current child
982- if (!job_has_solutions_) { // job didn't produce solutions -> feed to next child
983- if (std::next (current_) != children ().end ())
984- ROS_DEBUG_STREAM_NAMED (" Fallbacks" , " Propagator '" << (*current_)->name () << " ' failed, trying next one." );
985- ++current_; // advance to next child
986- } else
985+ if (!job_has_solutions_) // job didn't produce solutions -> feed to next child
986+ nextChild ();
987+ else
987988 current_ = children ().end (); // indicate that this job is exhausted on all children
988989 }
989990 job_has_solutions_ = false ;
0 commit comments