0

I use DDS Opensplice community version 6.7. At the moment when I create a topic, I use QoS xml configuration file. The QoS config file sets settings such as liveliness and resource_limits for a topic.

I know that if you don't use QoS config file, which default QoS will be used, you can use "dds::core::policy::WriterDataLifecycle::ManuallyDisposeUnregisteredInstances()" to manually register/unregister/dispose topic instance.

I want to know while I using the QoS config file, how can I do the same to manually register/unregister/dispose topic instance?

Is there any entry in QoS config file that corresponds to ManuallyDisposeUnregisteredInstances?

Stoogy
  • 1,307
  • 3
  • 16
  • 34
Jia Liang Liu
  • 13
  • 1
  • 6

1 Answers1

0

If you use

dds::core::policy::WriterDataLifecycle::ManuallyDisposeUnregisteredInstances 

Documentation states:

Returns a WriterDataLifecycle QoS instance with autodispose_unregistered_instances set to false

You can update the XML QoS as follow:

<datawriter_qos>
  <writer_data_lifecycle>
      <autodispose_unregistered_instances>
           false
      </autodispose_unregistered_instances>
  </writer_data_lifecycle>
</datawriter_qos>

However, this is not for a topic but for a DataWriter.

Stoogy
  • 1,307
  • 3
  • 16
  • 34
  • thanks a lot Stoogy. I have a slightly different problem now. because all our readers and writers in our system use the same TopicQos file, otherwise it will have Qos unmatch problem. so I try to do something like the following: dds::pub::qos::DataWriterQos dwqos = sensor_track_topic.qos(); dwqos << dds::core::policy::WriterDataLifecycle::ManuallyDisposeUnregisteredInstances(); auto writer = dds::pub::DataWriter(pub, sensor_track_topic, dwqos); but with this code, the topic instances seem not being disposed even writer.dispose_instance(handle); – Jia Liang Liu May 08 '19 at 11:53
  • and while you here, do you know the answer of this question which can help to tackle the problem: I want to know how to find out the number of topic instances of a topic in the current domain. I know that with the use of build-in topic "DCPSTopic", the samples of this build in topic "DCPSTopic" tell you how many topics (not topic instances) in the current domain, but I need to know the number of topic instances of every topic in the current domain. – Jia Liang Liu May 08 '19 at 11:59
  • I think it is better that you ask a new question. – Stoogy May 13 '19 at 17:17