From 5a9cfc50ea1c9c4c0799de0fd24fd162cc95aef9 Mon Sep 17 00:00:00 2001 From: v4hn Date: Thu, 2 Sep 2021 23:05:57 +0200 Subject: [PATCH] cleanup: get rid of superfluous parameter --- .../moveit/task_constructor/container_p.h | 4 ++-- core/src/container.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/include/moveit/task_constructor/container_p.h b/core/include/moveit/task_constructor/container_p.h index 533106fc..840490a2 100644 --- a/core/include/moveit/task_constructor/container_p.h +++ b/core/include/moveit/task_constructor/container_p.h @@ -235,7 +235,7 @@ protected: private: // override for custom behavior on received interface states - virtual void initializeExternalInterfaces(InterfaceFlags expected); + virtual void initializeExternalInterfaces(); }; PIMPL_FUNCTIONS(ParallelContainerBase) @@ -263,7 +263,7 @@ protected: container_type::const_iterator current_generator_; private: - void initializeExternalInterfaces(InterfaceFlags expected) override; + void initializeExternalInterfaces() override; template void onNewExternalState(Interface::iterator external, bool updated); void onNewFailure(const Stage& child, const InterfaceState* from, const InterfaceState* to) override; diff --git a/core/src/container.cpp b/core/src/container.cpp index a0c48c78..7e922894 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -686,18 +686,18 @@ void ParallelContainerBasePrivate::resolveInterface(InterfaceFlags expected) { if (exceptions) throw exceptions; - initializeExternalInterfaces(expected); - required_interface_ = expected; + + initializeExternalInterfaces(); } -void ParallelContainerBasePrivate::initializeExternalInterfaces(InterfaceFlags expected) { +void ParallelContainerBasePrivate::initializeExternalInterfaces() { // States received by the container need to be copied to all children's pull interfaces. - if (expected & READS_START) + if (requiredInterface() & READS_START) starts().reset(new Interface([this](Interface::iterator external, bool updated) { this->propagateStateToChildren(external, updated); })); - if (expected & READS_END) + if (requiredInterface() & READS_END) ends().reset(new Interface([this](Interface::iterator external, bool updated) { this->propagateStateToChildren(external, updated); })); @@ -851,19 +851,19 @@ void Fallbacks::onNewSolution(const SolutionBase& s) { FallbacksPrivate::FallbacksPrivate(Fallbacks* me, const std::string& name) : ParallelContainerBasePrivate(me, name) {} -void FallbacksPrivate::initializeExternalInterfaces(InterfaceFlags expected) { - if (expected & READS_START) +void FallbacksPrivate::initializeExternalInterfaces() { + if (requiredInterface() & READS_START) starts().reset(new Interface([this](Interface::iterator external, bool updated) { this->onNewExternalState(external, updated); })); - if (expected & READS_END) + if (requiredInterface() & READS_END) ends().reset(new Interface([this](Interface::iterator external, bool updated) { this->onNewExternalState(external, updated); })); // we've got to set this somewhere once the interface flags are known. // so we might as well do it here - if(expected == GENERATE) + if(requiredInterface() == GENERATE) current_generator_ = children().begin(); }