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

[21129] Migrate fastrtps namespace to fastdds #4898

Merged
merged 18 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions examples/cpp/configuration/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class CLIParser
int32_t max_samples = 5000;
int32_t max_instances = 10;
int32_t max_samples_per_instance = 400;
uint32_t deadline = fastrtps::Duration_t::INFINITE_SECONDS;
uint32_t lifespan = fastrtps::Duration_t::INFINITE_SECONDS;
uint32_t liveliness_lease = fastrtps::Duration_t::INFINITE_SECONDS;
uint32_t liveliness_assert = fastrtps::Duration_t::INFINITE_SECONDS - 1;
uint32_t deadline = fastdds::Duration_t::INFINITE_SECONDS;
uint32_t lifespan = fastdds::Duration_t::INFINITE_SECONDS;
uint32_t liveliness_lease = fastdds::Duration_t::INFINITE_SECONDS;
uint32_t liveliness_assert = fastdds::Duration_t::INFINITE_SECONDS - 1;
std::string partitions = "";
std::string profile_participant = "";
std::string topic_name = "configuration_topic";
Expand Down Expand Up @@ -76,7 +76,7 @@ class CLIParser
struct publisher_config : public entity_config
{
uint16_t wait = 0;
uint32_t ack_keep_duration = fastrtps::Duration_t::INFINITE_SECONDS;
uint32_t ack_keep_duration = fastdds::Duration_t::INFINITE_SECONDS;
uint32_t interval = 100;
uint32_t msg_size = 10;
uint32_t ownership_strength = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/configuration/ConfigurationPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "ConfigurationCdrAux.hpp"
#include "ConfigurationTypeObjectSupport.hpp"

using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t;
using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;

ConfigurationPubSubType::ConfigurationPubSubType()
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/configuration/ConfigurationPubSubTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ class ConfigurationPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload) override
eprosima::fastdds::rtps::SerializedPayload_t* payload) override
{
return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION);
}

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool deserialize(
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
void* data) override;

eProsima_user_DllExport std::function<uint32_t()> getSerializedSizeProvider(
Expand All @@ -80,7 +80,7 @@ class ConfigurationPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool getKey(
void* data,
eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
bool force_md5 = false) override;

eProsima_user_DllExport void* createData() override;
Expand Down
10 changes: 5 additions & 5 deletions examples/cpp/configuration/PublisherApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ PublisherApp::PublisherApp(
"DataWriter initialization failed: ownership strength is only valid with exclusive ownership");
}
writer_qos.ownership_strength().value = config.ownership_strength;
writer_qos.deadline().period = eprosima::fastrtps::Duration_t(config.deadline * 1e-3);
writer_qos.deadline().period = eprosima::fastdds::Duration_t(config.deadline * 1e-3);
writer_qos.reliable_writer_qos().disable_positive_acks.enabled = config.disable_positive_ack;
writer_qos.reliable_writer_qos().disable_positive_acks.duration = eprosima::fastrtps::Duration_t(
writer_qos.reliable_writer_qos().disable_positive_acks.duration = eprosima::fastdds::Duration_t(
config.ack_keep_duration * 1e-3);
writer_qos.lifespan().duration = eprosima::fastrtps::Duration_t(config.lifespan * 1e-3);
writer_qos.lifespan().duration = eprosima::fastdds::Duration_t(config.lifespan * 1e-3);
writer_qos.liveliness().kind = config.liveliness;
writer_qos.liveliness().lease_duration = eprosima::fastrtps::Duration_t(
writer_qos.liveliness().lease_duration = eprosima::fastdds::Duration_t(
config.liveliness_lease * 1e-3);
writer_qos.liveliness().announcement_period = eprosima::fastrtps::Duration_t(
writer_qos.liveliness().announcement_period = eprosima::fastdds::Duration_t(
config.liveliness_assert * 1e-3);
writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all());
}
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/configuration/SubscriberApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ SubscriberApp::SubscriberApp(
reader_qos.resource_limits().max_instances = config.max_instances;
reader_qos.resource_limits().max_samples_per_instance = config.max_samples_per_instance;
reader_qos.ownership().kind = config.ownership;
reader_qos.deadline().period = eprosima::fastrtps::Duration_t(config.deadline * 1e-3);
reader_qos.deadline().period = eprosima::fastdds::Duration_t(config.deadline * 1e-3);
reader_qos.reliable_reader_qos().disable_positive_ACKs.enabled = config.disable_positive_ack;
reader_qos.lifespan().duration = eprosima::fastrtps::Duration_t(config.lifespan * 1e-3);
reader_qos.lifespan().duration = eprosima::fastdds::Duration_t(config.lifespan * 1e-3);
reader_qos.liveliness().kind = config.liveliness;
reader_qos.liveliness().lease_duration = eprosima::fastrtps::Duration_t(
reader_qos.liveliness().lease_duration = eprosima::fastdds::Duration_t(
config.liveliness_lease * 1e-3);
reader_qos.liveliness().announcement_period = eprosima::fastrtps::Duration_t(
reader_qos.liveliness().announcement_period = eprosima::fastdds::Duration_t(
config.liveliness_assert * 1e-3);
reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all());
}
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/content_filter/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "HelloWorldCdrAux.hpp"
#include "HelloWorldTypeObjectSupport.hpp"

using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t;
using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;

HelloWorldPubSubType::HelloWorldPubSubType()
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/content_filter/HelloWorldPubSubTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload) override
eprosima::fastdds::rtps::SerializedPayload_t* payload) override
{
return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION);
}

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool deserialize(
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
void* data) override;

eProsima_user_DllExport std::function<uint32_t()> getSerializedSizeProvider(
Expand All @@ -80,7 +80,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool getKey(
void* data,
eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
bool force_md5 = false) override;

eProsima_user_DllExport void* createData() override;
Expand Down
10 changes: 5 additions & 5 deletions examples/cpp/custom_payload_pool/CustomPayloadPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#include <fastdds/rtps/history/IPayloadPool.h>
#include <fastdds/rtps/common/SerializedPayload.h>

class CustomPayloadPool : public eprosima::fastrtps::rtps::IPayloadPool
class CustomPayloadPool : public eprosima::fastdds::rtps::IPayloadPool
{
public:

~CustomPayloadPool() = default;

bool get_payload(
unsigned int size,
eprosima::fastrtps::rtps::SerializedPayload_t& payload)
eprosima::fastdds::rtps::SerializedPayload_t& payload)
{
// Reserve new memory for the payload buffer
unsigned char* payload_buff = new unsigned char[size];
Expand All @@ -51,8 +51,8 @@ class CustomPayloadPool : public eprosima::fastrtps::rtps::IPayloadPool
}

bool get_payload(
const eprosima::fastrtps::rtps::SerializedPayload_t& data,
eprosima::fastrtps::rtps::SerializedPayload_t& payload)
const eprosima::fastdds::rtps::SerializedPayload_t& data,
eprosima::fastdds::rtps::SerializedPayload_t& payload)
{
// Reserve new memory for the payload buffer
unsigned char* payload_buff = new unsigned char[data.length];
Expand All @@ -72,7 +72,7 @@ class CustomPayloadPool : public eprosima::fastrtps::rtps::IPayloadPool
}

bool release_payload(
eprosima::fastrtps::rtps::SerializedPayload_t& payload)
eprosima::fastdds::rtps::SerializedPayload_t& payload)
{
// Ensure precondition
if (this != payload.payload_owner)
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/custom_payload_pool/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "HelloWorldCdrAux.hpp"
#include "HelloWorldTypeObjectSupport.hpp"

using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t;
using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;

HelloWorldPubSubType::HelloWorldPubSubType()
Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/custom_payload_pool/HelloWorldPubSubTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload) override
eprosima::fastdds::rtps::SerializedPayload_t* payload) override
{
return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION);
}

eProsima_user_DllExport bool serialize(
void* data,
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool deserialize(
eprosima::fastrtps::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
void* data) override;

eProsima_user_DllExport std::function<uint32_t()> getSerializedSizeProvider(
Expand All @@ -80,7 +80,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType

eProsima_user_DllExport bool getKey(
void* data,
eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
bool force_md5 = false) override;

eProsima_user_DllExport void* createData() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ bool HelloWorldPublisher::init(

// Create DS SERVER locator
eprosima::fastdds::rtps::Locator server_locator;
eprosima::fastrtps::rtps::IPLocator::setPhysicalPort(server_locator, server_port);
eprosima::fastdds::rtps::IPLocator::setPhysicalPort(server_locator, server_port);

std::shared_ptr<eprosima::fastdds::rtps::TransportDescriptorInterface> descriptor;

Expand All @@ -103,7 +103,7 @@ bool HelloWorldPublisher::init(
descriptor = descriptor_tmp;

server_locator.kind = LOCATOR_KIND_UDPv4;
eprosima::fastrtps::rtps::IPLocator::setIPv4(server_locator, ip_server_address);
eprosima::fastdds::rtps::IPLocator::setIPv4(server_locator, ip_server_address);
break;
}

Expand All @@ -114,7 +114,7 @@ bool HelloWorldPublisher::init(
descriptor = descriptor_tmp;

server_locator.kind = LOCATOR_KIND_UDPv6;
eprosima::fastrtps::rtps::IPLocator::setIPv6(server_locator, ip_server_address);
eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, ip_server_address);
break;
}

Expand All @@ -127,8 +127,8 @@ bool HelloWorldPublisher::init(
descriptor = descriptor_tmp;

server_locator.kind = LOCATOR_KIND_TCPv4;
eprosima::fastrtps::rtps::IPLocator::setLogicalPort(server_locator, server_port);
eprosima::fastrtps::rtps::IPLocator::setIPv4(server_locator, ip_server_address);
eprosima::fastdds::rtps::IPLocator::setLogicalPort(server_locator, server_port);
eprosima::fastdds::rtps::IPLocator::setIPv4(server_locator, ip_server_address);
break;
}

Expand All @@ -141,8 +141,8 @@ bool HelloWorldPublisher::init(
descriptor = descriptor_tmp;

server_locator.kind = LOCATOR_KIND_TCPv6;
eprosima::fastrtps::rtps::IPLocator::setLogicalPort(server_locator, server_port);
eprosima::fastrtps::rtps::IPLocator::setIPv6(server_locator, ip_server_address);
eprosima::fastdds::rtps::IPLocator::setLogicalPort(server_locator, server_port);
eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, ip_server_address);
break;
}

Expand All @@ -152,7 +152,7 @@ bool HelloWorldPublisher::init(

// Set participant as DS CLIENT
pqos.wire_protocol().builtin.discovery_config.discoveryProtocol =
eprosima::fastrtps::rtps::DiscoveryProtocol_t::CLIENT;
eprosima::fastdds::rtps::DiscoveryProtocol::CLIENT;

// Set SERVER's GUID prefix
RemoteServerAttributes remote_server_att;
Expand Down Expand Up @@ -255,16 +255,16 @@ void HelloWorldPublisher::PubListener::on_publication_matched(

void HelloWorldPublisher::PubListener::on_participant_discovery(
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info,
eprosima::fastdds::rtps::ParticipantDiscoveryInfo&& info,
bool& should_be_ignored)
{
static_cast<void>(should_be_ignored);
if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT)
if (info.status == eprosima::fastdds::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT)
{
std::cout << "Discovered Participant with GUID " << info.info.m_guid << std::endl;
}
else if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT ||
info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT)
else if (info.status == eprosima::fastdds::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT ||
info.status == eprosima::fastdds::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT)
{
std::cout << "Dropped Participant with GUID " << info.info.m_guid << std::endl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class HelloWorldPublisher
//! Callback executed when a DomainParticipant is discovered, dropped or removed
void on_participant_discovery(
eprosima::fastdds::dds::DomainParticipant* /*participant*/,
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info,
eprosima::fastdds::rtps::ParticipantDiscoveryInfo&& info,
bool& should_be_ignored) override;

private:
Expand Down
Loading
Loading