Generating StructType from XML

1 post / 0 new
jferguson75's picture
Offline
Last seen: 4 years 1 month ago
Joined: 01/28/2020
Posts: 4
Generating StructType from XML

Modern C++

I'm generating a DynamicType and then a StructType from an xml file.  The xml file is generated through reflection from some managed .NET classes.  In my program I'm referencing the unmanaged RTI libraries from .NET managed C++.  This seems to work fine.  I print out the IDL to the console just to confirm that the IDL looks correct.  Later in the code, I pass the StructType into a function that takes in a DynamicType.  At this point I get an error like below.  I suspect I'm doing something wrong when I generate the xml file for the message but I'm pretty green with all of this RTI stuff.

Here's the error I'm getting:

DDS_TypeObject_create_from_typecode:ERROR:  Failed to create TypeObject
DDS_TypeObject_convert_to_typecode:ERROR: Bad parameter:  self
DDS_TypeCodeFactory_copy_tcI:ERROR:  Bad parameter: tc_in 

 

The XML file looks like this:

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation = "rti_dds_qos_profiles.xsd">
<type_library name="Messages">
     <struct name="Message1">
          <member name="transactionid" type="string" key="true" />
          <member name="mode" type="string stringMaxLength="100" />
          <member name="type" type="long" />
     </struct>
</type_library>
</dds>

 

The IDL that I can print that is generated from that XML looks like this:

struct Message1 {
     string<255> transactionId; //@key
     //@ID 0
     string<100> mode;
     //@ID 1
     long type;
     //@ID 2
}; //@Extensibility EXTENSILE_EXTENSIBILITY

 

Any help would be fantastic.  Thanks!