From f2c031016d63f561bcd0771f0e4bd2cc90aae950 Mon Sep 17 00:00:00 2001 From: Barry Xu Date: Wed, 15 Mar 2023 10:28:46 +0800 Subject: [PATCH] Only use matched event Signed-off-by: Barry Xu --- rmw/include/rmw/event.h | 2 -- .../rmw/events_statuses/events_statuses.h | 2 +- rmw/include/rmw/events_statuses/matched.h | 35 +++++++++---------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/rmw/include/rmw/event.h b/rmw/include/rmw/event.h index cfec3dd4..9ed81c81 100644 --- a/rmw/include/rmw/event.h +++ b/rmw/include/rmw/event.h @@ -38,14 +38,12 @@ typedef enum rmw_event_type_e RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE, RMW_EVENT_MESSAGE_LOST, RMW_EVENT_SUBSCRIPTION_MATCHED, - RMW_EVENT_SUBSCRIPTION_UNMATCHED, // publisher events RMW_EVENT_LIVELINESS_LOST, RMW_EVENT_OFFERED_DEADLINE_MISSED, RMW_EVENT_OFFERED_QOS_INCOMPATIBLE, RMW_EVENT_PUBLICATION_MATCHED, - RMW_EVENT_PUBLICATION_UNMATCHED, // sentinel value RMW_EVENT_INVALID diff --git a/rmw/include/rmw/events_statuses/events_statuses.h b/rmw/include/rmw/events_statuses/events_statuses.h index 42c59757..0576d882 100644 --- a/rmw/include/rmw/events_statuses/events_statuses.h +++ b/rmw/include/rmw/events_statuses/events_statuses.h @@ -18,9 +18,9 @@ #include "rmw/events_statuses/incompatible_qos.h" #include "rmw/events_statuses/liveliness_changed.h" #include "rmw/events_statuses/liveliness_lost.h" +#include "rmw/events_statuses/matched.h" #include "rmw/events_statuses/message_lost.h" #include "rmw/events_statuses/offered_deadline_missed.h" #include "rmw/events_statuses/requested_deadline_missed.h" -#include "rmw/events_statuses/matched.h" #endif // RMW__EVENTS_STATUSES__EVENTS_STATUSES_H_ diff --git a/rmw/include/rmw/events_statuses/matched.h b/rmw/include/rmw/events_statuses/matched.h index 0f52ebef..f819f77c 100644 --- a/rmw/include/rmw/events_statuses/matched.h +++ b/rmw/include/rmw/events_statuses/matched.h @@ -1,4 +1,4 @@ -// Copyright 2022 Sony Group Corporation. +// Copyright 2023 Sony Group Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,35 +25,34 @@ extern "C" { #endif -struct RMW_PUBLIC_TYPE rmw_matched_unmatched_status_s +struct RMW_PUBLIC_TYPE rmw_matched_status_s { + /** + * For publisher, the total cumulative count of subscribers matched to the concerned publisher. + * + * For subscriber, the total cumulative count of publishers matched to the concerned subscriber. + */ + size_t total_count; + + /** + * total_count change since last time the status was read. + */ + size_t total_count_change; + /** * For publisher, the number of subscribers currently matched to the concerned publisher. * * For subscriber, the number of publishers currently matched to the concerned subscriber. */ - int32_t current_matched_count; + size_t current_count; /** - * Matched or unmatched count since the last time the status was read. - * - * For publisher - * If you get matched status, this count means the number of subscribers matched to the - * concerned publisher. - * If you get unmatched status, this count means the number of subscribers unmatched to - * the concerned publisher. - * - * For subscriber - * If you get matched status, this count means the number of publishers matched to the - * concerned subscriber. - * If you get unmatched status, this count means the number of publishers unmatched to - * the concerned subscriber. + * The current_count change since last time the status was read. */ int32_t current_count_change; }; -typedef struct rmw_matched_unmatched_status_s rmw_matched_status_t; -typedef struct rmw_matched_unmatched_status_s rmw_unmatched_status_t; +typedef struct rmw_matched_status_s rmw_matched_status_t; #ifdef __cplusplus }