Skip to content

Commit

Permalink
Rename entity_creation_trigger to discovery_trigger
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Nov 13, 2023
1 parent 0b9a9cc commit 076148d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
};

/**
Expand Down Expand Up @@ -117,8 +117,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 */
Expand Down
14 changes: 7 additions & 7 deletions ddspipe_core/src/cpp/core/DdsPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoS
constexpr const char* NUMBER_THREADS_TAG("threads"); //! Number of threads to configure the thread pool
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* 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
Expand Down

0 comments on commit 076148d

Please sign in to comment.