Skip to content

Commit

Permalink
Add _STATUS suffix to EntityStatus (#215)
Browse files Browse the repository at this point in the history
Signed-off-by: Irene Bandera <[email protected]>
  • Loading branch information
irenebm authored Dec 5, 2023
1 parent 902f9bc commit c029132
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions docs/rst/exports/alias.include
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
.. |LOCATOR-api| replace:: :cpp:enumerator:`LOCATOR<eprosima::statistics_backend::EntityKind::LOCATOR>`

.. |EntityStatus-api| replace:: :cpp:type:`EntityStatus<eprosima::statistics_backend::EntityStatus>`
.. |OK-api| replace:: :cpp:enumerator:`OK<eprosima::statistics_backend::EntityStatus::OK>`
.. |WARNING-api| replace:: :cpp:enumerator:`WARNING<eprosima::statistics_backend::EntityStatus::WARNING>`
.. |ERROR-api| replace:: :cpp:enumerator:`ERROR<eprosima::statistics_backend::EntityStatus::ERROR>`
.. |OK-api| replace:: :cpp:enumerator:`OK<eprosima::statistics_backend::EntityStatus::OK_STATUS>`
.. |WARNING-api| replace:: :cpp:enumerator:`WARNING<eprosima::statistics_backend::EntityStatus::WARNING_STATUS>`
.. |ERROR-api| replace:: :cpp:enumerator:`ERROR<eprosima::statistics_backend::EntityStatus::ERROR_STATUS>`

.. |BadParameter-api| replace:: :cpp:type:`BadParameter<eprosima::statistics_backend::BadParameter>`
.. |Error-api| replace:: :cpp:type:`Error<eprosima::statistics_backend::Error>`
Expand Down
6 changes: 3 additions & 3 deletions include/fastdds_statistics_backend/types/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ enum class EntityKind
enum class EntityStatus
{
/// Ok entity status
OK,
OK_STATUS,

/// Warning entity status
WARNING,
WARNING_STATUS,

/// Error entity status
ERROR,
ERROR_STATUS,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/database/entities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DDSEndpoint::DDSEndpoint(
std::string endpoint_guid, /* "|GUID UNKNOWN|" */
details::fragile_ptr<DomainParticipant> endpoint_participant, /* nullptr */
details::fragile_ptr<Topic> endpoint_topic, /* nullptr */
EntityStatus status /* EntityStatus::OK */) noexcept
EntityStatus status /* EntityStatus::OK_STATUS */) noexcept
: DDSEntity(entity_kind, endpoint_name, endpoint_qos, endpoint_guid, status)
, participant(endpoint_participant)
, topic(endpoint_topic)
Expand Down
22 changes: 11 additions & 11 deletions src/cpp/database/entities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct Entity
std::string entity_name = "INVALID",
bool entity_metatraffic = false,
bool entity_active = true,
EntityStatus entity_status = EntityStatus::OK) noexcept
EntityStatus entity_status = EntityStatus::OK_STATUS) noexcept
: kind(entity_kind)
, name(entity_name)
, alias(entity_name)
Expand Down Expand Up @@ -112,7 +112,7 @@ struct Host : Entity
{
Host(
std::string host_name,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(EntityKind::HOST, host_name, false, false, status)
{
}
Expand All @@ -137,7 +137,7 @@ struct User : Entity
User(
std::string user_name,
details::fragile_ptr<Host> user_host,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(EntityKind::USER, user_name, false, false, status)
, host(user_host)
{
Expand Down Expand Up @@ -167,7 +167,7 @@ struct Process : Entity
std::string process_name,
std::string process_id,
details::fragile_ptr<User> process_user,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(EntityKind::PROCESS, process_name, false, false, status)
, pid(process_id)
, user(process_user)
Expand Down Expand Up @@ -200,7 +200,7 @@ struct Domain : Entity
{
Domain(
std::string domain_name,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(EntityKind::DOMAIN, domain_name, false, true, status)
{
}
Expand Down Expand Up @@ -233,7 +233,7 @@ struct DDSEntity : Entity
std::string dds_entity_name = "INVALID",
Qos dds_entity_qos = {},
std::string dds_entity_guid = "|GUID UNKNOWN|",
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(entity_kind, dds_entity_name, false, true, status)
, qos(dds_entity_qos)
, guid(dds_entity_guid)
Expand All @@ -259,7 +259,7 @@ struct DDSEndpoint : DDSEntity
std::string endpoint_guid = "|GUID UNKNOWN|",
details::fragile_ptr<DomainParticipant> endpoint_participant = nullptr,
details::fragile_ptr<Topic> endpoint_topic = nullptr,
EntityStatus status = EntityStatus::OK) noexcept;
EntityStatus status = EntityStatus::OK_STATUS) noexcept;

//! Reference to the DomainParticipant in which this Endpoint runs.
details::fragile_ptr<DomainParticipant> participant;
Expand Down Expand Up @@ -288,7 +288,7 @@ struct DomainParticipant : DDSEntity
std::string participant_guid,
details::fragile_ptr<Process> participant_process,
details::fragile_ptr<Domain> participant_domain,
EntityStatus status = EntityStatus::OK,
EntityStatus status = EntityStatus::OK_STATUS,
AppId participant_app_id = AppId::UNKNOWN,
std::string participant_app_metadata = "") noexcept
: DDSEntity(EntityKind::PARTICIPANT, participant_name, participant_qos, participant_guid, status)
Expand Down Expand Up @@ -346,7 +346,7 @@ struct Topic : Entity
std::string topic_name,
std::string topic_type,
details::fragile_ptr<Domain> topic_domain,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: Entity(EntityKind::TOPIC, topic_name, is_metatraffic_topic(topic_name), true, status)
, data_type(topic_type)
, domain(topic_domain)
Expand Down Expand Up @@ -391,7 +391,7 @@ struct DataReader : DDSEndpoint
std::string datareader_guid,
details::fragile_ptr<DomainParticipant> datareader_participant,
details::fragile_ptr<Topic> datareader_topic,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: DDSEndpoint(EntityKind::DATAREADER, datareader_name, datareader_qos, datareader_guid, datareader_participant,
datareader_topic, status)
{
Expand All @@ -418,7 +418,7 @@ struct DataWriter : DDSEndpoint
std::string datawriter_guid,
details::fragile_ptr<DomainParticipant> datawriter_participant,
details::fragile_ptr<Topic> datawriter_topic,
EntityStatus status = EntityStatus::OK) noexcept
EntityStatus status = EntityStatus::OK_STATUS) noexcept
: DDSEndpoint(EntityKind::DATAWRITER, datawriter_name, datawriter_qos, datawriter_guid, datawriter_participant,
datawriter_topic, status)
{
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/subscriber/StatisticsParticipantListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void StatisticsParticipantListener::on_participant_discovery(
discovery_info.app_id = AppId::UNKNOWN;
discovery_info.app_metadata = "";

discovery_info.entity_status = EntityStatus::OK;
discovery_info.entity_status = EntityStatus::OK_STATUS;

switch (info.status)
{
Expand Down Expand Up @@ -235,7 +235,7 @@ void StatisticsParticipantListener::on_participant_discovery(
datawriter_discovery_info.qos = meta_traffic_qos;
datawriter_discovery_info.alias = metatraffic_alias;
datawriter_discovery_info.is_virtual_metatraffic = true;
datawriter_discovery_info.entity_status = EntityStatus::OK;
datawriter_discovery_info.entity_status = EntityStatus::OK_STATUS;
datawriter_discovery_info.discovery_status = discovery_info.discovery_status;
entity_queue_->push(timestamp, datawriter_discovery_info);
}
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/Database/DatabaseDomainViewGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class database_domain_view_graph_tests : public ::testing::Test
"01.02.03.04.05.06.07.08.09.0a.0b.0c|0.0.1.c1",
std::shared_ptr<database::Process>(),
domain,
EntityStatus::OK,
EntityStatus::OK_STATUS,
AppId::UNKNOWN,
"");

Expand All @@ -100,7 +100,7 @@ class database_domain_view_graph_tests : public ::testing::Test
"01.02.03.04.05.06.07.08.09.0a.0b.0c|0.0.1.c3",
std::shared_ptr<database::Process>(),
domain,
EntityStatus::OK,
EntityStatus::OK_STATUS,
AppId::UNKNOWN,
"");

Expand Down

0 comments on commit c029132

Please sign in to comment.