given I have struct B extending struct A, I am trying to see if the spec makes it possible to have a match of DataWriters and DataReaders as follows:
1- a DataReader of A shall receive samples of a B instance written by a DataWriter of B 2- a DataReader of B shall not receive samples of a A instance written by a Datawriter of A
In other words, have A is-assignable-from B, but not the reverse.
My understanding of the spec is that the example in "126.96.36.199.2 Example: Type Inheritance" is also true the other way around: a consumer of LandVehicle should receive Vehicle instance samples. The resulting LandVehicle, as seen by the consumer, will have its "num_wheels" member either with no value or with a default value (i.e. 0) depending if the member is optional or not.
Finally the semantics I would like to achieve is similar as the one specified in HLA (IEEE 1516), where a subscriber of A will discover instances created by a publisher of B, but not the reverse.
Indeed common understanding of inheritance is the "is-a" relationship: an instance of B is also an instance of A, but an instance of A is not necessarily an instance of B.
Is there a way to tune the various qualifiers to obtain such behaviour ?