Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the trigger of the DDS Pipe callbacks configurable #67

Merged
merged 12 commits into from
Nov 22, 2023

Conversation

Tempate
Copy link
Contributor

@Tempate Tempate commented Oct 16, 2023

In the previous version, the DDS Pipe's callbacks were only triggered by the discovery of readers. In this version, the entity type that triggers the callbacks is configurable. They can be triggered by readers (by default), writers, both readers and writers, and neither readers nor writers.

Merge after:

ddspipe_core/src/cpp/core/DdsPipe.cpp Outdated Show resolved Hide resolved
ddspipe_core/src/cpp/core/DdsPipe.cpp Show resolved Hide resolved
Copy link
Contributor

@jepemi jepemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tempate Tempate force-pushed the feature/dynamic_entity_creation branch from 3d5113d to b92a08b Compare November 16, 2023 13:59
Signed-off-by: tempate <[email protected]>
Copy link
Contributor

@jepemi jepemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

Copy link
Contributor

@juanlofer-eprosima juanlofer-eprosima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change name of PR.

ddspipe_core/src/cpp/core/DdsPipe.cpp Outdated Show resolved Hide resolved
{
return entity.active &&
entity.is_reader() &&
is_endpoint_kind_relevant_(entity) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes little sense to me, as this logic specific to the remove unused entities feature is not supported for a discovery trigger value other than READER. But ok, it will need to be this way if we ever add support. However, I think it would be good to fail (add condition to some is_valid) if an unsupported configuration is provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related suggestion, although does not tackle the previous comment (cannot hold it back): I suggest having an if-else with remove_unused_entities within is_relevant method, and return endpoint.active when false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is more appropriate to address that change in a new branch, since it changes the dynamic of the DdsPipe at it should be thoroughly thought about and tested. I will also take the liberty to change other things which I think would improve the DdsPipe readability.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write an error trace in is_valid

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tempate Tempate changed the title Dynamically trigger the DDS Pipe's callbacks Make the trigger of the DDS Pipe callbacks configurable Nov 20, 2023
Signed-off-by: tempate <[email protected]>
Signed-off-by: tempate <[email protected]>
//! Possible kinds of the endpoint
ENUMERATION_BUILDER(
DiscoveryTrigger,
READER, //! The discovery callbacks get triggered by the discovery of a reader.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lower case to simplify your life (and reviewer's).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Example is not another way to teach, it's the only way." — Albert Einstein

Copy link
Contributor Author

@Tempate Tempate Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides, it wouldn't simplify anything. We would have to rename the enum and all its occurrences to avoid copying an int. And in the future to_uppercase and to_lowercase would return the string in uppercase or lowercase anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The fool knows after he's suffered." — Hesiod

ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp Outdated Show resolved Hide resolved
Signed-off-by: tempate <[email protected]>
Signed-off-by: tempate <[email protected]>
Copy link
Contributor

@juanlofer-eprosima juanlofer-eprosima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@juanlofer-eprosima juanlofer-eprosima merged commit 1d2c92b into main Nov 22, 2023
12 checks passed
@juanlofer-eprosima juanlofer-eprosima deleted the feature/dynamic_entity_creation branch November 22, 2023 11:16
juanlofer-eprosima pushed a commit that referenced this pull request Nov 23, 2023
* Dynamically trigger the creation of entities

Signed-off-by: tempate <[email protected]>

* Rebase fix

Signed-off-by: tempate <[email protected]>

* Add none entity-creation-trigger

Signed-off-by: tempate <[email protected]>

* Avoid adding endpoints in the SchemaParticipant

Signed-off-by: tempate <[email protected]>

* Rename entity_creation_trigger to discovery_trigger

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

* Check discovery trigger in services

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

* Apply suggestions

Signed-off-by: tempate <[email protected]>

---------

Signed-off-by: tempate <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants