diff --git a/ddspipe_core/include/ddspipe_core/configuration/DdsPipeConfiguration.hpp b/ddspipe_core/include/ddspipe_core/configuration/DdsPipeConfiguration.hpp index c03e9806..9d86ac9a 100644 --- a/ddspipe_core/include/ddspipe_core/configuration/DdsPipeConfiguration.hpp +++ b/ddspipe_core/include/ddspipe_core/configuration/DdsPipeConfiguration.hpp @@ -32,12 +32,12 @@ namespace eprosima { namespace ddspipe { namespace core { -enum EntityCreationTrigger +enum DiscoveryTrigger { - READER = 0, //! The discovery of readers triggers the creation of entities. - WRITER = 1, //! The discovery of writers triggers the creation of entities. - NONE = 2, //! The discovery of either readers and writers doesn't trigger the creation of entities. - ANY = 3 //! The discovery of both readers and writers triggers the creation of entities. + READER = 0, //! The discovery callbacks get triggered by the discovery of a reader. + WRITER = 1, //! The discovery callbacks get triggered by the discovery of a writer. + NONE = 2, //! The discovery callbacks don't get triggered by the discovery of readers or writers. + ANY = 3 //! The discovery callbacks get triggered by the discovery of either a reader or a writer. }; /** @@ -116,8 +116,8 @@ struct DdsPipeConfiguration : public IConfiguration //! Whether the DDS Pipe should be initialized enabled. bool init_enabled = false; - //! The entity type whose discovery should trigger the creation of entities. - EntityCreationTrigger entity_creation_trigger = EntityCreationTrigger::READER; + //! The type of the entity whose discovery should trigger the discovery callbacks. + DiscoveryTrigger discovery_trigger = DiscoveryTrigger::READER; }; } /* namespace core */ diff --git a/ddspipe_core/src/cpp/core/DdsPipe.cpp b/ddspipe_core/src/cpp/core/DdsPipe.cpp index a77f84da..a7657c0b 100644 --- a/ddspipe_core/src/cpp/core/DdsPipe.cpp +++ b/ddspipe_core/src/cpp/core/DdsPipe.cpp @@ -355,19 +355,19 @@ void DdsPipe::updated_endpoint_nts_( bool DdsPipe::is_endpoint_relevant_( const Endpoint& endpoint) noexcept { - const auto entity_creation_trigger = configuration_.entity_creation_trigger; + const auto discovery_trigger = configuration_.discovery_trigger; - auto is_endpoint_type_relevant = [entity_creation_trigger](const Endpoint& endpoint) + auto is_endpoint_type_relevant = [discovery_trigger](const Endpoint& endpoint) { - switch (entity_creation_trigger) + switch (discovery_trigger) { - case EntityCreationTrigger::READER: + case DiscoveryTrigger::READER: return endpoint.is_reader(); - case EntityCreationTrigger::WRITER: + case DiscoveryTrigger::WRITER: return endpoint.is_writer(); - case EntityCreationTrigger::ANY: + case DiscoveryTrigger::ANY: return true; - case EntityCreationTrigger::NONE: + case DiscoveryTrigger::NONE: return false; default: return false; diff --git a/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp b/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp index bc8f24c6..398a8fb1 100644 --- a/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp +++ b/ddspipe_yaml/include/ddspipe_yaml/yaml_configuration_tags.hpp @@ -140,7 +140,7 @@ constexpr const char* NUMBER_THREADS_TAG("threads"); //! Number of threads to co constexpr const char* WAIT_ALL_ACKED_TIMEOUT_TAG("wait-all-acked-timeout"); //! Wait for a maximum of *wait-all-acked-timeout* ms until all msgs sent by reliable writers are acknowledged by their matched readers constexpr const char* REMOVE_UNUSED_ENTITIES_TAG("remove-unused-entities"); //! Dynamically create and delete entities and tracks. constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoSs -constexpr const char* ENTITY_CREATION_TRIGGER_TAG("entity-creation-trigger"); //! Dynamically create entities when the trigger is set off. +constexpr const char* DISCOVERY_TRIGGER_TAG("discovery-trigger"); //! Dynamically trigger the discovery of entities. // XML configuration tags constexpr const char* XML_TAG("xml"); //! Tag to read xml configuration