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

[21357] Remove TopicAttributes from public APIs and make it private in xmlparser #5085

Merged
merged 37 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fd98df9
Refs #21357: Make TopicAttributes private and move to namespace
Mario-DL Jul 18, 2024
15bc0b8
Refs #21357: Relay TopicAttributes references to xmlparser namespace
Mario-DL Jul 18, 2024
7a9479e
Refs #21357: Remove TopicAttributes references in DDS layer headers
Mario-DL Jul 18, 2024
33f2d5c
Refs #21357: Remove TopicAttributes from RTPSDomain and weak forward …
Mario-DL Jul 18, 2024
c69b36e
Refs #21357: Include PublicationBuiltinTopicData in RTPS and refactor…
Mario-DL Jul 18, 2024
024fa61
Refs #21357: Include SubscriptionBuiltinTopicData in RTPS and refacto…
Mario-DL Jul 18, 2024
39b571f
Refs #21357: Move BuiltinTopicKeyValue conversion helpers to utils (…
Mario-DL Jul 18, 2024
3f30adb
Refs #21357: Add utility method to LocatorList
Mario-DL Jul 18, 2024
468e988
Refs #21357: Remove TopicAttributes from DataWriterHistory
Mario-DL Jul 18, 2024
01de9df
Refs #21357: Add new get_publication_builtin_topic_data() to DataWriter
Mario-DL Jul 18, 2024
5a5fbfe
Refs #21357: Add new get_subscription_builtin_topic_data() to DataReader
Mario-DL Jul 18, 2024
77b504a
Refs #21357: Refactor Data*Impl
Mario-DL Jul 18, 2024
941a12e
Refs #21357: Add some mock methods and remove RTPS unittest
Mario-DL Jul 18, 2024
d5a526e
Refs #21357: Improve discovery server example test resilience
Mario-DL Jul 18, 2024
29225c1
Refs #21357: Linter
Mario-DL Jul 18, 2024
42c1bcc
Refs #21357: Update RTPS example
Mario-DL Jul 23, 2024
d4901d7
Refs #21357. Remove ReaderQos from register_reader.
MiguelCompany Jul 24, 2024
61ae807
Refs #21357. Remove WriterQos from register_writer.
MiguelCompany Jul 24, 2024
5312311
Refs #21357. Refactor get_subscription_builtin_topic_data.
MiguelCompany Jul 26, 2024
5a40246
Refs #21357. Refactor get_publication_builtin_topic_data.
MiguelCompany Jul 26, 2024
d10d4cf
Refs #21357. Fix calculation of persistence_guid.
MiguelCompany Jul 26, 2024
3498efd
Refs #21357. Builtin key conversion method not inline.
MiguelCompany Jul 26, 2024
975f77c
Refs #21357. Fix doxygen on DataWriterHistory.
MiguelCompany Jul 26, 2024
52bc3eb
Refs #21357. Refactor MonitorService.
MiguelCompany Jul 26, 2024
9dad7e0
Refs #21357. Uncrustify.
MiguelCompany Jul 26, 2024
8f7713c
Refs #21357. Fix default initialization of builtin data structures.
MiguelCompany Jul 26, 2024
ccb0c0b
Refs #21357. Fix blackbox tests.
MiguelCompany Jul 26, 2024
947cca4
Refs #21357. Uncrustify.
MiguelCompany Jul 26, 2024
8d1997b
Refs #21357. Improve `from_builtin_to_proxy`.
MiguelCompany Jul 28, 2024
fbdd68b
Refs #21357. Add `fill_type_information` to DomainParticipantImpl.
MiguelCompany Jul 29, 2024
9131e24
Refs #21357. Refactor `register_writer` again.
MiguelCompany Jul 29, 2024
7b349e4
Refs #21357. Refactor `register_reader` again.
MiguelCompany Jul 29, 2024
ab475b4
Refs #21357. Fix blackbox build.
MiguelCompany Jul 29, 2024
4c3d06e
Refs #21357. Fix content filter topic name.
MiguelCompany Jul 29, 2024
dfbfd8a
Refs #21357. Uncrustify.
MiguelCompany Jul 29, 2024
d99f997
Refs #21357. Update `versions.md`.
MiguelCompany Jul 30, 2024
3a8a5a8
Refs #21357. Apply suggestions on `versions.md`.
MiguelCompany Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/cpp/discovery_server/ClientPublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ ClientPublisherApp::ClientPublisherApp(
wqos.durability().kind = VOLATILE_DURABILITY_QOS;
}

// So as not to overwriter the first sample
// if we publish inmediately after the discovery
// and the suscription is not prepared yet
wqos.history().depth = 5;

writer_ = publisher_->create_datawriter(topic_, wqos, this);

if (writer_ == nullptr)
Expand Down
11 changes: 5 additions & 6 deletions examples/cpp/rtps/ReaderApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <fastdds/rtps/attributes/HistoryAttributes.hpp>
#include <fastdds/rtps/attributes/ReaderAttributes.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/attributes/TopicAttributes.hpp>
#include <fastdds/rtps/builtin/data/TopicDescription.hpp>
#include <fastdds/rtps/history/ReaderHistory.hpp>
#include <fastdds/rtps/participant/RTPSParticipant.hpp>
#include <fastdds/rtps/reader/RTPSReader.hpp>
Expand Down Expand Up @@ -114,17 +114,16 @@ ReaderApp::ReaderApp(

std::cout << "Registering RTPS Reader" << std::endl;

TopicAttributes topic_att;
topic_att.topicKind = NO_KEY;
topic_att.topicDataType = "HelloWorld";
topic_att.topicName = topic_name;
TopicDescription topic_desc;
topic_desc.topic_name = topic_name;
topic_desc.type_name = "HelloWorld";

eprosima::fastdds::dds::ReaderQos reader_qos;
reader_qos.m_durability.kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS;
reader_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS;

// Register entity
if (!rtps_participant_->registerReader(rtps_reader_, topic_att, reader_qos))
if (!rtps_participant_->register_reader(rtps_reader_, topic_desc, reader_qos))
{
throw std::runtime_error("Entity registration failed");
}
Expand Down
11 changes: 5 additions & 6 deletions examples/cpp/rtps/WriterApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <fastdds/dds/publisher/qos/WriterQos.hpp>
#include <fastdds/rtps/attributes/HistoryAttributes.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/attributes/TopicAttributes.hpp>
#include <fastdds/rtps/attributes/WriterAttributes.hpp>
#include <fastdds/rtps/builtin/data/TopicDescription.hpp>
#include <fastdds/rtps/history/WriterHistory.hpp>
#include <fastdds/rtps/participant/RTPSParticipant.hpp>
#include <fastdds/rtps/RTPSDomain.hpp>
Expand Down Expand Up @@ -105,17 +105,16 @@ WriterApp::WriterApp(

std::cout << "Registering RTPS Writer" << std::endl;

TopicAttributes topic_att;
topic_att.topicKind = NO_KEY;
topic_att.topicDataType = "HelloWorld";
topic_att.topicName = topic_name;
TopicDescription topic_desc;
topic_desc.type_name = "HelloWorld";
topic_desc.topic_name = topic_name;

eprosima::fastdds::dds::WriterQos writer_qos;
writer_qos.m_durability.kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS;
writer_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS;

// Register entity
if (!rtps_participant_->registerWriter(rtps_writer_, topic_att, writer_qos))
if (!rtps_participant_->register_writer(rtps_writer_, topic_desc, writer_qos))
{
throw std::runtime_error("Entity registration failed");
}
Expand Down
14 changes: 13 additions & 1 deletion include/fastdds/dds/publisher/DataWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef FASTDDS_DDS_PUBLISHER__DATAWRITER_HPP
#define FASTDDS_DDS_PUBLISHER__DATAWRITER_HPP

#include <fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp>
#include <fastdds/dds/builtin/topic/SubscriptionBuiltinTopicData.hpp>
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
Expand All @@ -28,9 +29,9 @@
#include <fastdds/dds/core/status/PublicationMatchedStatus.hpp>
#include <fastdds/dds/core/status/StatusMask.hpp>
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/fastdds_dll.hpp>
#include <fastdds/rtps/common/LocatorList.hpp>
#include <fastdds/rtps/common/Time_t.hpp>
#include <fastdds/fastdds_dll.hpp>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -584,6 +585,17 @@ class DataWriter : public DomainEntity
const InstanceHandle_t& handle,
const fastdds::dds::Duration_t& max_wait);

/**
* Retrieve the publication data discovery information.
*
* @param [out] publication_data The publication data discovery information.
*
* @return NOT_ENABLED if the writer has not been enabled.
* @return OK if the publication data is returned.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_publication_builtin_topic_data(
PublicationBuiltinTopicData& publication_data) const;

protected:

DataWriterImpl* impl_;
Expand Down
3 changes: 0 additions & 3 deletions include/fastdds/dds/publisher/Publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class Publisher;

namespace eprosima {
namespace fastdds {

class TopicAttributes;

namespace rtps {

class IPayloadPool;
Expand Down
12 changes: 12 additions & 0 deletions include/fastdds/dds/subscriber/DataReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <vector>

#include <fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp>
#include <fastdds/dds/builtin/topic/SubscriptionBuiltinTopicData.hpp>
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/LoanableCollection.hpp>
#include <fastdds/dds/core/LoanableSequence.hpp>
Expand Down Expand Up @@ -1076,6 +1077,17 @@ class DataReader : public DomainEntity
FASTDDS_EXPORTED_API ReturnCode_t get_listening_locators(
rtps::LocatorList& locators) const;

/**
* Retrieve the subscription data discovery information.
*
* @param [out] subscription_data The subscription data discovery information.
*
* @return NOT_ENABLED if the reader has not been enabled.
* @return OK if the subscription data is returned.
*/
FASTDDS_EXPORTED_API ReturnCode_t get_subscription_builtin_topic_data(
SubscriptionBuiltinTopicData& subscription_data) const;

protected:

DataReaderImpl* impl_;
Expand Down
3 changes: 0 additions & 3 deletions include/fastdds/dds/subscriber/Subscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class Subscriber;

namespace eprosima {
namespace fastdds {

class TopicAttributes;

namespace rtps {

class IPayloadPool;
Expand Down
3 changes: 0 additions & 3 deletions include/fastdds/dds/subscriber/qos/DataReaderQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
#include <fastdds/dds/subscriber/qos/SubscriberQos.hpp>
#include <fastdds/rtps/attributes/ReaderAttributes.hpp>
#include <fastdds/rtps/attributes/TopicAttributes.hpp>
#include <fastdds/fastdds_dll.hpp>

namespace eprosima {
namespace fastdds {
namespace dds {

using TopicAttributesQos = fastdds::TopicAttributes;

//! Qos Policy to configure the DisablePositiveACKsQos and the reader attributes
class RTPSReliableReaderQos
{
Expand Down
1 change: 0 additions & 1 deletion include/fastdds/dds/topic/qos/TopicQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define FASTDDS_DDS_TOPIC_QOS__TOPICQOS_HPP

#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/rtps/attributes/TopicAttributes.hpp>

#include <fastdds/dds/log/Log.hpp>

Expand Down
13 changes: 0 additions & 13 deletions include/fastdds/rtps/RTPSDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <fastdds/rtps/common/Types.hpp>
#include <fastdds/rtps/history/IPayloadPool.hpp>
#include <fastdds/rtps/history/IChangePool.hpp>
#include <fastdds/rtps/attributes/TopicAttributes.hpp>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -251,18 +250,6 @@ class RTPSDomain
FASTDDS_EXPORTED_API static bool set_library_settings(
const fastdds::LibrarySettings& library_settings);

/**
* @brief Get the TopicAttributes from XML profile.
*
* @param profile_name Topic profile name.
* @param topic_att TopicAttributes object where the attributes are returned.
* @return bool true if the profile exists.
* false otherwise.
*/
FASTDDS_EXPORTED_API static bool get_topic_attributes_from_profile(
const std::string& profile_name,
TopicAttributes& topic_att);

private:

RTPSDomain() = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ namespace rtps {
/// Structure PublicationBuiltinTopicData, contains the information on a discovered publication.
struct PublicationBuiltinTopicData
{
PublicationBuiltinTopicData()
{
reliability.kind = dds::RELIABLE_RELIABILITY_QOS;
}

/// Builtin topic Key
BuiltinTopicKey_t key;
BuiltinTopicKey_t key{{0, 0, 0}};

/// Builtin participant topic Key
BuiltinTopicKey_t participant_key;
BuiltinTopicKey_t participant_key{{0, 0, 0}};

/// Topic name
fastcdr::string_255 topic_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ namespace rtps {
struct SubscriptionBuiltinTopicData
{
/// Builtin topic Key
BuiltinTopicKey_t key;
BuiltinTopicKey_t key{{0, 0, 0}};

/// Builtin participant topic Key
BuiltinTopicKey_t participant_key;
BuiltinTopicKey_t participant_key{{0, 0, 0}};

/// Topic name
fastcdr::string_255 topic_name;
Expand Down
51 changes: 51 additions & 0 deletions include/fastdds/rtps/builtin/data/TopicDescription.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @file TopicDescription.hpp
*/

#ifndef FASTDDS_RTPS_BUILTIN_DATA__TOPICDESCRIPTION_HPP
#define FASTDDS_RTPS_BUILTIN_DATA__TOPICDESCRIPTION_HPP

#include <cstdint>
#include <string>

#include <fastcdr/cdr/fixed_size_string.hpp>

#include <fastdds/dds/core/policy/QosPolicies.hpp>

namespace eprosima {
namespace fastdds {
namespace rtps {

/// Structure TopicDescription, used to register an endpoint on a topic.
struct TopicDescription
{
/// Topic name
fastcdr::string_255 topic_name;

/// Type name
fastcdr::string_255 type_name;

/// Type information
dds::xtypes::TypeInformationParameter type_information;

};

} // namespace rtps
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_RTPS_BUILTIN_DATA__TOPICDESCRIPTION_HPP
11 changes: 11 additions & 0 deletions include/fastdds/rtps/common/LocatorList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <fastdds/rtps/common/Locator.hpp>
#include <fastdds/rtps/common/LocatorsIterator.hpp>
#include <fastdds/utils/collections/ResourceLimitedVector.hpp>

#include <vector>
#include <cstdint>
Expand Down Expand Up @@ -376,6 +377,16 @@ class LocatorList
return false;
}

// Copy the inner locator list to a ResourceLimitedVector locator list.
FASTDDS_EXPORTED_API void copy_to(
eprosima::fastdds::ResourceLimitedVector<Locator>& locator_list) const
{
for (auto& locator : m_locators)
{
locator_list.emplace_back(locator);
}
}

private:

std::vector<Locator> m_locators;
Expand Down
Loading