Skip to content

Commit

Permalink
Make the deletion of unused entities configurable
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Sep 4, 2023
1 parent 5496aa4 commit cfae235
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ddspipe_core/include/ddspipe_core/core/DdsPipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class DdsPipe
const std::shared_ptr<PayloadPool>& payload_pool,
const std::shared_ptr<ParticipantsDatabase>& participants_database,
const std::shared_ptr<utils::SlotThreadPool>& thread_pool,
const bool delete_unused_entities,
const std::set<utils::Heritable<types::DistributedTopic>>& builtin_topics = {},
bool start_enable = false,
const RoutesConfiguration& routes_config = {},
Expand Down Expand Up @@ -367,6 +368,9 @@ class DdsPipe
//! Custom forwarding routes per topic
TopicRoutesConfiguration topic_routes_config_;

//! Whether readers that aren't connected to any writers should be deleted
bool delete_unused_entities_;

/////
// AUXILIAR VARIABLES

Expand Down
4 changes: 3 additions & 1 deletion ddspipe_core/src/cpp/core/DdsPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ DdsPipe::DdsPipe(
const std::shared_ptr<PayloadPool>& payload_pool,
const std::shared_ptr<ParticipantsDatabase>& participants_database,
const std::shared_ptr<utils::SlotThreadPool>& thread_pool,
const bool delete_unused_entities,
const std::set<utils::Heritable<DistributedTopic>>& builtin_topics, /* = {} */
bool start_enable, /* = false */
const RoutesConfiguration& routes_config, /* = {} */
Expand All @@ -43,6 +44,7 @@ DdsPipe::DdsPipe(
, payload_pool_(payload_pool)
, participants_database_(participants_database)
, thread_pool_(thread_pool)
, delete_unused_entities_(delete_unused_entities)
, enabled_(false)
, routes_config_(routes_config)
, topic_routes_config_(topic_routes_config)
Expand Down Expand Up @@ -324,7 +326,7 @@ void DdsPipe::removed_endpoint_nts_(
"Error finding Bridge for topic " << topic <<
". The Bridge does not exist.");
}
else
else if (delete_unused_entities_)
{
it_bridge->second->remove_from_tracks(endpoint.discoverer_participant_id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ constexpr const char* MAX_HISTORY_DEPTH_TAG("max-depth"); //! Maximum size (numb
constexpr const char* DOWNSAMPLING_TAG("downsampling"); //! Keep 1 out of every *downsampling* samples received
constexpr const char* MAX_RECEPTION_RATE_TAG("max-reception-rate"); //! Process up to *max_reception_rate* samples in a 1 second bin
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* DELETE_UNUSED_ENTITIES_TAG("delete-unused-entities"); //! Delete the unused entities and tracks.

// XML configuration tags
constexpr const char* XML_TAG("xml"); //! Tag to read xml configuration
Expand Down

0 comments on commit cfae235

Please sign in to comment.