OpenSplice: Publishing my own class PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Next message Shivesh Wangrungvichaisri  posted on Thursday, October 29, 2009 - 04:37 pm

Does OpenSplice support publishing my own class?

For example, I want to pubish a topic called "BigInteger" as described here:

I have an application that I want to publish a number that keeps growing forever (i.e. never overflows or wraps around).
Next message Reinier Torenbeek  posted on Thursday, October 29, 2009 - 05:01 pm
Hello Shivesh,

I will answer your question in the context of the DDS specification, since this is a vendor-independent forum.

The DDS specification consists of two parts: DCPS (Data Centric Publish/Subscribe) and DLRL (Data Local Reconstruction Layer). You can use either layer to do what you want.

If you want to publish something like this BigInteger with DCPS, you would only be publishing the state, or its data-members. Looking at the definition of this BigInteger class, it seems like the only members are
Sign sign;
BigUnsigned mag;
The Sign type is some enum, which is supported by DCPS. the BigUnsigned type on its turn contains some integer members and an array of unsigned longs. The latter can be mapped onto a sequence with DCPS. So all in all, it looks like the internal state of this class can be represented properly by a Topic in DDS.
You will have to create some mechanism yourself to translate the DDS Topic samples into BigInteger updates and vice versa. I can imagine that you could add two methods to the BigInteger class for this. You could even choose to encapsulate all DCPS actions and entities (dataReaders, dataWriters) in your own version of the BigInteger class and hide anything that has to do with the distribution.

However, you would almost be building a DLRL implementation then, which is basically an object oriented layer on top of DCPS. DLRL is more advanced and allows you to distribute the state of objects of classes defined in IDL (as opposed to structures with DCPS). DLRL encapsulate anything that has to do with DDS updates in your own BigInteger class instances, giving you a native OO look and feel at the application level. The middleware transparently takes care of the distribution of the internal state of the objects. You will still have to define a mapping from your C++ class data members onto a DCPS Topic though. You can read about this in detail in the DDS specification. Currently, OpenSplice is the only commercially available implementation of DLRL.

Hope this helps,
Next message Shivesh Wangrungvichaisri  posted on Friday, October 30, 2009 - 12:17 am
Pardon me for posting vendor-specific question. Thanks for your detailed answer, however!
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message