Skip to content

Commit

Permalink
Only use matched event
Browse files Browse the repository at this point in the history
Signed-off-by: Barry Xu <barry.xu@sony.com>
  • Loading branch information
Barry-Xu-2018 committed Mar 15, 2023
1 parent ab13561 commit f2c0310
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
2 changes: 0 additions & 2 deletions rmw/include/rmw/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rmw/include/rmw/events_statuses/events_statuses.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
35 changes: 17 additions & 18 deletions rmw/include/rmw/events_statuses/matched.h
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
}
Expand Down

0 comments on commit f2c0310

Please sign in to comment.