5555#include < fastdds/rtps/transport/UDPv4TransportDescriptor.hpp>
5656#include < fastdds/rtps/transport/UDPv6TransportDescriptor.hpp>
5757#include < fastdds/rtps/transport/NetworkBuffer.hpp>
58- #include < fastdds/rtps/writer/WriterDiscoveryInfo.hpp>
5958#include < fastdds/statistics/dds/domain/DomainParticipant.hpp>
6059#include < fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp>
6160#include < fastdds/statistics/topic_names.hpp>
@@ -234,11 +233,15 @@ class CustomDomainParticipantListener : public DomainParticipantListener
234233
235234 void on_data_writer_discovery (
236235 DomainParticipant* participant,
237- eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
236+ eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
237+ const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
238238 bool & should_be_ignored) override
239239 {
240+ static_cast <void >(participant);
241+ static_cast <void >(info);
242+
240243 should_be_ignored = false ;
241- if (info. status == eprosima::fastdds::rtps::WriterDiscoveryInfo ::DISCOVERED_WRITER )
244+ if (reason == eprosima::fastdds::rtps::WriterDiscoveryStatus ::DISCOVERED_WRITER )
242245 {
243246 std::cout << " New datawriter discovered" << std::endl;
244247 // The following line can be modified to evaluate whether the discovered datawriter should be ignored
@@ -249,7 +252,7 @@ class CustomDomainParticipantListener : public DomainParticipantListener
249252 should_be_ignored = true ; // Request the ignoring of the discovered datawriter
250253 }
251254 }
252- else if (info. status == eprosima::fastdds::rtps::WriterDiscoveryInfo ::REMOVED_WRITER )
255+ else if (reason == eprosima::fastdds::rtps::WriterDiscoveryStatus ::REMOVED_WRITER )
253256 {
254257 std::cout << " Datawriter lost" << std::endl;
255258 }
@@ -1024,17 +1027,18 @@ class DiscoveryDomainParticipantListener : public DomainParticipantListener
10241027 /* Custom Callback on_data_writer_discovery */
10251028 void on_data_writer_discovery (
10261029 DomainParticipant* participant,
1027- eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
1030+ eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
1031+ const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
10281032 bool & should_be_ignored) override
10291033 {
10301034 should_be_ignored = false ;
10311035 static_cast <void >(participant);
1032- switch (info. status ){
1033- case eprosima::fastdds::rtps::WriterDiscoveryInfo ::DISCOVERED_WRITER :
1036+ switch (reason ){
1037+ case eprosima::fastdds::rtps::WriterDiscoveryStatus ::DISCOVERED_WRITER :
10341038 {
10351039 /* Process the case when a new datawriter was found in the domain */
1036- std::cout << " New DataWriter publishing under topic '" << info.info . topicName () <<
1037- " ' of type '" << info.info . typeName () << " ' discovered" ;
1040+ std::cout << " New DataWriter publishing under topic '" << info.topic_name <<
1041+ " ' of type '" << info.type_name << " ' discovered" ;
10381042 /* The following line can be substituted to evaluate whether the discovered datawriter should be ignored */
10391043 bool ignoring_condition = false ;
10401044 if (ignoring_condition)
@@ -1043,13 +1047,13 @@ class DiscoveryDomainParticipantListener : public DomainParticipantListener
10431047 }
10441048 }
10451049 break ;
1046- case eprosima::fastdds::rtps::WriterDiscoveryInfo ::CHANGED_QOS_WRITER :
1050+ case eprosima::fastdds::rtps::WriterDiscoveryStatus ::CHANGED_QOS_WRITER :
10471051 /* Process the case when a datawriter changed its QOS */
10481052 break ;
1049- case eprosima::fastdds::rtps::WriterDiscoveryInfo ::REMOVED_WRITER :
1053+ case eprosima::fastdds::rtps::WriterDiscoveryStatus ::REMOVED_WRITER :
10501054 /* Process the case when a datawriter was removed from the domain */
1051- std::cout << " DataWriter publishing under topic '" << info.info . topicName () <<
1052- " ' of type '" << info.info . typeName () << " ' left the domain." ;
1055+ std::cout << " DataWriter publishing under topic '" << info.topic_name <<
1056+ " ' of type '" << info.type_name << " ' left the domain." ;
10531057 break ;
10541058 }
10551059 }
@@ -1111,14 +1115,15 @@ class RemoteDiscoveryDomainParticipantListener : public DomainParticipantListene
11111115 /* Custom Callback on_data_writer_discovery */
11121116 void on_data_writer_discovery (
11131117 DomainParticipant* participant,
1114- eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
1118+ eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
1119+ const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
11151120 bool & should_be_ignored) override
11161121 {
11171122 should_be_ignored = false ;
11181123 // Get remote type information
11191124 xtypes::TypeObject remote_type_object;
11201125 if (RETCODE_OK != DomainParticipantFactory::get_instance ()->type_object_registry ().get_type_object (
1121- info.info . type_information () .type_information .complete ().typeid_with_size ().type_id (),
1126+ info.type_information .type_information .complete ().typeid_with_size ().type_id (),
11221127 remote_type_object))
11231128 {
11241129 // Error
@@ -1132,7 +1137,7 @@ class RemoteDiscoveryDomainParticipantListener : public DomainParticipantListene
11321137
11331138 // Create a Topic with the remotely discovered type.
11341139 Topic* topic =
1135- participant->create_topic (info.info . topicName () .to_string (), dyn_type_support.get_type_name (),
1140+ participant->create_topic (info.topic_name .to_string (), dyn_type_support.get_type_name (),
11361141 TOPIC_QOS_DEFAULT );
11371142 if (nullptr == topic)
11381143 {
@@ -1195,13 +1200,14 @@ class TypeIntrospectionSubscriber : public DomainParticipantListener
11951200 /* Custom Callback on_data_writer_discovery */
11961201 void on_data_writer_discovery (
11971202 DomainParticipant* /* participant */ ,
1198- eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
1203+ eprosima::fastdds::rtps::WriterDiscoveryStatus /* reason*/ ,
1204+ const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
11991205 bool & /* should_be_ignored */ ) override
12001206 {
12011207 // Get remote type information
12021208 xtypes::TypeObject remote_type_object;
12031209 if (RETCODE_OK != DomainParticipantFactory::get_instance ()->type_object_registry ().get_type_object (
1204- info.info . type_information () .type_information .complete ().typeid_with_size ().type_id (),
1210+ info.type_information .type_information .complete ().typeid_with_size ().type_id (),
12051211 remote_type_object))
12061212 {
12071213 // Error
0 commit comments