cleanup: get rid of superfluous parameter

This commit is contained in:
v4hn 2021-09-02 23:05:57 +02:00
parent aa733fcf5f
commit 5a9cfc50ea
2 changed files with 11 additions and 11 deletions

View File

@ -235,7 +235,7 @@ protected:
private: private:
// override for custom behavior on received interface states // override for custom behavior on received interface states
virtual void initializeExternalInterfaces(InterfaceFlags expected); virtual void initializeExternalInterfaces();
}; };
PIMPL_FUNCTIONS(ParallelContainerBase) PIMPL_FUNCTIONS(ParallelContainerBase)
@ -263,7 +263,7 @@ protected:
container_type::const_iterator current_generator_; container_type::const_iterator current_generator_;
private: private:
void initializeExternalInterfaces(InterfaceFlags expected) override; void initializeExternalInterfaces() override;
template <typename Interface::Direction> template <typename Interface::Direction>
void onNewExternalState(Interface::iterator external, bool updated); void onNewExternalState(Interface::iterator external, bool updated);
void onNewFailure(const Stage& child, const InterfaceState* from, const InterfaceState* to) override; void onNewFailure(const Stage& child, const InterfaceState* from, const InterfaceState* to) override;

View File

@ -686,18 +686,18 @@ void ParallelContainerBasePrivate::resolveInterface(InterfaceFlags expected) {
if (exceptions) if (exceptions)
throw exceptions; throw exceptions;
initializeExternalInterfaces(expected);
required_interface_ = 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. // 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) { starts().reset(new Interface([this](Interface::iterator external, bool updated) {
this->propagateStateToChildren<Interface::FORWARD>(external, updated); this->propagateStateToChildren<Interface::FORWARD>(external, updated);
})); }));
if (expected & READS_END) if (requiredInterface() & READS_END)
ends().reset(new Interface([this](Interface::iterator external, bool updated) { ends().reset(new Interface([this](Interface::iterator external, bool updated) {
this->propagateStateToChildren<Interface::BACKWARD>(external, updated); this->propagateStateToChildren<Interface::BACKWARD>(external, updated);
})); }));
@ -851,19 +851,19 @@ void Fallbacks::onNewSolution(const SolutionBase& s) {
FallbacksPrivate::FallbacksPrivate(Fallbacks* me, const std::string& name) FallbacksPrivate::FallbacksPrivate(Fallbacks* me, const std::string& name)
: ParallelContainerBasePrivate(me, name) {} : ParallelContainerBasePrivate(me, name) {}
void FallbacksPrivate::initializeExternalInterfaces(InterfaceFlags expected) { void FallbacksPrivate::initializeExternalInterfaces() {
if (expected & READS_START) if (requiredInterface() & READS_START)
starts().reset(new Interface([this](Interface::iterator external, bool updated) { starts().reset(new Interface([this](Interface::iterator external, bool updated) {
this->onNewExternalState<Interface::FORWARD>(external, updated); this->onNewExternalState<Interface::FORWARD>(external, updated);
})); }));
if (expected & READS_END) if (requiredInterface() & READS_END)
ends().reset(new Interface([this](Interface::iterator external, bool updated) { ends().reset(new Interface([this](Interface::iterator external, bool updated) {
this->onNewExternalState<Interface::BACKWARD>(external, updated); this->onNewExternalState<Interface::BACKWARD>(external, updated);
})); }));
// we've got to set this somewhere once the interface flags are known. // we've got to set this somewhere once the interface flags are known.
// so we might as well do it here // so we might as well do it here
if(expected == GENERATE) if(requiredInterface() == GENERATE)
current_generator_ = children().begin(); current_generator_ = children().begin();
} }