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

[21301] Remove WriterProxyData from public APIs #5052

Merged
merged 27 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0cce941
Refs #21239. Empty skeletons for converter methods.
MiguelCompany Jul 8, 2024
43de9d7
Refs #21239. Refactor BuiltinTopicKey_t.
MiguelCompany Jul 8, 2024
98b06ac
Refs #21301. Rename RTPS callback to `on_writer_discovery`.
MiguelCompany Jul 5, 2024
46eb877
Refs #21301. Split callback in reason + info.
MiguelCompany Jul 5, 2024
63ee604
Refs #21301. Remove unused PDP method.
MiguelCompany Jul 5, 2024
0090b85
Refs #21301. Refactor PublicationBuiltinTopicData.
MiguelCompany Jul 5, 2024
36e2390
Refs #21301. Implement conversion method.
MiguelCompany Jul 8, 2024
ef6cefe
Refs #21301. Refactor matched_writer_add.
MiguelCompany Jul 8, 2024
123ae75
Refs #21301. Add guid to PublicationBuiltinTopicData.
MiguelCompany Jul 10, 2024
7a2c19d
Refs #21301. Add type_information to PublicationBuiltinTopicData.
MiguelCompany Jul 10, 2024
097818b
Refs #21301. Use PublicationBuiltinTopicData on participant listeners.
MiguelCompany Jul 10, 2024
e0d4412
Refs #21301. Use PublicationBuiltinTopicData on fill_discovery_data_f…
MiguelCompany Jul 10, 2024
6cd433f
Refs #21301. Additional fields on PublicationBuiltinTopicData.
MiguelCompany Jul 10, 2024
a584122
Refs #21301. Move `WriterProxyData.hpp` to src.
MiguelCompany Jul 10, 2024
6ee1ae3
Refs #21301. Additional refactor on matched_writer_add.
MiguelCompany Jul 11, 2024
f9ad5e5
Refs #21301. Uncrustify.
MiguelCompany Jul 11, 2024
a6b334f
Refs #21301. Rename internal method to `matched_writer_add_edp`.
MiguelCompany Jul 11, 2024
bfab3b9
Refs #21301. Refactor on ReaderListener.
MiguelCompany Jul 11, 2024
3b2fa23
Refs #21301. Remove reference on doxygen comment.
MiguelCompany Jul 11, 2024
1ff131e
Refs #21301. Add `participant_guid` on PublicationBuiltinTopicData.
MiguelCompany Jul 11, 2024
ab00d3a
Refs #21301. Fix build without security.
MiguelCompany Jul 11, 2024
63ef983
Refs #21301. Add missing groups to `doxygen_modules.hpp`.
MiguelCompany Jul 12, 2024
b1a9db6
Refs #21301. Rename enum to `WriterDiscoveryStatus`.
MiguelCompany Jul 15, 2024
2ea58f1
Refs #21301. Rename header to `WriterDiscoveryStatus.hpp`.
MiguelCompany Jul 15, 2024
ea53906
Refs #21301. Use `fastcdr::string_255`.
MiguelCompany Jul 15, 2024
c7450c8
Refs #21301. Uncrustify.
MiguelCompany Jul 15, 2024
f498b2b
Update versions.md
MiguelCompany Jul 16, 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
11 changes: 6 additions & 5 deletions examples/cpp/xtypes/SubscriberApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,27 @@ void SubscriberApp::on_data_available(

void SubscriberApp::on_data_writer_discovery(
DomainParticipant* /*participant*/,
eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
eprosima::fastdds::rtps::WriterDiscoveryStatus /*reason*/,
const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
bool& should_be_ignored)
{
// We don't want to ignore the writer
should_be_ignored = false;

// Check if the discovered topic is the one we are interested in
if (topic_name_ == info.info.topicName().to_string())
if (topic_name_ == info.topic_name.to_string())
{
// Get remote type information and use it to retrieve the type object
auto type_info = info.info.type_information().type_information;
auto type_info = info.type_information.type_information;
auto type_id = type_info.complete().typeid_with_size().type_id();

if (RETCODE_OK != DomainParticipantFactory::get_instance()->type_object_registry().get_type_object(
type_id,
remote_type_object_))
{
std::cout << "Cannot get discovered type from registry:" << std::endl;
std::cout << " - Topic name: " << info.info.topicName() << std::endl;
std::cout << " - Type name: " << info.info.typeName() << std::endl;
std::cout << " - Topic name: " << info.topic_name << std::endl;
std::cout << " - Type name: " << info.type_name << std::endl;
}

// Notify run thread that type has been discovered
Expand Down
3 changes: 2 additions & 1 deletion examples/cpp/xtypes/SubscriberApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class SubscriberApp : public Application, public DomainParticipantListener

void on_data_writer_discovery(
DomainParticipant* participant,
eprosima::fastdds::rtps::WriterDiscoveryInfo&& info,
eprosima::fastdds::rtps::WriterDiscoveryStatus reason,
const eprosima::fastdds::dds::PublicationBuiltinTopicData& info,
bool& should_be_ignored) override;

//! Run subscriber
Expand Down
28 changes: 28 additions & 0 deletions include/fastdds/config/doxygen_modules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef FASTDDS_CONFIG__DOXYGEN_MODULES_HPP
#define FASTDDS_CONFIG__DOXYGEN_MODULES_HPP

#include <fastdds/config.hpp>

//Description of doxygen modules, not used in actual code.

/*!
Expand All @@ -40,16 +42,35 @@
* This Module contains the DDS Layer defined by the OMG.
*/

/*!
* @defgroup dds_xtypes_typeobject DDS TypeObject API
* @ingroup FASTDDS_MODULE
*/

/*!
* @defgroup dynamic_language_binding DDS Dynamic Types API
* @ingroup FASTDDS_MODULE
*/

/** @defgroup FASTDDS_QOS_MODULE Fast DDS Quality of Service (QoS) Module.
* @ingroup FASTDDS_MODULE
* @brief QOS class used to define the public entities that the user should use to control this library.
*/

/** @defgroup DEADLINE_MODULE Deadline Module
* @ingroup FASTDDS_QOS_MODULE
* This module contains the classes associated with the DEADLINE QoS.
*/

/** @defgroup RTPS_ATTRIBUTES_MODULE RTPS Attributes Module.
* @ingroup RTPS_MODULE
* @brief Attributes class used to define the public entities that the user should use to control this library.
*/

/** @defgroup FASTDDS_ATTRIBUTES_MODULE High-level Attributes Module.
* @ingroup FASTDDS_MODULE
*/

/** @defgroup COMMON_MODULE Common Module.
* @ingroup RTPS_MODULE
* Common structures used by multiple elements.
Expand Down Expand Up @@ -120,6 +141,13 @@

#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#ifdef FASTDDS_STATISTICS
/** @defgroup STATISTICS_MODULE Statistics Module
* @ingroup MANAGEMENT_MODULE
* This module contains the classes associated with the Statistics Protocols.
*/
#endif // ifdef FASTDDS_STATISTICS

/** @defgroup UTILITIES_MODULE Shared Utilities
* @ingroup FASTDDS_GENERAL_API
* Shared utilities that can be used by one or more classes in different modules.
Expand Down
21 changes: 5 additions & 16 deletions include/fastdds/dds/builtin/topic/BuiltinTopicKey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,21 @@

/**
* @file BuiltinTopicKey.hpp
*
*/

#ifndef FASTDDS_DDS_BUILTIN_TOPIC__BUILTINTOPICKEY_HPP
#define FASTDDS_DDS_BUILTIN_TOPIC__BUILTINTOPICKEY_HPP

#include <stdint.h>
#include <fastdds/rtps/builtin/data/BuiltinTopicKey.hpp>

namespace eprosima {
namespace fastdds {
namespace dds {
namespace builtin {

// following API definition:
// #define BUILTIN_TOPIC_KEY_TYPE_NATIVE uint32_t
using BuiltinTopicKey_t = rtps::BuiltinTopicKey_t;

struct BuiltinTopicKey_t
{
// BUILTIN_TOPIC_KEY_TYPE_NATIVE = long type
//!Value
uint32_t value[3];
};

} // builtin
} // dds
} // fastdds
} // eprosima
} // namespace dds
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_DDS_BUILTIN_TOPIC__BUILTINTOPICKEY_HPP
76 changes: 5 additions & 71 deletions include/fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,21 @@

/**
* @file PublicationBuiltinTopicData.hpp
*
*/

#ifndef FASTDDS_DDS_BUILTIN_TOPIC__PUBLICATIONBUILTINTOPICDATA_HPP
#define FASTDDS_DDS_BUILTIN_TOPIC__PUBLICATIONBUILTINTOPICDATA_HPP

#include <fastdds/dds/builtin/topic/BuiltinTopicKey.hpp>
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/rtps/builtin/data/PublicationBuiltinTopicData.hpp>

namespace eprosima {
namespace fastdds {
namespace dds {
namespace builtin {

struct PublicationBuiltinTopicData
{
//! Builtin topic Key
BuiltinTopicKey_t key;
using PublicationBuiltinTopicData = rtps::PublicationBuiltinTopicData;

//! Builtin participant topic Key
BuiltinTopicKey_t participant_key;

//! Topic name
std::string topic_name;

//! Type name
std::string type_name;

// DataWriter Qos

//!Durability Qos, implemented in the library.
DurabilityQosPolicy durability;

//!Durability Service Qos, NOT implemented in the library.
DurabilityServiceQosPolicy durability_service;

//!Deadline Qos, implemented in the library.
DeadlineQosPolicy deadline;

//!Latency Budget Qos, NOT implemented in the library.
LatencyBudgetQosPolicy latency_budget;

//!Liveliness Qos, implemented in the library.
LivelinessQosPolicy liveliness;

//!Reliability Qos, implemented in the library.
ReliabilityQosPolicy reliability;

//!Lifespan Qos, implemented in the library.
LifespanQosPolicy lifespan;

//!User Data Qos, implemented in the library.
UserDataQosPolicy user_data;

//!Ownership Qos, implemented in the library.
OwnershipQosPolicy ownership;

//!Ownership Strength Qos, implemented in the library.
OwnershipStrengthQosPolicy ownership_strength;

//!Destination Order Qos, NOT implemented in the library.
DestinationOrderQosPolicy destination_order;

// Publisher Qos

//!Presentation Qos, NOT implemented in the library.
PresentationQosPolicy presentation;

//!Partition Qos, implemented in the library.
PartitionQosPolicy partition;

//!Topic Data Qos, NOT implemented in the library.
TopicDataQosPolicy topic_data;

//!Group Data Qos, implemented in the library.
GroupDataQosPolicy group_data;
};

} // builtin
} // dds
} // fastdds
} // eprosima
} // namespace dds
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_DDS_BUILTIN_TOPIC__PUBLICATIONBUILTINTOPICDATA_HPP
16 changes: 10 additions & 6 deletions include/fastdds/dds/domain/DomainParticipantListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
#ifndef FASTDDS_DDS_DOMAIN__DOMAINPARTICIPANTLISTENER_HPP
#define FASTDDS_DDS_DOMAIN__DOMAINPARTICIPANTLISTENER_HPP

#include <fastdds/dds/builtin/topic/PublicationBuiltinTopicData.hpp>
#include <fastdds/dds/publisher/PublisherListener.hpp>
#include <fastdds/dds/subscriber/SubscriberListener.hpp>
#include <fastdds/dds/topic/TopicListener.hpp>
#include <fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp>
#include <fastdds/rtps/reader/ReaderDiscoveryInfo.hpp>
#include <fastdds/rtps/writer/WriterDiscoveryInfo.hpp>
#include <fastdds/rtps/writer/WriterDiscoveryStatus.hpp>

namespace eprosima {
namespace fastdds {
Expand Down Expand Up @@ -116,18 +117,21 @@ class DomainParticipantListener :
* This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes
* its QOS or is removed.
*
* @param [out] participant Pointer to the Participant which discovered the remote DataWriter.
* @param [out] info Remote DataWriter information. User can take ownership of the object.
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
* @param [in] participant Pointer to the Participant which discovered the remote writer.
* @param [in] reason The reason motivating this method to be called.
* @param [in] info Remote writer information.
* @param [out] should_be_ignored Flag to indicate the library to automatically ignore the discovered writer.
*/
virtual void on_data_writer_discovery(
DomainParticipant* participant,
rtps::WriterDiscoveryInfo&& info,
rtps::WriterDiscoveryStatus reason,
const PublicationBuiltinTopicData& info,
bool& should_be_ignored)
{
static_cast<void>(participant);
static_cast<void>(reason);
static_cast<void>(info);
static_cast<void>(should_be_ignored);
should_be_ignored = false;
}

// TODO: Methods in DomainParticipantListener (p.33 - DDS)
Expand Down
2 changes: 1 addition & 1 deletion include/fastdds/dds/subscriber/DataReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ class DataReader : public DomainEntity
* @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED
*/
FASTDDS_EXPORTED_API ReturnCode_t get_matched_publication_data(
builtin::PublicationBuiltinTopicData& publication_data,
PublicationBuiltinTopicData& publication_data,
const fastdds::rtps::InstanceHandle_t& publication_handle) const;

/**
Expand Down
38 changes: 38 additions & 0 deletions include/fastdds/rtps/builtin/data/BuiltinTopicKey.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// 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 BuiltinTopicKey.hpp
*
*/

#ifndef FASTDDS_RTPS_BUILTIN_DATA__BUILTINTOPICKEY_HPP
#define FASTDDS_RTPS_BUILTIN_DATA__BUILTINTOPICKEY_HPP

#include <cstdint>

namespace eprosima {
namespace fastdds {
namespace rtps {

struct BuiltinTopicKey_t
{
uint32_t value[3];
};

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

#endif // FASTDDS_RTPS_BUILTIN_DATA__BUILTINTOPICKEY_HPP
Loading
Loading