Hello.
I am migrating an application from DDS C# API 6.0 to 7.3. I have a call to....
Subscriber.DATAREADER_QOS_USE_TOPIC_QOS
the return of which is passed to the subscriber.CreateDataReader function.
What is the replacement for Subscriber.DATAREADER_QOS_USE_TOPIC_QOS, in the DDS Connext C# 7.3 API?
I've looked around quiet a lot and can't find something equivalent. There is a QosProvider.GetReaderQosWithTopicName but I'm not sure that's exactly right.
Thanks, Jon
There is equivalent functionality, but it takes more work. You have to get access to the Topic's QOS and then use that to create the DataReader's QOS that is used to create the DataReader.
Use DataReaderQos.FromTopicQos(TopicQos topicQos) or the extension method ToDataReaderQos() on a TopicQos object.
https://community.rti.com/static/documentation/connext-dds/current/doc/api/connext_dds/api_csharp/classRti_1_1Dds_1_1Subscription_1_1DataReaderQos.html#a821ab3453cfd290b059ebceccae3948d
or
https://community.rti.com/static/documentation/connext-dds/current/doc/api/connext_dds/api_csharp/classRti_1_1Dds_1_1Topics_1_1TopicQos.html#a4775dc66011ac55c5c8b195eb43483c2
Example:
// Assume 'topic' is a Topic<T> object var topicQos = topic.Qos; // Create a DataReaderQos from the TopicQos var readerQos = topicQos.ToDataReaderQos(); // Optionally, merge with the default DataReaderQos from the Subscriber readerQos = subscriber.DefaultDataReaderQos.WithPoliciesFrom(readerQos); // Create the DataReader with the combined QoS var reader = subscriber.CreateDataReader(topic, readerQos);
By the way, I used the RTI Chatbot @ https://chatbot.rti.com to help compose my response. You should try this for your questions in the future as it may provide responses faster than humans on the forum!
Hello
Yes, that is what I was looking for.
I didn't know abotu that chat bot. That will come in handy.
Thank you for replying, Jon