diff --git a/examples/C++/RTPSTest_persistent/TestWriterPersistent.cpp b/examples/C++/RTPSTest_persistent/TestWriterPersistent.cpp index 048d7a42380..577195626b2 100644 --- a/examples/C++/RTPSTest_persistent/TestWriterPersistent.cpp +++ b/examples/C++/RTPSTest_persistent/TestWriterPersistent.cpp @@ -34,7 +34,7 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; - +using namespace std; TestWriterPersistent::TestWriterPersistent() : mp_participant(nullptr) diff --git a/examples/C++/RTPSTest_registered/TestWriterRegistered.cpp b/examples/C++/RTPSTest_registered/TestWriterRegistered.cpp index 8c5f8ffa0ca..37b4c5cccf7 100644 --- a/examples/C++/RTPSTest_registered/TestWriterRegistered.cpp +++ b/examples/C++/RTPSTest_registered/TestWriterRegistered.cpp @@ -34,7 +34,7 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; - +using namespace std; TestWriterRegistered::TestWriterRegistered() : mp_participant(nullptr) diff --git a/include/fastdds/rtps/builtin/data/ParticipantProxyData.h b/include/fastdds/rtps/builtin/data/ParticipantProxyData.h index edc46ae51af..e4bd760fa26 100644 --- a/include/fastdds/rtps/builtin/data/ParticipantProxyData.h +++ b/include/fastdds/rtps/builtin/data/ParticipantProxyData.h @@ -21,7 +21,6 @@ #define _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include #include #include diff --git a/include/fastdds/rtps/builtin/data/ReaderProxyData.h b/include/fastdds/rtps/builtin/data/ReaderProxyData.h index 6a41a490f97..dec67ce560b 100644 --- a/include/fastdds/rtps/builtin/data/ReaderProxyData.h +++ b/include/fastdds/rtps/builtin/data/ReaderProxyData.h @@ -22,7 +22,6 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include #include #include diff --git a/include/fastdds/rtps/builtin/data/WriterProxyData.h b/include/fastdds/rtps/builtin/data/WriterProxyData.h index 03211f0655b..cc9b558898f 100644 --- a/include/fastdds/rtps/builtin/data/WriterProxyData.h +++ b/include/fastdds/rtps/builtin/data/WriterProxyData.h @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/include/fastdds/rtps/builtin/liveliness/WLPListener.h b/include/fastdds/rtps/builtin/liveliness/WLPListener.h index adef7ac8074..a1859a202b7 100644 --- a/include/fastdds/rtps/builtin/liveliness/WLPListener.h +++ b/include/fastdds/rtps/builtin/liveliness/WLPListener.h @@ -26,7 +26,6 @@ #include #include -#include namespace eprosima { namespace fastrtps{ diff --git a/include/fastdds/rtps/messages/MessageReceiver.h b/include/fastdds/rtps/messages/MessageReceiver.h index 66d8edd0088..39a84313329 100644 --- a/include/fastdds/rtps/messages/MessageReceiver.h +++ b/include/fastdds/rtps/messages/MessageReceiver.h @@ -21,7 +21,6 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include #include #include diff --git a/include/fastdds/rtps/messages/RTPSMessageGroup.h b/include/fastdds/rtps/messages/RTPSMessageGroup.h index 78c7d3cf6ed..58eeb51e036 100644 --- a/include/fastdds/rtps/messages/RTPSMessageGroup.h +++ b/include/fastdds/rtps/messages/RTPSMessageGroup.h @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/include/fastdds/rtps/rtps_all.h b/include/fastdds/rtps/rtps_all.h index db01734353b..02c9f8af78d 100644 --- a/include/fastdds/rtps/rtps_all.h +++ b/include/fastdds/rtps/rtps_all.h @@ -40,7 +40,6 @@ #include #include -#include #include #include diff --git a/include/fastdds/rtps/transport/tcp/RTCPMessageManager.h b/include/fastdds/rtps/transport/tcp/RTCPMessageManager.h index 9f79d3d55c7..2dd30008457 100644 --- a/include/fastdds/rtps/transport/tcp/RTCPMessageManager.h +++ b/include/fastdds/rtps/transport/tcp/RTCPMessageManager.h @@ -20,7 +20,6 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include #include #include #include diff --git a/include/fastrtps/fastrtps_all.h b/include/fastrtps/fastrtps_all.h index ff65fea0b13..7b63aa0ae72 100644 --- a/include/fastrtps/fastrtps_all.h +++ b/include/fastrtps/fastrtps_all.h @@ -46,7 +46,6 @@ #include #include -#include #include #include diff --git a/include/fastrtps/qos/ParameterList.h b/include/fastrtps/qos/ParameterList.h deleted file mode 100644 index 05e77a79631..00000000000 --- a/include/fastrtps/qos/ParameterList.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 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 ParameterList.h - */ - -#ifndef PARAM_LIST_T_H_ -#define PARAM_LIST_T_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include - -#include -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { - -using ParameterList = fastdds::dds::ParameterList; - -} /* namespace fastrtps */ -} /* namespace eprosima */ -#endif -#endif /* PARAMLISTT_H_ */ diff --git a/src/cpp/fastdds/core/policy/ParameterList.cpp b/src/cpp/fastdds/core/policy/ParameterList.cpp index dcdc65778e1..aa621cd89dc 100644 --- a/src/cpp/fastdds/core/policy/ParameterList.cpp +++ b/src/cpp/fastdds/core/policy/ParameterList.cpp @@ -17,8 +17,8 @@ * */ -#include #include +#include "ParameterList.hpp" #include "ParameterSerializer.hpp" #include @@ -49,146 +49,73 @@ bool ParameterList::updateCacheChangeFromInlineQos( fastrtps::rtps::CDRMessage_t* msg, uint32_t& qos_size) { - auto parameter_process = [&](fastrtps::rtps::CDRMessage_t* msg, const ParameterId_t pid, uint16_t plength) + auto parameter_process = [&]( + fastrtps::rtps::CDRMessage_t* msg, + const ParameterId_t pid, + uint16_t plength) + { + switch (pid) + { + case PID_KEY_HASH: { - switch (pid) + ParameterKey_t p(pid, plength); + if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, msg, plength)) { - case PID_KEY_HASH: - { - ParameterKey_t p(pid, plength); - if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, msg, plength)) - { - return false; - } - - change.instanceHandle = p.key; - break; - } - - case PID_RELATED_SAMPLE_IDENTITY: - { - if (plength >= 24) - { - ParameterSampleIdentity_t p(pid, plength); - if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, - msg, plength)) - { - return false; - } + return false; + } - change.write_params.sample_identity(p.sample_id); - } - break; - } + change.instanceHandle = p.key; + break; + } - case PID_STATUS_INFO: + case PID_RELATED_SAMPLE_IDENTITY: + { + if (plength >= 24) + { + ParameterSampleIdentity_t p(pid, plength); + if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, + msg, plength)) { - ParameterStatusInfo_t p(pid, plength); - if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, msg, - plength)) - { - return false; - } - - if (p.status == 1) - { - change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_DISPOSED; - } - else if (p.status == 2) - { - change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_UNREGISTERED; - } - else if (p.status == 3) - { - change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_DISPOSED_UNREGISTERED; - } - break; + return false; } - default: - break; + change.write_params.sample_identity(p.sample_id); } + break; + } - return true; - }; - try - { - return readParameterListfromCDRMsg(*msg, parameter_process, false, qos_size); - } - catch (std::bad_alloc& ba) - { - std::cerr << "bad_alloc caught: " << ba.what() << '\n'; - return false; - } -} - -bool ParameterList::readParameterListfromCDRMsg( - fastrtps::rtps::CDRMessage_t& msg, - std::function processor, - bool use_encapsulation, - uint32_t& qos_size) -{ - qos_size = 0; - - if (use_encapsulation) - { - // Read encapsulation - msg.pos += 1; - fastrtps::rtps::octet encapsulation = 0; - fastrtps::rtps::CDRMessage::readOctet(&msg, &encapsulation); - if (encapsulation == PL_CDR_BE) - { - msg.msg_endian = fastrtps::rtps::Endianness_t::BIGEND; - } - else if (encapsulation == PL_CDR_LE) - { - msg.msg_endian = fastrtps::rtps::Endianness_t::LITTLEEND; - } - else - { - return false; - } - // Skip encapsulation options - msg.pos += 2; - } - - uint32_t original_pos = msg.pos; - bool is_sentinel = false; - while (!is_sentinel) - { - msg.pos = original_pos + qos_size; + case PID_STATUS_INFO: + { + ParameterStatusInfo_t p(pid, plength); + if (!fastdds::dds::ParameterSerializer::read_from_cdr_message(p, msg, + plength)) + { + return false; + } - ParameterId_t pid; - uint16_t plength = 0; - bool valid = true; - valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); - valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &plength); + if (p.status == 1) + { + change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_DISPOSED; + } + else if (p.status == 2) + { + change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_UNREGISTERED; + } + else if (p.status == 3) + { + change.kind = fastrtps::rtps::ChangeKind_t::NOT_ALIVE_DISPOSED_UNREGISTERED; + } + break; + } - if (pid == PID_SENTINEL) - { - // PID_SENTINEL is always considered of length 0 - plength = 0; - is_sentinel = true; + default: + break; } - qos_size += (4 + plength); - - // Align to 4 byte boundary and prepare for next iteration - qos_size = (qos_size + 3) & ~3; + return true; + }; - if (!valid || ((msg.pos + plength) > msg.length)) - { - return false; - } - else if (!is_sentinel) - { - if (!processor(&msg, pid, plength)) - { - return false; - } - } - } - return true; + return readParameterListfromCDRMsg(*msg, parameter_process, false, qos_size); } bool ParameterList::read_guid_from_cdr_msg( diff --git a/include/fastdds/dds/core/policy/ParameterList.hpp b/src/cpp/fastdds/core/policy/ParameterList.hpp similarity index 66% rename from include/fastdds/dds/core/policy/ParameterList.hpp rename to src/cpp/fastdds/core/policy/ParameterList.hpp index 46ad3ccc5d8..f283ede2dfd 100644 --- a/include/fastdds/dds/core/policy/ParameterList.hpp +++ b/src/cpp/fastdds/core/policy/ParameterList.hpp @@ -69,11 +69,75 @@ class ParameterList * @param[out] qos_size Number of bytes processed. * @return true if parsing was correct, false otherwise. */ + template static bool readParameterListfromCDRMsg( fastrtps::rtps::CDRMessage_t& msg, - std::function processor, + Pred processor, bool use_encapsulation, - uint32_t& qos_size); + uint32_t& qos_size) + { + qos_size = 0; + + if (use_encapsulation) + { + // Read encapsulation + msg.pos += 1; + fastrtps::rtps::octet encapsulation = 0; + fastrtps::rtps::CDRMessage::readOctet(&msg, &encapsulation); + if (encapsulation == PL_CDR_BE) + { + msg.msg_endian = fastrtps::rtps::Endianness_t::BIGEND; + } + else if (encapsulation == PL_CDR_LE) + { + msg.msg_endian = fastrtps::rtps::Endianness_t::LITTLEEND; + } + else + { + return false; + } + // Skip encapsulation options + msg.pos += 2; + } + + uint32_t original_pos = msg.pos; + bool is_sentinel = false; + while (!is_sentinel) + { + msg.pos = original_pos + qos_size; + + ParameterId_t pid; + uint16_t plength = 0; + bool valid = true; + valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); + valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &plength); + + if (pid == PID_SENTINEL) + { + // PID_SENTINEL is always considered of length 0 + plength = 0; + is_sentinel = true; + } + + qos_size += (4 + plength); + + // Align to 4 byte boundary and prepare for next iteration + qos_size = (qos_size + 3) & ~3; + + if (!valid || ((msg.pos + plength) > msg.length)) + { + return false; + } + else if (!is_sentinel) + { + if (!processor(&msg, pid, plength)) + { + return false; + } + } + } + return true; + } /** * Read guid from the KEY_HASH or another specific PID parameter of a CDRMessage diff --git a/src/cpp/fastdds/core/policy/ParameterSerializer.hpp b/src/cpp/fastdds/core/policy/ParameterSerializer.hpp index f5887c9c5c0..560ef476c12 100644 --- a/src/cpp/fastdds/core/policy/ParameterSerializer.hpp +++ b/src/cpp/fastdds/core/policy/ParameterSerializer.hpp @@ -20,7 +20,7 @@ #ifndef FASTDDS_CORE_POLICY__PARAMETERSERIALIZER_HPP_ #define FASTDDS_CORE_POLICY__PARAMETERSERIALIZER_HPP_ -#include +#include "ParameterList.hpp" #include namespace eprosima { diff --git a/src/cpp/fastrtps_deprecated/security/authentication/PKIDH.cpp b/src/cpp/fastrtps_deprecated/security/authentication/PKIDH.cpp index fef669ef138..beaf03b8224 100644 --- a/src/cpp/fastrtps_deprecated/security/authentication/PKIDH.cpp +++ b/src/cpp/fastrtps_deprecated/security/authentication/PKIDH.cpp @@ -25,6 +25,8 @@ #include +#include "../../../fastdds/core/policy/ParameterList.hpp" + #if OPENSSL_VERSION_NUMBER >= 0x10100000L #define IS_OPENSSL_1_1 1 #define OPENSSL_CONST const @@ -55,6 +57,8 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; +using ParameterList = eprosima::fastdds::dds::ParameterList; + static const unsigned char* BN_deserialize_raw( BIGNUM** bn, const unsigned char* raw_pointer, diff --git a/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp b/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp index f2a8144e73a..b941f72512e 100644 --- a/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp +++ b/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp @@ -17,26 +17,31 @@ * */ -#include #include + +#include + +#include #include #include -#include #include -#include -#include #include -#include -#include +#include #include + +#include #include +#include +#include -#include +#include "ProxyDataFilters.hpp" +#include "ProxyHashTables.hpp" #include #include using namespace eprosima::fastrtps; +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp index 097bca03ac2..011f891fa29 100644 --- a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp +++ b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp @@ -18,11 +18,17 @@ */ #include -#include + #include +#include #include -#include -#include "../../../fastdds/core/policy/QosPoliciesSerializer.hpp" + +#include +#include + +#include "ProxyDataFilters.hpp" + +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/builtin/data/WriterProxyData.cpp b/src/cpp/rtps/builtin/data/WriterProxyData.cpp index 3cc3a57c029..dbbfcb08705 100644 --- a/src/cpp/rtps/builtin/data/WriterProxyData.cpp +++ b/src/cpp/rtps/builtin/data/WriterProxyData.cpp @@ -18,10 +18,16 @@ */ #include + #include #include -#include -#include "../../../fastdds/core/policy/QosPoliciesSerializer.hpp" + +#include +#include + +#include "ProxyDataFilters.hpp" + +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp index 57d1dad13bc..50db49589d6 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp @@ -18,27 +18,29 @@ */ #include -#include - -#include -#include -#include -#include -#include +#include #include #include #include +#include + +#include +#include +#include +#include + #include #include -#include #include +#include #include +#include #include @@ -46,6 +48,7 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::types; using eprosima::fastdds::dds::PublicationMatchedStatus; using eprosima::fastdds::dds::SubscriptionMatchedStatus; +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { @@ -772,23 +775,23 @@ bool EDP::validMatching( && wdata->m_qos.m_reliability.kind == BEST_EFFORT_RELIABILITY_QOS) //Means our reader is reliable but hte writer is not { - logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "): Remote Writer " - << wdata->guid() << " is Best Effort and local reader is RELIABLE " << endl; + logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "): Remote Writer " << wdata->guid() + << " is Best Effort and local reader is RELIABLE " ); return false; } if (rdata->m_qos.m_durability.kind > wdata->m_qos.m_durability.kind) { // TODO (MCC) Change log message - logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "):RemoteWriter " - << wdata->guid() << " has VOLATILE DURABILITY and we want TRANSIENT_LOCAL" << endl; + logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "):RemoteWriter " << wdata->guid() + << " has VOLATILE DURABILITY and we want TRANSIENT_LOCAL"; ); return false; } if (rdata->m_qos.m_ownership.kind != wdata->m_qos.m_ownership.kind) { - logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "):Remote Writer " - << wdata->guid() << " has different Ownership Kind" << endl; ); + logWarning(RTPS_EDP, "INCOMPATIBLE QOS (topic: " << wdata->topicName() << "):Remote Writer " << wdata->guid() + << " has different Ownership Kind"); return false; } if (rdata->m_qos.m_deadline.period < wdata->m_qos.m_deadline.period) diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp index 958a4c3066d..58e7f73ca51 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp @@ -17,28 +17,30 @@ * */ -#include +#include "EDPSimpleListeners.h" -#include -#include +#include + +#include #include +#include #include #include #include -#include -#include -#include +#include #include #include +#include +#include +#include -#include - -#include +#include +#include #include -#include +using ParameterList = eprosima::fastdds::dds::ParameterList; // Release reader lock to avoid ABBA lock. PDP mutex should always be first. // Keep change information on local variables to check consistency later diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp index f7da287516a..55b4d22b7a2 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp @@ -17,25 +17,26 @@ * */ -#include - -#include +#include -#include +#include -#include #include -#include -#include - +#include +#include #include #include +#include +#include + +#include +#include #include #include -#include +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/messages/MessageReceiver.cpp b/src/cpp/rtps/messages/MessageReceiver.cpp index 79f65c36f03..0a6c6b5f73b 100644 --- a/src/cpp/rtps/messages/MessageReceiver.cpp +++ b/src/cpp/rtps/messages/MessageReceiver.cpp @@ -18,12 +18,13 @@ */ #include -#include -#include -#include #include +#include +#include + +#include #include #include @@ -34,11 +35,12 @@ #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << +using ParameterList = eprosima::fastdds::dds::ParameterList; + namespace eprosima { namespace fastrtps { namespace rtps { - MessageReceiver::MessageReceiver( RTPSParticipantImpl* participant, uint32_t rec_buffer_size) @@ -185,7 +187,6 @@ void MessageReceiver::processCDRMsg( #if HAVE_SECURITY security::SecurityManager& security = participant_->security_manager(); CDRMessage_t* auxiliary_buffer = &crypto_msg_; - CDRMessage::initCDRMsg(auxiliary_buffer); int decode_ret = security.decode_rtps_message(*msg, *auxiliary_buffer, source_guid_prefix_); @@ -211,7 +212,6 @@ void MessageReceiver::processCDRMsg( CDRMessage_t* submessage = msg; #if HAVE_SECURITY - CDRMessage::initCDRMsg(auxiliary_buffer); decode_ret = security.decode_rtps_submessage(*msg, *auxiliary_buffer, source_guid_prefix_); if (decode_ret < 0) diff --git a/src/cpp/rtps/messages/RTPSMessageCreator.cpp b/src/cpp/rtps/messages/RTPSMessageCreator.cpp index 79ca7a01045..6c552937c60 100644 --- a/src/cpp/rtps/messages/RTPSMessageCreator.cpp +++ b/src/cpp/rtps/messages/RTPSMessageCreator.cpp @@ -18,12 +18,14 @@ */ #include -#include -#include #include +#include + +#include using namespace eprosima::fastrtps; +using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/messages/submessages/DataMsg.hpp b/src/cpp/rtps/messages/submessages/DataMsg.hpp index bc75a1dd51b..b3a24c9a4b9 100644 --- a/src/cpp/rtps/messages/submessages/DataMsg.hpp +++ b/src/cpp/rtps/messages/submessages/DataMsg.hpp @@ -17,7 +17,10 @@ * */ -#include "../../../fastdds/core/policy/ParameterSerializer.hpp" +#include + +#include +#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index 9baf91a6daf..a39dc92f286 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -131,7 +131,7 @@ bool StatefulReader::matched_writer_add( else { logWarning(RTPS_WRITER, "Maximum number of reader proxies (" << max_readers << \ - ") reached for writer " << m_guid << endl); + ") reached for writer " << m_guid); return false; } } diff --git a/src/cpp/rtps/reader/WriterProxy.cpp b/src/cpp/rtps/reader/WriterProxy.cpp index bbbb5d1f122..cd26eb459ba 100644 --- a/src/cpp/rtps/reader/WriterProxy.cpp +++ b/src/cpp/rtps/reader/WriterProxy.cpp @@ -564,7 +564,7 @@ bool WriterProxy::send( return true; } - ResourceLimitedVector remote_locators = remote_locators_shrinked(); + const ResourceLimitedVector& remote_locators = remote_locators_shrinked(); return reader_->send_sync_nts(message, Locators(remote_locators.begin()), diff --git a/src/cpp/rtps/security/SecurityManager.cpp b/src/cpp/rtps/security/SecurityManager.cpp index 1039b136d50..10bf2fe3aaf 100644 --- a/src/cpp/rtps/security/SecurityManager.cpp +++ b/src/cpp/rtps/security/SecurityManager.cpp @@ -3427,6 +3427,8 @@ int SecurityManager::decode_rtps_submessage( return 0; } + CDRMessage::initCDRMsg(&out_message); + std::unique_lock lock(mutex_); const GUID_t remote_participant_key(sending_participant, c_EntityId_RTPSParticipant); diff --git a/src/cpp/rtps/writer/StatefulWriter.cpp b/src/cpp/rtps/writer/StatefulWriter.cpp index 6e97001062a..ab05d50c3ae 100644 --- a/src/cpp/rtps/writer/StatefulWriter.cpp +++ b/src/cpp/rtps/writer/StatefulWriter.cpp @@ -1189,7 +1189,7 @@ bool StatefulWriter::matched_reader_add( { if (it->guid() == rdata.guid()) { - logInfo(RTPS_WRITER, "Attempting to add existing reader, updating information." << endl); + logInfo(RTPS_WRITER, "Attempting to add existing reader, updating information."); if (it->update(rdata)) { update_reader_info(true); @@ -1211,7 +1211,7 @@ bool StatefulWriter::matched_reader_add( else { logWarning(RTPS_WRITER, "Maximum number of reader proxies (" << max_readers << \ - ") reached for writer " << m_guid << endl); + ") reached for writer " << m_guid); return false; } } diff --git a/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h b/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h index a6d870a3a28..97230d8f138 100644 --- a/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h +++ b/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h @@ -22,7 +22,6 @@ #define _FASTDDS_RTPS_MESSAGERECEIVER_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include #include #include diff --git a/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h b/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h index b29c61c9c8b..5f8aeeb7c65 100644 --- a/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h +++ b/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h @@ -18,12 +18,12 @@ #ifndef _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ #define _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ +#include #include #include #include #include #include -#include #if HAVE_SECURITY #include diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index c1f3e0baec1..f4910ab045f 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -32,6 +32,7 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::types; +using namespace std; uint32_t dataspub[] = {12, 28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380}; uint32_t dataspub_large[] = {63996, 131068}; diff --git a/test/performance/video/VideoTestPublisher.cpp b/test/performance/video/VideoTestPublisher.cpp index bb293f7323b..48eb52bf576 100644 --- a/test/performance/video/VideoTestPublisher.cpp +++ b/test/performance/video/VideoTestPublisher.cpp @@ -31,6 +31,9 @@ using namespace eprosima; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using std::cout; +using std::endl; + VideoTestPublisher::VideoTestPublisher() : mp_participant(nullptr) , mp_datapub(nullptr) diff --git a/test/performance/video/VideoTestSubscriber.cpp b/test/performance/video/VideoTestSubscriber.cpp index 795b6035e2e..7b9caeae519 100644 --- a/test/performance/video/VideoTestSubscriber.cpp +++ b/test/performance/video/VideoTestSubscriber.cpp @@ -29,6 +29,9 @@ using namespace eprosima; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using std::cout; +using std::endl; + VideoTestSubscriber::VideoTestSubscriber() : mp_participant(nullptr) , mp_commandpub(nullptr) diff --git a/test/performance/video/main_VideoTest.cpp b/test/performance/video/main_VideoTest.cpp index d0495943fa6..74a6da37e45 100644 --- a/test/performance/video/main_VideoTest.cpp +++ b/test/performance/video/main_VideoTest.cpp @@ -38,6 +38,9 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using std::cout; +using std::endl; + #if defined(_WIN32) #define COPYSTR strcpy_s #else diff --git a/test/profiling/MemoryTestPublisher.cpp b/test/profiling/MemoryTestPublisher.cpp index 12560201092..af368bb196f 100644 --- a/test/profiling/MemoryTestPublisher.cpp +++ b/test/profiling/MemoryTestPublisher.cpp @@ -39,6 +39,8 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::types; +using std::cout; +using std::endl; MemoryTestPublisher::MemoryTestPublisher() : mp_participant(nullptr) diff --git a/test/profiling/MemoryTestSubscriber.cpp b/test/profiling/MemoryTestSubscriber.cpp index 75f6fa13a13..663eca4c19e 100644 --- a/test/profiling/MemoryTestSubscriber.cpp +++ b/test/profiling/MemoryTestSubscriber.cpp @@ -27,6 +27,9 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::types; +using std::cout; +using std::endl; + MemoryTestSubscriber::MemoryTestSubscriber() : mp_participant(nullptr) , mp_commandpub(nullptr) diff --git a/test/profiling/main_MemoryTest.cpp b/test/profiling/main_MemoryTest.cpp index 55152558219..7321b4dbbb3 100644 --- a/test/profiling/main_MemoryTest.cpp +++ b/test/profiling/main_MemoryTest.cpp @@ -37,6 +37,9 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using std::cout; +using std::endl; + #if defined(__LITTLE_ENDIAN__) const Endianness_t DEFAULT_ENDIAN = LITTLEEND; #elif defined (__BIG_ENDIAN__) diff --git a/test/unittest/transport/test_UDPv4Tests.cpp b/test/unittest/transport/test_UDPv4Tests.cpp index f223bc7424c..4c9bc6b08c6 100644 --- a/test/unittest/transport/test_UDPv4Tests.cpp +++ b/test/unittest/transport/test_UDPv4Tests.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/utils/doxygen/examples/fastrtps_example.cpp b/utils/doxygen/examples/fastrtps_example.cpp index 76422183861..396b3d3d2eb 100644 --- a/utils/doxygen/examples/fastrtps_example.cpp +++ b/utils/doxygen/examples/fastrtps_example.cpp @@ -21,6 +21,9 @@ * grcanosa@gmail.com */ +using std::cout; +using std::endl; + using namespace eprosima::pubsub; using namespace eprosima::rtps;