Skip to content

Commit 0bdc1cc

Browse files
authored
Change monitor service writer entity id (#5070)
* Refs #21371: Change monitor service writer entity id Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Add monitor service writer check Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Revert monitor service entity_id Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Uncrustify Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Remove extra header file Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Change return when statistics is not defined Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Fix windows unreachable code warning Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> --------- Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>
1 parent 08f5f72 commit 0bdc1cc

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/cpp/statistics/rtps/GuidUtils.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ namespace eprosima {
2929
namespace fastdds {
3030
namespace statistics {
3131

32+
/**
33+
* Checks whether an entity id corresponds to a builtin monitor service writer.
34+
* @param [in] entity_id The entity id to check.
35+
* @return true when the entity id corresponds to a builtin monitor service writer.
36+
*/
37+
inline bool is_monitor_service_builtin(
38+
const fastdds::rtps::EntityId_t& entity_id)
39+
{
40+
bool ret = false;
41+
#ifdef FASTDDS_STATISTICS
42+
ret = ENTITYID_MONITOR_SERVICE_WRITER == entity_id.to_uint32();
43+
#endif // ifdef FASTDDS_STATISTICS
44+
static_cast<void>(entity_id);
45+
return ret;
46+
}
47+
3248
/**
3349
* Checks whether an entity id corresponds to a builtin statistics writer.
3450
* @param [in] entity_id The entity id to check.
@@ -37,7 +53,7 @@ namespace statistics {
3753
inline bool is_statistics_builtin(
3854
const fastdds::rtps::EntityId_t& entity_id)
3955
{
40-
return 0x60 == (0xE0 & entity_id.value[3]);
56+
return 0x60 == (0xE0 & entity_id.value[3]) || is_monitor_service_builtin(entity_id);
4157
}
4258

4359
/**

0 commit comments

Comments
 (0)