Class RMWSubscriptionEvent

Inheritance Relationships

Base Type

Class Documentation

class RMWSubscriptionEvent : public EventListenerInterface

Public Functions

explicit RMWSubscriptionEvent(CustomSubscriberInfo *info)
void set_on_new_message_callback(const void *user_data, rmw_event_callback_t callback)
virtual eprosima::fastdds::dds::StatusCondition &get_statuscondition() const override
virtual bool take_event(rmw_event_type_t event_type, void *event_info) override

Take ready data for an event type.

Parameters:
  • event_type – The event type to get data for.

  • event_info – A preallocated event information (from rmw/types.h) to fill with data

Returns:

true if data was successfully taken.

Returns:

false if data was not available, in this case nothing was written to event_info.

virtual void set_on_new_event_callback(rmw_event_type_t event_type, const void *user_data, rmw_event_callback_t callback) override

Provide handlers to perform an action when a new event from this listener has occurred.

Parameters:
  • event_type – The event type to set a new callback for.

  • user_data – User data to associated with the event.

  • callback – The callback to call when the event occurs.

virtual void update_inconsistent_topic(uint32_t total_count, uint32_t total_count_change) override

Callback to update the internal inconsistent topic data.

Parameters:
  • total_count – The total number of inconsistent topic events for all time.

  • total_count_change – The number of inconsistent topic events being reported right now.

void track_unique_publisher(eprosima::fastrtps::rtps::GUID_t guid)

Add a GUID to the internal set of unique publishers matched to this subscription.

This is so we can provide the RMW layer with an accurate count of matched publishers if the user calls rmw_count_publishers().

Parameters:

guid[in] The GUID of the newly-matched publisher to track.

void untrack_unique_publisher(eprosima::fastrtps::rtps::GUID_t guid)

Remove a GUID from the internal set of unique publishers matched to this subscription.

This is so we can provide the RMW layer with an accurate count of matched publishers if the user calls rmw_count_publishers().

Parameters:

guid[in] The GUID of the newly-unmatched publisher to track.

size_t publisher_count() const

Return the number of unique publishers matched to this subscription.

Returns:

Number of unique publishers matched to this subscription.

void update_data_available()
void update_requested_deadline_missed(uint32_t total_count, uint32_t total_count_change)
void update_liveliness_changed(uint32_t alive_count, uint32_t not_alive_count, uint32_t alive_count_change, uint32_t not_alive_count_change)
void update_sample_lost(uint32_t total_count, uint32_t total_count_change)
void update_requested_incompatible_qos(eprosima::fastdds::dds::QosPolicyId_t last_policy_id, uint32_t total_count, uint32_t total_count_change)
void update_matched(int32_t total_count, int32_t total_count_change, int32_t current_count, int32_t current_count_change)