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

[20709] Make rtps messages headers private #4657

Merged
merged 7 commits into from
May 24, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/fastdds/dds/core/policy/ParameterTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <fastdds/rtps/common/all_common.h>
#include <fastdds/rtps/common/Token.h>
#include <fastdds/rtps/messages/CDRMessage.h>

#if HAVE_SECURITY
#include <fastdds/rtps/security/accesscontrol/ParticipantSecurityAttributes.h>
Expand Down
6 changes: 3 additions & 3 deletions include/fastdds/rtps/messages/RTPSMessageSenderInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#include <vector>

#include <fastdds/rtps/common/Guid.h>
#include <fastdds/rtps/messages/CDRMessage.h>

namespace eprosima {
namespace fastrtps {
namespace rtps {

struct CDRMessage_t;

/**
* An interface used in \ref RTPSMessageGroup to handle destinations management
* and message sending.
* Interface to handle destinations management and message sending.
*/
class RTPSMessageSenderInterface
{
Expand Down
1 change: 0 additions & 1 deletion include/fastdds/rtps/reader/StatefulReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <fastdds/rtps/common/CDRMessage_t.h>
#include <fastdds/rtps/common/VendorId_t.hpp>
#include <fastdds/rtps/messages/RTPSMessageGroup.h>
#include <fastdds/rtps/reader/RTPSReader.h>
#include <fastdds/utils/collections/ResourceLimitedVector.hpp>

Expand Down
12 changes: 10 additions & 2 deletions include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@
#define _FASTDDS_TEST_UDPV4_TRANSPORT_DESCRIPTOR_

#include <functional>
#include <atomic>

#include <fastdds/rtps/transport/SocketTransportDescriptor.h>
#include <fastdds/rtps/common/SequenceNumber.h>
#include <fastdds/rtps/messages/CDRMessage.h>



namespace eprosima {
namespace fastrtps {
namespace rtps {

struct CDRMessage_t;
} //rtps
} //fastrtps
namespace fastdds {
namespace rtps {

Expand All @@ -32,7 +40,7 @@ namespace rtps {
struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor
{
//! Custom message filtering functions
typedef std::function<bool (fastrtps::rtps::CDRMessage_t& msg)> filter;
typedef std::function<bool (eprosima::fastrtps::rtps::CDRMessage_t& msg)> filter;
//! Locator filtering function
typedef std::function<bool (const Locator& destination)> DestinationLocatorFilter;

Expand Down
45 changes: 1 addition & 44 deletions include/fastdds/rtps/writer/RTPSWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <fastdds/rtps/common/VendorId_t.hpp>
#include <fastdds/rtps/Endpoint.h>
#include <fastdds/rtps/interfaces/IReaderDataFilter.hpp>
#include <fastdds/rtps/messages/RTPSMessageGroup.h>
#include <fastdds/rtps/writer/DeliveryRetCode.hpp>
#include <fastdds/rtps/writer/LocatorSelectorSender.hpp>
#include <fastdds/statistics/rtps/monitor_service/connections_fwd.hpp>
Expand All @@ -61,6 +60,7 @@ namespace rtps {
class WriterListener;
class WriterHistory;
class DataSharingNotifier;
class RTPSMessageGroup;
struct CacheChange_t;

/**
Expand Down Expand Up @@ -588,49 +588,6 @@ class RTPSWriter

bool is_pool_initialized() const;

template<typename Functor>
bool send_data_or_fragments(
RTPSMessageGroup& group,
CacheChange_t* change,
bool inline_qos,
Functor sent_fun)
{
bool sent_ok = true;

uint32_t n_fragments = change->getFragmentCount();
if (n_fragments > 0)
{
for (FragmentNumber_t frag = 1; frag <= n_fragments; frag++)
{
sent_ok &= group.add_data_frag(*change, frag, inline_qos);
if (sent_ok)
{
sent_fun(change, frag);
}
else
{
EPROSIMA_LOG_ERROR(RTPS_WRITER,
"Error sending fragment (" << change->sequenceNumber << ", " << frag << ")");
break;
}
}
}
else
{
sent_ok = group.add_data(*change, inline_qos);
if (sent_ok)
{
sent_fun(change, 0);
}
else
{
EPROSIMA_LOG_ERROR(RTPS_WRITER, "Error sending change " << change->sequenceNumber);
}
}

return sent_ok;
}

void add_statistics_sent_submessage(
CacheChange_t* change,
size_t num_locators);
Expand Down
2 changes: 1 addition & 1 deletion include/fastdds/rtps/writer/ReaderLocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <fastdds/rtps/common/Locator.h>
#include <fastdds/rtps/common/Guid.h>
#include <fastdds/rtps/common/SequenceNumber.h>
#include <fastdds/rtps/messages/RTPSMessageGroup.h>
#include <fastdds/rtps/messages/RTPSMessageSenderInterface.hpp>
#include <fastdds/rtps/common/LocatorSelectorEntry.hpp>

namespace eprosima {
Expand Down
2 changes: 2 additions & 0 deletions include/fastdds/rtps/writer/StatelessWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace eprosima {
namespace fastrtps {
namespace rtps {

class RTPSMessageGroup;

/**
* Class StatelessWriter, specialization of RTPSWriter that manages writers that don't keep state of the matched readers.
Expand All @@ -46,6 +47,7 @@ namespace rtps {
class StatelessWriter : public RTPSWriter
{
friend class RTPSParticipantImpl;
friend class RTPSMessageGroup;

protected:

Expand Down
1 change: 1 addition & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ set(${PROJECT_NAME}_source_files
rtps/history/TopicPayloadPool.cpp
rtps/history/TopicPayloadPoolRegistry.cpp
rtps/history/WriterHistory.cpp
rtps/messages/CDRMessage.cpp
rtps/messages/MessageReceiver.cpp
rtps/messages/RTPSGapBuilder.cpp
rtps/messages/RTPSMessageCreator.cpp
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/fastdds/core/policy/ParameterList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#define _FASTDDS_DDS_QOS_PARAMETERLIST_HPP_
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#include <functional>

#include <fastdds/dds/core/policy/ParameterTypes.hpp>
#include <fastdds/rtps/messages/RTPS_messages.h>
#include <fastdds/rtps/common/CDRMessage_t.h>
#include <fastdds/rtps/messages/CDRMessage.h>
#include <fastdds/rtps/common/CacheChange.h>
#include <fastdds/rtps/messages/RTPS_messages.h>

#include <functional>
#include <rtps/messages/CDRMessage.hpp>

namespace eprosima {
namespace fastdds {
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/topic/ContentFilterInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <fastdds/dds/core/policy/ParameterTypes.hpp>
#include <fastdds/rtps/common/SerializedPayload.h>
#include <fastdds/rtps/common/CDRMessage_t.h>
#include <fastdds/rtps/messages/CDRMessage.h>
#include <rtps/messages/CDRMessage.hpp>

namespace eprosima {
namespace fastdds {
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#include <fastdds/dds/core/policy/ParameterTypes.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/rtps/messages/CDRMessage.h>
#include <fastdds/subscriber/DataReaderImpl.hpp>
#include <fastdds/topic/ContentFilterUtils.hpp>
#include <fastdds/topic/TopicProxy.hpp>
#include <fastdds/utils/md5.h>
#include <rtps/messages/CDRMessage.hpp>

namespace eprosima {
namespace fastdds {
Expand Down
3 changes: 1 addition & 2 deletions src/cpp/rtps/builtin/discovery/participant/PDPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
#define _FASTDDS_RTPS_PDPCLIENT_H_
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#include <fastdds/rtps/messages/RTPSMessageGroup.h>

#include <rtps/builtin/discovery/participant/DS/DiscoveryServerPDPEndpoints.hpp>
#include <rtps/builtin/discovery/participant/DS/DiscoveryServerPDPEndpointsSecure.hpp>
#include <rtps/builtin/discovery/participant/PDP.h>
#include <rtps/builtin/discovery/participant/timedevent/DSClientEvent.h>
#include <rtps/messages/RTPSMessageGroup.hpp>

namespace eprosima {
namespace fastdds {
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <rtps/builtin/discovery/database/DiscoveryDataFilter.hpp>
#include <rtps/builtin/discovery/participant/DS/DiscoveryServerPDPEndpointsSecure.hpp>
#include <rtps/builtin/discovery/participant/timedevent/DServerEvent.hpp>
#include <rtps/messages/RTPSMessageGroup.hpp>

namespace eprosima {
namespace fastdds {
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/builtin/liveliness/WLPListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
#include <fastdds/rtps/common/SerializedPayload.h>
#include <fastdds/rtps/common/Types.h>
#include <fastdds/rtps/history/ReaderHistory.h>
#include <fastdds/rtps/messages/CDRMessage.h>
#include <fastdds/rtps/reader/RTPSReader.h>

#include <rtps/builtin/BuiltinProtocols.h>
#include <rtps/builtin/discovery/participant/PDPSimple.h>
#include <rtps/builtin/liveliness/WLP.h>
#include <rtps/messages/CDRMessage.hpp>
#include <rtps/writer/LivelinessManager.hpp>

namespace eprosima {
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/flowcontrol/FlowControllerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <fastdds/utils/TimedMutex.hpp>

#include <rtps/participant/RTPSParticipantImpl.h>
#include <rtps/messages/RTPSMessageGroup.hpp>
#include <utils/thread.hpp>
#include <utils/threading.hpp>

Expand Down
5 changes: 3 additions & 2 deletions src/cpp/rtps/history/WriterHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

#include <fastdds/rtps/history/WriterHistory.h>

#include <mutex>

#include <fastdds/dds/log/Log.hpp>
#include <fastdds/rtps/writer/RTPSWriter.h>
#include <fastdds/rtps/common/WriteParams.h>
#include <fastdds/core/policy//ParameterSerializer.hpp>

#include <mutex>
#include <rtps/messages/RTPSMessageGroup.hpp>

namespace eprosima {
namespace fastrtps {
Expand Down
Loading
Loading