[Rock-dev] Inheritance in base/types - the natural way to go?

Sylvain Joyeux bir.sylvain at gmail.com
Fri Apr 10 21:02:20 CEST 2015


> This would help different data-type port connections by subtype
> polymorphism.

No it would not, because connections cannot currently be made between
ports of two different types.

Let me say that again:
  if you  have OutputPort<A> and InputPort<B> with A != B (with !=
being defined strictly, not "can be converted to" but "is really
really the same") then RTT will not accept the connection

Or, another way:
  RTT port connections don't support data conversions

I hope that this time the idea will sink in.

For the rest of the discussion:
 - please PLEASE avoid putting templates everywhere. Multiple
inheritance does the job just fine for most cases, and templates make
understanding for most people that much harder. Yes, it might lead to
a little bit of code duplication, but I think it's worth the
simplicity it brings

Example:

  namespace samples
  {
     struct Transform : extensions::Timestamped, base::Transform
     {
     };
  }

 - there *is* already generic metadata for types in typelib, and for
ports in orogen_metadata. The whole point of METAdata is that it is
not part of the data. If you have METAdata in your samples, then it is
data, not METAdata.  In other words: don't overdo it.

Sylvain


More information about the Rock-dev mailing list