DCPS: structs or valuetypes? PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Message/Author
Next message Ulf Sjöstedt  posted on Tuesday, February 03, 2009 - 10:06 am
Hi all,


In 7.2.2 of the spec, there is a brief rationale regarding the use of IDL structs to represent QoSPolicies.

My question is, in my Topic type design, should I be concerned over performance and avoid the use of valuetypes in favour of structs?

How much would it matter which implementation language I'm using? Java, C++, C, Ada?

Thanks,


/Uffe
Next message Reinier Torenbeek  posted on Friday, February 06, 2009 - 08:42 pm
Hello Uffe,

DCPS only supports a subset of IDL, and valuetypes are not in that subset. That answers your first question, I guess :-)

As far as your second question is concerned, are you asking this in the context of performance? It is hard to answer that in general. Different DDS implementations have different properties. For OpenSplice DDS, there is not that much performance difference between C, C++ and Java because all three languages are implemented as a thin layer on top of a common set of libraries written in C.
Of course, there are more aspects that differ between the languages, like resource usage, determinism, etc.

Hope this helps,
Reinier
Next message Ulf Sjöstedt  posted on Monday, February 09, 2009 - 03:57 pm
Hi again,


Well see, here's where I'm confused. I can't find a reference in the spec to the exact IDL subset mandated by the DCPS IDL PSM. Am I missing something - or is the spec? ;)

But let's back up a sec. What I'm after is the ability to allow my DCPS types to inherit from one another. Valuetypes would let me do that, and I'm pretty sure RTIDDS supports them - is there another way?

Cheers,


/Uffe
Next message Reinier Torenbeek  posted on Monday, February 09, 2009 - 04:40 pm
You are right, there is no explicit defintion in the spec about the support IDL subset. I think that is indeed an omission. However, the specific question about support for valuetypes is mentioned in section 8.2.1.1:
"Rationale to define DLRL entities mapping is slightly different from what ruled the DCPS mapping, mainly because this layer does not target C language. Therefore, valuetypes or exceptions have been considered as suitable at the DLRL level, while they have been rejected for DCPS."

Inheritance is supported by DLRL, not by DCPS. Depending on what you need, you could simulate inheritance in DCPS by means of embedding the 'parent' struct in your 'derived' struct. Other mechanisms are possible, but you would be more or less trying to build a DLRL yourself... You can take a look at the DLRL specification, which contains a default mapping showing DCPS Topcis used for distributing objects in an inheritance tree. What it boils down to is a topic model where the base class is represented by one topic and the derived part of the classes are represented by other topics. These base class and derived class topics are related to eachother by means of their keyvalues.

Hope this helps,
Reinier
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: