18.1.2.4. DomainParticipantListener

class 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

inline DomainParticipantListener()

Constructor.

inline virtual ~DomainParticipantListener()

Destructor.

inline virtual void on_participant_discovery(DomainParticipant *participant, fastrtps::rtps::ParticipantDiscoveryInfo &&info, bool &should_be_ignored)

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

Parameters
  • participant[out] Pointer to the Participant which discovered the remote participant.

  • info[out] Remote participant information. User can take ownership of the object.

  • should_be_ignored[out] Flag to indicate the library to automatically ignore the discovered Participant.

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

This method is called when a new Participant is authenticated.

Parameters
  • participant[out] Pointer to the authenticated Participant.

  • info[out] Remote participant authentication information. User can take ownership of the object.

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

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

Parameters
  • participant[out] Pointer to the Participant which discovered the remote DataReader.

  • info[out] Remote DataReader information. User can take ownership of the object.

inline virtual void on_subscriber_discovery(DomainParticipant *participant, fastrtps::rtps::ReaderDiscoveryInfo &&info, bool &should_be_ignored)

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

Warning

Not Supported. This callback will never be called in the current version.

Parameters
  • participant[out] Pointer to the Participant which discovered the remote DataReader.

  • info[out] Remote DataReader information. User can take ownership of the object.

  • should_be_ignored[out] Flag to indicate the library to automatically ignore the discovered DataReader.

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

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

Parameters
  • participant[out] Pointer to the Participant which discovered the remote DataWriter.

  • info[out] Remote DataWriter information. User can take ownership of the object.

inline virtual void on_publisher_discovery(DomainParticipant *participant, fastrtps::rtps::WriterDiscoveryInfo &&info, bool &should_be_ignored)

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

Warning

Not Supported. This callback will never be called in the current version.

Parameters
  • participant[out] Pointer to the Participant which discovered the remote DataWriter.

  • info[out] Remote DataWriter information. User can take ownership of the object.

  • should_be_ignored[out] Flag to indicate the library to automatically ignore the discovered DataWriter.

inline virtual 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;

inline virtual 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.

inline virtual 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.