Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Nov 22, 2023
1 parent a35f3d6 commit 9249a34
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
25 changes: 25 additions & 0 deletions fastddsspy_tool/src/cpp/tool/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ Backend::Backend(
utils::Heritable<eprosima::ddspipe::core::types::DistributedTopic>::make_heritable(
eprosima::ddspipe::core::types::type_object_topic()));

if (!configuration_.ddspipe_configuration.allowlist.empty())
{
// The allowlist is not empty. Add the internal topics.
eprosima::ddspipe::core::types::WildcardDdsFilterTopic type_object_topic;
type_object_topic.topic_name.set_value(eprosima::ddspipe::core::types::TYPE_OBJECT_TOPIC_NAME);

configuration_.ddspipe_configuration.allowlist.insert(
utils::Heritable<eprosima::ddspipe::core::types::WildcardDdsFilterTopic>::make_heritable(
type_object_topic));

eprosima::ddspipe::core::types::WildcardDdsFilterTopic participant_info_topic;
participant_info_topic.topic_name.set_value(participants::PARTICIPANT_INFO_TOPIC_NAME);

configuration_.ddspipe_configuration.allowlist.insert(
utils::Heritable<eprosima::ddspipe::core::types::WildcardDdsFilterTopic>::make_heritable(
participant_info_topic));

eprosima::ddspipe::core::types::WildcardDdsFilterTopic endpoint_info_topic;
endpoint_info_topic.topic_name.set_value(participants::ENDPOINT_INFO_TOPIC_NAME);

configuration_.ddspipe_configuration.allowlist.insert(
utils::Heritable<eprosima::ddspipe::core::types::WildcardDdsFilterTopic>::make_heritable(
endpoint_info_topic));
}

// Create and initialize Pipe
pipe_ = std::make_unique<ddspipe::core::DdsPipe>(
configuration_.ddspipe_configuration,
Expand Down
18 changes: 0 additions & 18 deletions fastddsspy_yaml/src/cpp/YamlReaderConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,6 @@ void Configuration::load_dds_configuration_(
{
ddspipe_configuration.allowlist = YamlReader::get_set<utils::Heritable<IFilterTopic>>(yml, ALLOWLIST_TAG,
version);

// Add to allowlist always the type object topic
WildcardDdsFilterTopic type_object_topic;
type_object_topic.topic_name.set_value(TYPE_OBJECT_TOPIC_NAME);
ddspipe_configuration.allowlist.insert(
utils::Heritable<WildcardDdsFilterTopic>::make_heritable(type_object_topic));

// Add to allowlist always the participant info internal topic
WildcardDdsFilterTopic participant_info_topic;
participant_info_topic.topic_name.set_value(participants::PARTICIPANT_INFO_TOPIC_NAME);
ddspipe_configuration.allowlist.insert(
utils::Heritable<WildcardDdsFilterTopic>::make_heritable(participant_info_topic));

// Add to allowlist always the endpoint info internal topic
WildcardDdsFilterTopic endpoint_info_topic;
endpoint_info_topic.topic_name.set_value(participants::ENDPOINT_INFO_TOPIC_NAME);
ddspipe_configuration.allowlist.insert(
utils::Heritable<WildcardDdsFilterTopic>::make_heritable(endpoint_info_topic));
}

/////
Expand Down

0 comments on commit 9249a34

Please sign in to comment.