[DDS XTypes] How to configure struct ... PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Message/Author
Next message Jean-Christophe Cota  posted on Thursday, February 27, 2014 - 01:25 pm
Hello,

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 "7.2.4.5.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 ?

Many thanks,
JC.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message
Action: