Dynamic types in C#?

4 posts / 0 new
Last post
Offline
Last seen: 1 year 1 month ago
Joined: 05/13/2023
Posts: 12
Dynamic types in C#?

 

Hello there... still working through the Windows RTI connext stuff, and making sure we can get everything we need into a single, simple-enough project.

In a phone call, Andy helped to a breakthrough by telling me about lines 35-49 (approx) of Shapes_publisher.cxx, and that if you uncomment them you can configure data mapping at run time, by creating a StructType and then using the add_member method.

I was wondering, is this functionality also available in C#? 

If it were, it would consolidate everything we need into one project (instead of linking a C++ DLL to C#, which relatively is a big development and config control headache).

Thanks -- Chris

 *** 

update

I compared example runPublisher code for C++ and C#, and I don't see an equivalent of dds::core::xtypes::DynamicData or dds::core::xtypes::StructType in C#.  Maybe that's my answer, it's not supported?

 

 

 

 

 

PK_RTI's picture
Offline
Last seen: 2 days 1 hour ago
Joined: 07/01/2021
Posts: 28

I'm not a C# expert, but there are a large number of examples in the GitHub repository that is discussed here:

https://community.rti.com/examples/list-connext-dds-c-examples

I imagine someone with more expertise may weigh in, as well.

Offline
Last seen: 10 months 1 week ago
Joined: 05/21/2023
Posts: 1

The C# API manual has an example of dynamically creating a sample:

https://community.rti.com/static/documentation/connext-dds/6.1.2/doc/api/connext_dds/api_csharp/group___d_d_s_dynamic_data_example_module.html

The C# API is full-featured but the syntax and possibly style may be different than other languages (C++ Modern or Legacy).

Note that the dotNet Connector has been replaced by this full C# API so if you find Connextor examples, I'd recommend avoiding those and finding C# API examples.

Offline
Last seen: 1 year 1 month ago
Joined: 05/13/2023
Posts: 12

Thank you!  I'll give it a shot tonight.