17.1.2.4. DomainParticipantListener

class eprosima::fastdds::dds::DomainParticipantListener : public eprosima::fastdds::dds::PublisherListener, public eprosima::fastdds::dds::SubscriberListener, public eprosima::fastdds::dds::TopicListener

Class DomainParticipantListener, overrides behaviour towards certain events.

Public Functions

DomainParticipantListener()

Constructor.

~DomainParticipantListener()

Destructor.

void on_participant_discovery(DomainParticipant *participant, fastrtps::rtps::ParticipantDiscoveryInfo &&info)

This method is called when a new Participant is discovered, or a previously discovered participant changes its QOS or is removed.

Parameters
  • participant: Pointer to the Participant which discovered the remote participant.

  • info: Remote participant information. User can take ownership of the object.

void onParticipantAuthentication(DomainParticipant *participant, fastrtps::rtps::ParticipantAuthenticationInfo &&info)

This method is called when a new Participant is authenticated.

Parameters
  • participant: Pointer to the authenticated Participant.

  • info: Remote participant authentication information. User can take ownership of the object.

void on_subscriber_discovery(DomainParticipant *participant, fastrtps::rtps::ReaderDiscoveryInfo &&info)

This method is called when a new Subscriber is discovered, or a previously discovered subscriber changes its QOS or is removed.

Parameters
  • participant: Pointer to the Participant which discovered the remote subscriber.

  • info: Remote subscriber information. User can take ownership of the object.

void on_publisher_discovery(DomainParticipant *participant, fastrtps::rtps::WriterDiscoveryInfo &&info)

This method is called when a new Publisher is discovered, or a previously discovered publisher changes its QOS or is removed.

Parameters
  • participant: Pointer to the Participant which discovered the remote publisher.

  • info: Remote publisher information. User can take ownership of the object.

void on_type_discovery(DomainParticipant *participant, const fastrtps::rtps::SampleIdentity &request_sample_id, const fastrtps::string_255 &topic, const fastrtps::types::TypeIdentifier *identifier, const fastrtps::types::TypeObject *object, fastrtps::types::DynamicType_ptr dyn_type)

This method is called when a participant discovers a new Type The ownership of all object belongs to the caller so if needs to be used after the method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature.

For example: fastrtps::types::TypeIdentifier new_type_id = *identifier;

void on_type_dependencies_reply(DomainParticipant *participant, const fastrtps::rtps::SampleIdentity &request_sample_id, const fastrtps::types::TypeIdentifierWithSizeSeq &dependencies)

This method is called when the typelookup client received a reply to a getTypeDependencies request.

The user may want to retrieve these new types using the getTypes request and create a new DynamicType using the retrieved TypeObject.

void on_type_information_received(DomainParticipant *participant, const fastrtps::string_255 topic_name, const fastrtps::string_255 type_name, const fastrtps::types::TypeInformation &type_information)

This method is called when a participant receives a TypeInformation while discovering another participant.