Skip to content

Commit b2c116e

Browse files
committed
reset(new Interface()) -> std::make_shared<Interface>()
1 parent 442d39a commit b2c116e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

core/src/container.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ void SerialContainerPrivate::resolveInterface(InterfaceFlags expected) {
606606
validateInterface<START_IF_MASK>(*first.pimpl(), expected);
607607
// connect first child's (start) pull interface
608608
if (const InterfacePtr& target = first.pimpl()->starts())
609-
starts_.reset(new Interface([this, target](Interface::iterator it, bool updated) {
609+
starts_ = std::make_shared<Interface>([this, target](Interface::iterator it, bool updated) {
610610
this->copyState<Interface::FORWARD>(it, target, updated);
611-
}));
611+
});
612612
} catch (InitStageException& e) {
613613
exceptions.append(e);
614614
}
@@ -632,9 +632,9 @@ void SerialContainerPrivate::resolveInterface(InterfaceFlags expected) {
632632
validateInterface<END_IF_MASK>(*last.pimpl(), expected);
633633
// connect last child's (end) pull interface
634634
if (const InterfacePtr& target = last.pimpl()->ends())
635-
ends_.reset(new Interface([this, target](Interface::iterator it, bool updated) {
635+
ends_ = std::make_shared<Interface>([this, target](Interface::iterator it, bool updated) {
636636
this->copyState<Interface::BACKWARD>(it, target, updated);
637-
}));
637+
});
638638
} catch (InitStageException& e) {
639639
exceptions.append(e);
640640
}
@@ -733,13 +733,13 @@ void ParallelContainerBasePrivate::resolveInterface(InterfaceFlags expected) {
733733
void ParallelContainerBasePrivate::initializeExternalInterfaces() {
734734
// States received by the container need to be copied to all children's pull interfaces.
735735
if (requiredInterface() & READS_START)
736-
starts().reset(new Interface([this](Interface::iterator external, bool updated) {
736+
starts() = std::make_shared<Interface>([this](Interface::iterator external, bool updated) {
737737
this->propagateStateToChildren<Interface::FORWARD>(external, updated);
738-
}));
738+
});
739739
if (requiredInterface() & READS_END)
740-
ends().reset(new Interface([this](Interface::iterator external, bool updated) {
740+
ends() = std::make_shared<Interface>([this](Interface::iterator external, bool updated) {
741741
this->propagateStateToChildren<Interface::BACKWARD>(external, updated);
742-
}));
742+
});
743743
}
744744

745745
void ParallelContainerBasePrivate::validateInterfaces(const StagePrivate& child, InterfaceFlags& external,

core/src/stage.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,14 +510,14 @@ void PropagatingEitherWayPrivate::initInterface(PropagatingEitherWay::Direction
510510
case PropagatingEitherWay::FORWARD:
511511
required_interface_ = PROPAGATE_FORWARDS;
512512
if (!starts_) // keep existing interface if possible
513-
starts_.reset(new Interface());
513+
starts_ = std::make_shared<Interface>();
514514
ends_.reset();
515515
return;
516516
case PropagatingEitherWay::BACKWARD:
517517
required_interface_ = PROPAGATE_BACKWARDS;
518518
starts_.reset();
519519
if (!ends_) // keep existing interface if possible
520-
ends_.reset(new Interface());
520+
ends_ = std::make_shared<Interface>();
521521
return;
522522
case PropagatingEitherWay::AUTO:
523523
required_interface_ = UNKNOWN;
@@ -715,10 +715,10 @@ void MonitoringGeneratorPrivate::solutionCB(const SolutionBase& s) {
715715
}
716716

717717
ConnectingPrivate::ConnectingPrivate(Connecting* me, const std::string& name) : ComputeBasePrivate(me, name) {
718-
starts_.reset(new Interface(std::bind(&ConnectingPrivate::newState<Interface::BACKWARD>, this, std::placeholders::_1,
719-
std::placeholders::_2)));
720-
ends_.reset(new Interface(std::bind(&ConnectingPrivate::newState<Interface::FORWARD>, this, std::placeholders::_1,
721-
std::placeholders::_2)));
718+
starts_ = std::make_shared<Interface>(std::bind(&ConnectingPrivate::newState<Interface::BACKWARD>, this,
719+
std::placeholders::_1, std::placeholders::_2));
720+
ends_ = std::make_shared<Interface>(
721+
std::bind(&ConnectingPrivate::newState<Interface::FORWARD>, this, std::placeholders::_1, std::placeholders::_2));
722722
}
723723

724724
InterfaceFlags ConnectingPrivate::requiredInterface() const {

0 commit comments

Comments
 (0)