Skip to content

Commit

Permalink
Change monitor service writer entity id (#5070) (#5089)
Browse files Browse the repository at this point in the history
* 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>
(cherry picked from commit 0bdc1cc)

* Fix entity_id namespace

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

---------

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>
Co-authored-by: Raul Sanchez-Mateos Lizano <raul@eprosima.com>
  • Loading branch information
mergify[bot] and rsanchez15 authored Sep 6, 2024
1 parent 6ec6574 commit c73df11
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/cpp/statistics/rtps/GuidUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ namespace eprosima {
namespace fastdds {
namespace statistics {

/**
* Checks whether an entity id corresponds to a builtin monitor service writer.
* @param [in] entity_id The entity id to check.
* @return true when the entity id corresponds to a builtin monitor service writer.
*/
inline bool is_monitor_service_builtin(
const fastrtps::rtps::EntityId_t& entity_id)
{
bool ret = false;
#ifdef FASTDDS_STATISTICS
ret = ENTITYID_MONITOR_SERVICE_WRITER == entity_id.to_uint32();
#endif // ifdef FASTDDS_STATISTICS
static_cast<void>(entity_id);
return ret;
}

/**
* Checks whether an entity id corresponds to a builtin statistics writer.
* @param [in] entity_id The entity id to check.
Expand All @@ -37,7 +53,7 @@ namespace statistics {
inline bool is_statistics_builtin(
const fastrtps::rtps::EntityId_t& entity_id)
{
return 0x60 == (0xE0 & entity_id.value[3]);
return 0x60 == (0xE0 & entity_id.value[3]) || is_monitor_service_builtin(entity_id);
}

/**
Expand Down

0 comments on commit c73df11

Please sign in to comment.