@@ -100,17 +100,9 @@ class StagePrivate
100100 inline InterfaceConstPtr prevEnds () const { return prev_ends_.lock (); }
101101 inline InterfaceConstPtr nextStarts () const { return next_starts_.lock (); }
102102
103- // / direction-based access to pull/push interfaces
104- inline InterfacePtr& pullInterface (Interface::Direction dir) { return dir == Interface::FORWARD ? starts_ : ends_; }
105- inline InterfacePtr pushInterface (Interface::Direction dir) {
106- return dir == Interface::FORWARD ? next_starts_.lock () : prev_ends_.lock ();
107- }
108- inline InterfaceConstPtr pullInterface (Interface::Direction dir) const {
109- return dir == Interface::FORWARD ? starts_ : ends_;
110- }
111- inline InterfaceConstPtr pushInterface (Interface::Direction dir) const {
112- return dir == Interface::FORWARD ? next_starts_.lock () : prev_ends_.lock ();
113- }
103+ // / direction-based access to pull interface
104+ template <Interface::Direction dir>
105+ inline InterfacePtr pullInterface ();
114106
115107 // / set parent of stage
116108 // / enforce only one parent exists
@@ -204,6 +196,15 @@ class StagePrivate
204196PIMPL_FUNCTIONS (Stage)
205197std::ostream& operator <<(std::ostream& os, const StagePrivate& stage);
206198
199+ template <>
200+ inline InterfacePtr StagePrivate::pullInterface<Interface::FORWARD>() {
201+ return starts_;
202+ }
203+ template <>
204+ inline InterfacePtr StagePrivate::pullInterface<Interface::BACKWARD>() {
205+ return ends_;
206+ }
207+
207208template <>
208209inline void StagePrivate::send<Interface::FORWARD>(const InterfaceState& start, InterfaceState&& end,
209210 const SolutionBasePtr& solution) {
0 commit comments