Convert received data to a CORBA::Any

6 posts / 0 new
Last post
Offline
Last seen: 4 years 8 months ago
Joined: 11/13/2014
Posts: 11
Convert received data to a CORBA::Any

Hi,


I am pretty new to the DDS world and trying to create an interface where where I can subscribe to a topic and receive a TypeLess Data structure convert it into a CORBA::Any.  Do you have any examples that you would suggest or point me toward?  Any help/ideas would be much appreciated.


Thanks,

Steve

Organization:
jwillemsen's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 09/24/2013
Posts: 53

When you are using the CORBA Compatiblity Kit together with TAO you can use the TAO generated types which you can insert and extract into a CORBA::Any using the normal CORBA any insertion support.

Offline
Last seen: 4 years 8 months ago
Joined: 11/13/2014
Posts: 11

Thanks you for the info.  Is the CORBA combatibility kit a part of RTI's DDS or do I get it somewhere else.  Is the any examples that you know of that would show me how to use it?  I appreciate any information.

Thanks,

Steve

jwillemsen's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 09/24/2013
Posts: 53

The CCK is an additional product from RTI, contact your RTI account manager to get a copy. The CCK does ship with some examples and documentation

We use the CCK as part of the CIAO DDS4CCM implementation, you can obtain that from http://download.dre.vanderbilt.edu. See ACE_wrappers/TAO/CIAO/connectors/dds4ccm/DDS4CCM-INSTALL.html for how to compile DDS4CCM. The DDS4CCM examples all use the CCK.

Offline
Last seen: 4 years 8 months ago
Joined: 11/13/2014
Posts: 11

I appreciate all of your help.  The only problem with using the CORBA that I can see is that I am still dependent on the idl at build time.  I'm trying to be idl independent.  I am trying to incorporate an RTI interface into a generic recorder.  The recorder would just be taking the data received from RTI and converting it to a byte stream for storage.  The idea is that we are trying to make the recorder agnostic to any data type.  Is there any way to create a generic type (idl independent) subscription to retrieve RTI topic data?  Any help is much appreciated.

Gerardo Pardo's picture
Offline
Last seen: 1 day 1 hour ago
Joined: 06/02/2010
Posts: 589

Hello Steve,

Is this question/use-case the same as the one you posted here: http://community.rti.com/forum-topic/dynamicdata-0? If so your reference to CORBA::Any confused me...

Getting the data into a generic byte-stream without having access to the IDL is possible . This is what tools like the RTI Recording Service does. If you wanted to convert them to a CORBA::Any from that, then you would need to use some CORBA SDK that understands that format, or write that part by hand.  But if all you need is the data as a stream of bytes then you would not need anything else. It does however require using some trickery and non-public APIs. I will post more details in the answer to:  http://community.rti.com/forum-topic/dynamicdata-0 when I get a chance.

It is also possible to use the DynamicData and DynamicType APIs to dynamically determine the data-types and then act on the typed data (see the source code example in http://community.rti.com/filedepot?cid=6&fid=20). This would not require knowledge of the IDL at compile time. This does not give you access to the raw bytes but if you needed to convert it inot a CORBA::Any this may be what you need.

Edited 11/20/2014. In addition to the above I have created an example illustrating how to use DynamicData to receive data as "raw bytes" thus not needed knowledge of the data-type at compile time. The example is called monitor_raw_data and is available the File Exchange, or directly at this link.  Note that it uses internal APIs which may change or go away in future releases. This forum thread on dynamic data also has relevant infrmation on this.

Gerardo