Skip to content

Commit aa732d8

Browse files
committed
simplify internal API
1 parent e56c772 commit aa732d8

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

core/include/moveit/task_constructor/container_p.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,16 @@ class ContainerBasePrivate : public StagePrivate
119119
protected:
120120
ContainerBasePrivate(ContainerBase* me, const std::string& name);
121121

122-
// Set child's push interfaces: allow pushing if child requires it or
123-
// if the interface is unknown: in this case greedily assume a push interface.
124-
// If, during pruneInterface() later, we notice that it's not needed, prune there.
125-
inline void setChildsPushBackwardInterface(Stage& child) {
126-
InterfaceFlags required = child.pimpl()->requiredInterface();
122+
// Set child's push interfaces: allow pushing if child requires it.
123+
inline void setChildsPushBackwardInterface(StagePrivate* child) {
124+
InterfaceFlags required = child->requiredInterface();
127125
bool allowed = (required & WRITES_PREV_END);
128-
child.pimpl()->setPrevEnds(allowed ? pending_backward_ : InterfacePtr());
126+
child->setPrevEnds(allowed ? pending_backward_ : InterfacePtr());
129127
}
130-
inline void setChildsPushForwardInterface(Stage& child) {
131-
InterfaceFlags required = child.pimpl()->requiredInterface();
128+
inline void setChildsPushForwardInterface(StagePrivate* child) {
129+
InterfaceFlags required = child->requiredInterface();
132130
bool allowed = (required & WRITES_NEXT_START);
133-
child.pimpl()->setNextStarts(allowed ? pending_forward_ : InterfacePtr());
131+
child->setNextStarts(allowed ? pending_forward_ : InterfacePtr());
134132
}
135133

136134
/// copy external_state to a child's interface and remember the link in internal_to map

core/src/container.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void SerialContainerPrivate::pruneInterface(InterfaceFlags accepted) {
436436
// FIRST child
437437
first.pimpl()->pruneInterface(accepted & START_IF_MASK);
438438
// connect first child's (start) push interface
439-
setChildsPushBackwardInterface(first);
439+
setChildsPushBackwardInterface(first.pimpl());
440440
// validate that first child's and this container's start interfaces match
441441
validateInterface<START_IF_MASK>(*first.pimpl(), accepted);
442442
// connect first child's (start) pull interface
@@ -453,7 +453,7 @@ void SerialContainerPrivate::pruneInterface(InterfaceFlags accepted) {
453453
}
454454

455455
// connect last child's (end) push interface
456-
setChildsPushForwardInterface(last);
456+
setChildsPushForwardInterface(last.pimpl());
457457
// validate that last child's and this container's end interfaces match
458458
validateInterface<END_IF_MASK>(*last.pimpl(), accepted);
459459
// connect last child's (end) pull interface
@@ -566,8 +566,8 @@ void ParallelContainerBasePrivate::pruneInterface(InterfaceFlags accepted) {
566566
child_impl->pruneInterface(accepted);
567567
validateInterfaces(*child_impl, accepted, first);
568568
// initialize push connections of children according to their demands
569-
setChildsPushForwardInterface(*child);
570-
setChildsPushBackwardInterface(*child);
569+
setChildsPushForwardInterface(child_impl);
570+
setChildsPushBackwardInterface(child_impl);
571571
first = false;
572572
} catch (InitStageException& e) {
573573
exceptions.append(e);

0 commit comments

Comments
 (0)