ircam-ismm / pipo

pipo modules library
https://ircam-ismm.github.io/pipo
27 stars 2 forks source link

add pure virtual "connect" method to PiPo ? #1

Closed josephlarralde closed 6 years ago

josephlarralde commented 7 years ago

When creating a PiPo wrapping other PiPos, it is impossible to override the base "setReceiver" method without a cast when using polymorphism, because it is not pure virtual. Possible solution : add a pure virtual "connect(PiPo *receiver)" method that would in most cases simply call "setReceiver(receiver)" in its implementation, and in more complex cases allow more flexibility to deal with the connection process ? There could even be an intermediary "SimplePiPo" class from which all simple PiPos could inherit, implementing this default behaviour.

josephlarralde commented 6 years ago

This now concerns the pipo-sdk submodule, and has been solved by making setReceiver virtual in PiPo base class without generating any noticeable bug. Closing this issue.