From 8aa916eedac772a971c59e9494a497415d856544 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 17 Jun 2024 08:52:43 +0200 Subject: [PATCH] Refs #21129: Apply suggestions Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- .../rtps/attributes/ServerAttributes.h | 11 ------ .../type_lookup_service/TypeLookupManager.cpp | 1 - src/cpp/fastdds/domain/DomainParticipant.cpp | 9 +++-- .../domain/DomainParticipantFactory.cpp | 24 ++++++------- .../fastdds/domain/DomainParticipantImpl.cpp | 35 +++++++++---------- src/cpp/fastdds/publisher/DataWriterImpl.hpp | 2 +- src/cpp/fastdds/publisher/Publisher.cpp | 9 +++-- .../fastdds/publisher/qos/DataWriterQos.cpp | 13 ++++--- src/cpp/fastdds/subscriber/ReadCondition.cpp | 8 ++++- src/cpp/fastdds/subscriber/Subscriber.cpp | 9 +++-- src/cpp/fastdds/subscriber/SubscriberImpl.cpp | 9 +++-- .../subscriber/history/DataReaderHistory.cpp | 2 +- .../DDSFilterExpressionParser.cpp | 2 +- src/cpp/fastdds/topic/qos/TopicQos.cpp | 10 ++++-- src/cpp/fastdds/utils/QosConverters.cpp | 2 +- src/cpp/fastdds/utils/QosConverters.hpp | 2 -- src/cpp/rtps/attributes/PropertyPolicy.cpp | 8 ++++- src/cpp/rtps/attributes/ThreadSettings.cpp | 8 ++++- src/cpp/rtps/attributes/TopicAttributes.cpp | 6 +++- .../rtps/builtin/discovery/endpoint/EDP.cpp | 2 -- .../discovery/participant/PDPServer.cpp | 2 -- .../discovery/participant/PDPServer.hpp | 2 +- .../participant/PDPServerListener.cpp | 2 -- src/cpp/rtps/common/Token.cpp | 8 ++++- src/cpp/rtps/exceptions/Exception.cpp | 10 ++++-- src/cpp/rtps/network/NetworkFactory.cpp | 1 - src/cpp/rtps/network/ReceiverResource.cpp | 1 - .../rtps/participant/RTPSParticipantImpl.cpp | 1 - src/cpp/rtps/reader/BaseReader.cpp | 1 - src/cpp/rtps/reader/StatefulReader.cpp | 9 ++++- src/cpp/rtps/reader/StatelessReader.cpp | 9 ++++- src/cpp/rtps/reader/WriterProxy.cpp | 4 +-- src/cpp/rtps/security/SecurityManager.cpp | 12 +++++-- .../rtps/security/SecurityPluginFactory.cpp | 11 ++++-- .../PortBasedTransportDescriptor.cpp | 2 -- .../SharedMemTransportDescriptor.cpp | 10 +++--- .../rtps/transport/tcp/RTCPMessageManager.cpp | 2 -- src/cpp/rtps/writer/StatefulWriter.cpp | 2 +- src/cpp/rtps/writer/StatelessWriter.cpp | 2 +- .../security/accesscontrol/Permissions.cpp | 12 +++++-- src/cpp/security/authentication/PKIDH.cpp | 12 +++++-- .../cryptography/AESGCMGMAC_KeyFactory.cpp | 11 ++++-- .../cryptography/AESGCMGMAC_Transform.cpp | 11 ++++-- .../fastdds/domain/DomainParticipantImpl.cpp | 6 ++-- .../interfaces/IProxyQueryable.hpp | 4 +-- src/cpp/utils/IPFinder.cpp | 10 ++++-- .../rtps/attributes/ServerAttributes.h | 3 -- .../dds/participant/ParticipantTests.cpp | 3 -- .../unittest/dds/publisher/PublisherTests.cpp | 2 +- .../dds/subscriber/SubscriberTests.cpp | 2 +- .../xmlparser/XMLElementParserTests.cpp | 22 ++++++------ 51 files changed, 218 insertions(+), 143 deletions(-) diff --git a/include/fastdds/rtps/attributes/ServerAttributes.h b/include/fastdds/rtps/attributes/ServerAttributes.h index af1769475cf..2fb237b7f68 100644 --- a/include/fastdds/rtps/attributes/ServerAttributes.h +++ b/include/fastdds/rtps/attributes/ServerAttributes.h @@ -216,17 +216,6 @@ FASTDDS_EXPORTED_API bool get_server_client_default_guidPrefix( int id, fastdds::rtps::GuidPrefix_t& guid); -using fastdds::rtps::RemoteServerAttributes; -using fastdds::rtps::RemoteServerList_t; -using fastdds::rtps::DEFAULT_ROS2_SERVER_PORT; -using fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX; -using fastdds::rtps::DEFAULT_ROS2_MASTER_URI; -using fastdds::rtps::ROS_SUPER_CLIENT; -using fastdds::rtps::load_environment_server_info; -using fastdds::rtps::ros_discovery_server_env; -using fastdds::rtps::get_server_client_default_guidPrefix; -using fastdds::rtps::ros_super_client_env; - } // rtps } // fastdds diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp index 6b554278892..c1060e248bc 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp @@ -45,7 +45,6 @@ namespace eprosima { using namespace fastdds::rtps; -using eprosima::fastdds::dds::Log; namespace fastdds { namespace dds { diff --git a/src/cpp/fastdds/domain/DomainParticipant.cpp b/src/cpp/fastdds/domain/DomainParticipant.cpp index 6709e76872a..e3ca26df51d 100644 --- a/src/cpp/fastdds/domain/DomainParticipant.cpp +++ b/src/cpp/fastdds/domain/DomainParticipant.cpp @@ -22,8 +22,9 @@ #include #include -using namespace eprosima; -using namespace eprosima::fastdds::dds; +namespace eprosima { +namespace fastdds { +namespace dds{ DomainParticipant::DomainParticipant( const StatusMask& mask) @@ -496,3 +497,7 @@ bool DomainParticipant::has_active_entities() { return impl_->has_active_entities(); } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp index ca880a831d9..733087f5b9c 100644 --- a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp @@ -42,8 +42,6 @@ using namespace eprosima::fastdds::xmlparser; -using eprosima::fastdds::dds::Log; - using eprosima::fastdds::rtps::RTPSDomain; using eprosima::fastdds::rtps::RTPSParticipant; @@ -55,8 +53,8 @@ DomainParticipantFactory::DomainParticipantFactory() : default_xml_profiles_loaded(false) , default_domain_id_(0) , default_participant_qos_(PARTICIPANT_QOS_DEFAULT) - , topic_pool_(fastdds::rtps::TopicPayloadPoolRegistry::instance()) - , rtps_domain_(fastdds::rtps::RTPSDomainImpl::get_instance()) + , topic_pool_(rtps::TopicPayloadPoolRegistry::instance()) + , rtps_domain_(rtps::RTPSDomainImpl::get_instance()) , log_resources_(detail::get_log_resources()) { } @@ -77,11 +75,11 @@ DomainParticipantFactory::~DomainParticipantFactory() } // Deletes DynamicTypes and TypeObject factories - fastdds::dds::DynamicDataFactory::delete_instance(); - fastdds::dds::DynamicTypeBuilderFactory::delete_instance(); + dds::DynamicDataFactory::delete_instance(); + dds::DynamicTypeBuilderFactory::delete_instance(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); - eprosima::fastdds::dds::Log::KillThread(); + Log::KillThread(); } DomainParticipantFactory* DomainParticipantFactory::get_instance() @@ -112,8 +110,8 @@ ReturnCode_t DomainParticipantFactory::delete_participant( std::lock_guard guard(mtx_participants_); #ifdef FASTDDS_STATISTICS // Delete builtin statistics entities - eprosima::fastdds::statistics::dds::DomainParticipantImpl* stat_part_impl = - static_cast(part->impl_); + statistics::dds::DomainParticipantImpl* stat_part_impl = + static_cast(part->impl_); stat_part_impl->delete_statistics_builtin_entities(); #endif // ifdef FASTDDS_STATISTICS if (part->has_active_entities()) @@ -165,8 +163,8 @@ DomainParticipant* DomainParticipantFactory::create_participant( #ifndef FASTDDS_STATISTICS DomainParticipantImpl* dom_part_impl = new DomainParticipantImpl(dom_part, did, pqos, listener); #else - eprosima::fastdds::statistics::dds::DomainParticipantImpl* dom_part_impl = - new eprosima::fastdds::statistics::dds::DomainParticipantImpl(dom_part, did, pqos, listener); + statistics::dds::DomainParticipantImpl* dom_part_impl = + new statistics::dds::DomainParticipantImpl(dom_part, did, pqos, listener); #endif // FASTDDS_STATISTICS if (fastdds::rtps::GUID_t::unknown() != dom_part_impl->guid()) @@ -362,7 +360,7 @@ ReturnCode_t DomainParticipantFactory::load_profiles() reset_default_participant_qos(); } // Take the default domain id from the default participant profile - eprosima::fastdds::ParticipantAttributes attr; + ParticipantAttributes attr; XMLProfileManager::getDefaultParticipantAttributes(attr); default_domain_id_ = attr.domainId; @@ -398,7 +396,7 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_string( ReturnCode_t DomainParticipantFactory::check_xml_static_discovery( std::string& xml_file) { - eprosima::fastdds::xmlparser::XMLEndpointParser parser; + xmlparser::XMLEndpointParser parser; if (XMLP_ret::XML_OK != parser.loadXMLFile(xml_file)) { EPROSIMA_LOG_ERROR(DOMAIN, "Error parsing xml file"); diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 38de35acf2d..21e56ba07ca 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -71,26 +71,23 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastdds::xmlparser::XMLProfileManager; -using fastdds::xmlparser::XMLP_ret; -using fastdds::TopicAttributes; -using fastdds::rtps::ParticipantDiscoveryInfo; -using fastdds::rtps::RTPSDomain; -using fastdds::rtps::RTPSDomainImpl; -using fastdds::rtps::RTPSParticipant; -using fastdds::TopicAttributes; -using fastdds::xmlparser::XMLP_ret; -using fastdds::xmlparser::XMLProfileManager; +using xmlparser::XMLProfileManager; +using xmlparser::XMLP_ret; +using rtps::ParticipantDiscoveryInfo; +using rtps::RTPSDomain; +using rtps::RTPSDomainImpl; +using rtps::RTPSParticipant; +using xmlparser::XMLP_ret; +using xmlparser::XMLProfileManager; #if HAVE_SECURITY -using fastdds::rtps::ParticipantAuthenticationInfo; +using rtps::ParticipantAuthenticationInfo; #endif // if HAVE_SECURITY -using eprosima::fastdds::dds::Log; -using fastdds::rtps::EndpointKind_t; -using fastdds::rtps::ReaderDiscoveryInfo; -using fastdds::rtps::ReaderProxyData; -using fastdds::rtps::ResourceEvent; -using fastdds::rtps::WriterDiscoveryInfo; -using fastdds::rtps::WriterProxyData; +using rtps::EndpointKind_t; +using rtps::ReaderDiscoveryInfo; +using rtps::ReaderProxyData; +using rtps::ResourceEvent; +using rtps::WriterDiscoveryInfo; +using rtps::WriterProxyData; DomainParticipantImpl::DomainParticipantImpl( DomainParticipant* dp, @@ -1858,7 +1855,7 @@ bool DomainParticipantImpl::can_qos_be_updated( void DomainParticipantImpl::create_instance_handle( InstanceHandle_t& handle) { - using eprosima::fastdds::rtps::octet; + using rtps::octet; uint32_t id = ++next_instance_id_; handle = guid_; diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/fastdds/publisher/DataWriterImpl.hpp index 0914f10ace7..87c2d8522ad 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.hpp @@ -451,7 +451,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter private: - using fastdds::rtps::WriterListener::onWriterMatched; + using rtps::WriterListener::onWriterMatched; } writer_listener_; diff --git a/src/cpp/fastdds/publisher/Publisher.cpp b/src/cpp/fastdds/publisher/Publisher.cpp index b9aeaad3877..a05dffbf18f 100644 --- a/src/cpp/fastdds/publisher/Publisher.cpp +++ b/src/cpp/fastdds/publisher/Publisher.cpp @@ -23,8 +23,9 @@ #include -using namespace eprosima; -using namespace eprosima::fastdds::dds; +namespace eprosima { +namespace fastdds { +namespace dds{ Publisher::Publisher( PublisherImpl* p, @@ -235,3 +236,7 @@ ReturnCode_t Publisher::get_datawriter_qos_from_profile( { return impl_->get_datawriter_qos_from_profile(profile_name, qos); } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp b/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp index 267df91096c..3f6ac8e3315 100644 --- a/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp +++ b/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp @@ -19,11 +19,12 @@ #include #include +namespace eprosima { +namespace fastdds { +namespace dds{ -using namespace eprosima::fastdds::dds; - -const DataWriterQos eprosima::fastdds::dds::DATAWRITER_QOS_DEFAULT; -const DataWriterQos eprosima::fastdds::dds::DATAWRITER_QOS_USE_TOPIC_QOS; +const DataWriterQos DATAWRITER_QOS_DEFAULT; +const DataWriterQos DATAWRITER_QOS_USE_TOPIC_QOS; DataWriterQos::DataWriterQos() { @@ -64,3 +65,7 @@ WriterQos DataWriterQos::get_writerqos( return qos; } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima \ No newline at end of file diff --git a/src/cpp/fastdds/subscriber/ReadCondition.cpp b/src/cpp/fastdds/subscriber/ReadCondition.cpp index fc773e2ecc7..9a1b0ef517e 100644 --- a/src/cpp/fastdds/subscriber/ReadCondition.cpp +++ b/src/cpp/fastdds/subscriber/ReadCondition.cpp @@ -18,7 +18,9 @@ #include -using namespace eprosima::fastdds::dds; +namespace eprosima { +namespace fastdds { +namespace dds{ ReadCondition::ReadCondition() { @@ -57,3 +59,7 @@ InstanceStateMask ReadCondition::get_instance_state_mask() const noexcept assert((bool)impl_); return impl_->get_instance_state_mask(); } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/subscriber/Subscriber.cpp b/src/cpp/fastdds/subscriber/Subscriber.cpp index 5c03bbc9527..841f8266ed2 100644 --- a/src/cpp/fastdds/subscriber/Subscriber.cpp +++ b/src/cpp/fastdds/subscriber/Subscriber.cpp @@ -21,8 +21,9 @@ #include #include -using namespace eprosima; -using namespace eprosima::fastdds::dds; +namespace eprosima { +namespace fastdds { +namespace dds{ Subscriber::Subscriber( SubscriberImpl* pimpl, @@ -233,3 +234,7 @@ const fastdds::rtps::InstanceHandle_t& Subscriber::get_instance_handle() const { return impl_->get_instance_handle(); } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp index beff06165e8..81ff756b712 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp @@ -45,11 +45,10 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastdds::xmlparser::XMLProfileManager; -using fastdds::xmlparser::XMLP_ret; -using fastdds::rtps::InstanceHandle_t; -using fastdds::rtps::Property; -using fastdds::Duration_t; +using xmlparser::XMLProfileManager; +using xmlparser::XMLP_ret; +using rtps::InstanceHandle_t; +using rtps::Property; SubscriberImpl::SubscriberImpl( DomainParticipantImpl* p, diff --git a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp index da4259c83f8..6ed2111e228 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp @@ -42,7 +42,7 @@ namespace fastdds { namespace dds { namespace detail { -using eprosima::fastdds::RecursiveTimedMutex; +using fastdds::RecursiveTimedMutex; static HistoryAttributes to_history_attributes( const TypeSupport& type, diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp index a709ec8daef..ffee448fbe9 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp @@ -38,7 +38,7 @@ namespace DDSSQLFilter { namespace parser { using namespace tao::TAO_PEGTL_NAMESPACE; -using namespace eprosima::fastdds::dds::xtypes; +using namespace xtypes; #include "DDSFilterExpressionParserImpl/rearrange.hpp" #include "DDSFilterExpressionParserImpl/literal_values.hpp" diff --git a/src/cpp/fastdds/topic/qos/TopicQos.cpp b/src/cpp/fastdds/topic/qos/TopicQos.cpp index f09e771fd6a..3a4c780092f 100644 --- a/src/cpp/fastdds/topic/qos/TopicQos.cpp +++ b/src/cpp/fastdds/topic/qos/TopicQos.cpp @@ -19,12 +19,18 @@ #include -using namespace eprosima::fastdds::dds; +namespace eprosima { +namespace fastdds { +namespace dds{ -const TopicQos eprosima::fastdds::dds::TOPIC_QOS_DEFAULT; +const TopicQos TOPIC_QOS_DEFAULT; TopicQos::TopicQos() { reliability_.kind = RELIABLE_RELIABILITY_QOS; durability_.kind = TRANSIENT_LOCAL_DURABILITY_QOS; } + +} // namespace dds +} // namespace fastdds +} // namespace eprosima \ No newline at end of file diff --git a/src/cpp/fastdds/utils/QosConverters.cpp b/src/cpp/fastdds/utils/QosConverters.cpp index 63455dcd27a..5b20e188ab3 100644 --- a/src/cpp/fastdds/utils/QosConverters.cpp +++ b/src/cpp/fastdds/utils/QosConverters.cpp @@ -27,7 +27,7 @@ namespace fastdds { namespace dds { namespace utils { -using fastdds::rtps::Property; +using rtps::Property; using std::string; void set_qos_from_attributes( diff --git a/src/cpp/fastdds/utils/QosConverters.hpp b/src/cpp/fastdds/utils/QosConverters.hpp index f0cb08515a6..a49fd43106e 100644 --- a/src/cpp/fastdds/utils/QosConverters.hpp +++ b/src/cpp/fastdds/utils/QosConverters.hpp @@ -39,8 +39,6 @@ namespace fastdds { namespace dds { namespace utils { -using fastdds::TopicAttributes; - /** * Obtains the DataWriterQos from the PublisherAttributes provided. * diff --git a/src/cpp/rtps/attributes/PropertyPolicy.cpp b/src/cpp/rtps/attributes/PropertyPolicy.cpp index 58bcd4bc2c6..d76e6081624 100644 --- a/src/cpp/rtps/attributes/PropertyPolicy.cpp +++ b/src/cpp/rtps/attributes/PropertyPolicy.cpp @@ -20,7 +20,9 @@ #include -using namespace eprosima::fastdds::rtps; +namespace eprosima { +namespace fastdds { +namespace rtps{ PropertyPolicy PropertyPolicyHelper::get_properties_with_prefix( const PropertyPolicy& property_policy, @@ -118,3 +120,7 @@ const Property* PropertyPolicyHelper::get_property( return returnedValue; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/attributes/ThreadSettings.cpp b/src/cpp/rtps/attributes/ThreadSettings.cpp index 0c2761539f6..f4a88fe2d91 100644 --- a/src/cpp/rtps/attributes/ThreadSettings.cpp +++ b/src/cpp/rtps/attributes/ThreadSettings.cpp @@ -14,7 +14,9 @@ #include -using namespace eprosima::fastdds::rtps; +namespace eprosima { +namespace fastdds { +namespace rtps{ bool ThreadSettings::operator ==( const ThreadSettings& rhs) const @@ -30,3 +32,7 @@ bool ThreadSettings::operator !=( { return !(*this == rhs); } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima \ No newline at end of file diff --git a/src/cpp/rtps/attributes/TopicAttributes.cpp b/src/cpp/rtps/attributes/TopicAttributes.cpp index 7fc58b8c768..2cef11846d2 100644 --- a/src/cpp/rtps/attributes/TopicAttributes.cpp +++ b/src/cpp/rtps/attributes/TopicAttributes.cpp @@ -19,7 +19,8 @@ #include #include -using namespace eprosima::fastdds; +namespace eprosima { +namespace fastdds { bool TopicAttributes::checkQos() const { @@ -70,3 +71,6 @@ bool TopicAttributes::checkQos() const } return true; } + +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp index 0b9c8574099..d0043de4023 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp @@ -53,7 +53,6 @@ using eprosima::fastdds::dds::PublicationMatchedStatus; using eprosima::fastdds::dds::SubscriptionMatchedStatus; using ParameterList = eprosima::fastdds::dds::ParameterList; -using BaseReader = eprosima::fastdds::rtps::BaseReader; namespace eprosima { namespace fastdds { @@ -1365,6 +1364,5 @@ const fastdds::dds::PublicationMatchedStatus& EDP::update_publication_matched_st } } // namespace rtps - } // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp index 69abf408c39..da8079119f1 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp @@ -54,8 +54,6 @@ namespace eprosima { namespace fastdds { namespace rtps { -using namespace eprosima::fastdds::rtps; - PDPServer::PDPServer( BuiltinProtocols* builtin, const RTPSParticipantAllocationAttributes& allocation, diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp b/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp index 35d32738fdc..12def1ba732 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp @@ -324,7 +324,7 @@ class PDPServer : public fastdds::rtps::PDP private: - using fastdds::rtps::PDP::announceParticipantState; + using PDP::announceParticipantState; #if HAVE_SECURITY /** diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp index 1c2e1b31c70..83a878df986 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp @@ -37,8 +37,6 @@ namespace eprosima { namespace fastdds { namespace rtps { -using namespace eprosima::fastdds::rtps; - PDPServerListener::PDPServerListener( PDPServer* in_PDP) : PDPListener(in_PDP) diff --git a/src/cpp/rtps/common/Token.cpp b/src/cpp/rtps/common/Token.cpp index e6f22cce8c3..d0e761dac5e 100644 --- a/src/cpp/rtps/common/Token.cpp +++ b/src/cpp/rtps/common/Token.cpp @@ -18,7 +18,9 @@ #include -using namespace eprosima::fastdds::rtps; +namespace eprosima { +namespace fastdds { +namespace rtps { std::string* DataHolderHelper::find_property_value( DataHolder& data_holder, @@ -195,3 +197,7 @@ size_t DataHolderHelper::serialized_size( return current_alignment - initial_alignment; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/exceptions/Exception.cpp b/src/cpp/rtps/exceptions/Exception.cpp index 26579c35a43..9df62a5727b 100644 --- a/src/cpp/rtps/exceptions/Exception.cpp +++ b/src/cpp/rtps/exceptions/Exception.cpp @@ -14,8 +14,10 @@ #include "Exception.h" -using namespace eprosima::fastdds::rtps; - +namespace eprosima { +namespace fastdds { +namespace rtps { + Exception::Exception( const char* const& message) : message_(message) @@ -80,3 +82,7 @@ const char* Exception::what() const throw() { return message_.c_str(); } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/network/NetworkFactory.cpp b/src/cpp/rtps/network/NetworkFactory.cpp index 89cb60cc1b7..0ae1fdc03f5 100644 --- a/src/cpp/rtps/network/NetworkFactory.cpp +++ b/src/cpp/rtps/network/NetworkFactory.cpp @@ -27,7 +27,6 @@ #include using namespace std; -using namespace eprosima::fastdds::rtps; namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/network/ReceiverResource.cpp b/src/cpp/rtps/network/ReceiverResource.cpp index da22bda901c..d184dedc23f 100644 --- a/src/cpp/rtps/network/ReceiverResource.cpp +++ b/src/cpp/rtps/network/ReceiverResource.cpp @@ -24,7 +24,6 @@ #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << using namespace std; -using namespace eprosima::fastdds::rtps; namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index ce62253ded2..c6a8fbb1e1a 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -2584,7 +2584,6 @@ bool RTPSParticipantImpl::did_mutation_took_place_on_meta( const LocatorList_t& UnicastLocatorList) const { using namespace std; - using namespace eprosima::fastdds::rtps; if (m_att.builtin.metatrafficMulticastLocatorList == MulticastLocatorList && m_att.builtin.metatrafficUnicastLocatorList == UnicastLocatorList) diff --git a/src/cpp/rtps/reader/BaseReader.cpp b/src/cpp/rtps/reader/BaseReader.cpp index 215cdf7d7dd..4feaee1bbe7 100644 --- a/src/cpp/rtps/reader/BaseReader.cpp +++ b/src/cpp/rtps/reader/BaseReader.cpp @@ -485,7 +485,6 @@ void BaseReader::init( void BaseReader::setup_datasharing( const fastdds::rtps::ReaderAttributes& att) { - using namespace fastdds::rtps; if (att.endpoint.data_sharing_configuration().kind() != fastdds::dds::DataSharingKind::OFF) { diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index 030e3188a7a..25eda711134 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -45,7 +45,10 @@ #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << -using namespace eprosima::fastdds::rtps; +namespace eprosima { +namespace fastdds { +namespace rtps { + using BaseReader = eprosima::fastdds::rtps::BaseReader; static void send_datasharing_ack( @@ -1644,3 +1647,7 @@ bool StatefulReader::send_sync_nts( return mp_RTPSParticipant->sendSync(buffers, total_bytes, m_guid, locators_begin, locators_end, max_blocking_time_point); } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/reader/StatelessReader.cpp b/src/cpp/rtps/reader/StatelessReader.cpp index e4686596f6a..a69a7a4ffa4 100644 --- a/src/cpp/rtps/reader/StatelessReader.cpp +++ b/src/cpp/rtps/reader/StatelessReader.cpp @@ -42,7 +42,10 @@ #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << -using namespace eprosima::fastdds::rtps; +namespace eprosima { +namespace fastdds { +namespace rtps { + using BaseReader = eprosima::fastdds::rtps::BaseReader; StatelessReader::~StatelessReader() @@ -910,3 +913,7 @@ bool StatelessReader::writer_has_manual_liveliness( } return false; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/reader/WriterProxy.cpp b/src/cpp/rtps/reader/WriterProxy.cpp index 39c2eb5ba63..4e48ba87fbc 100644 --- a/src/cpp/rtps/reader/WriterProxy.cpp +++ b/src/cpp/rtps/reader/WriterProxy.cpp @@ -121,7 +121,7 @@ void WriterProxy::start( const SequenceNumber_t& initial_sequence, bool is_datasharing) { - using fastdds::rtps::network::external_locators::filter_remote_locators; + using network::external_locators::filter_remote_locators; #ifdef SHOULD_DEBUG_LINUX assert(get_mutex_owner() == get_thread_id()); @@ -152,7 +152,7 @@ void WriterProxy::start( void WriterProxy::update( const WriterProxyData& attributes) { - using fastdds::rtps::network::external_locators::filter_remote_locators; + using network::external_locators::filter_remote_locators; #ifdef SHOULD_DEBUG_LINUX assert(get_mutex_owner() == get_thread_id()); diff --git a/src/cpp/rtps/security/SecurityManager.cpp b/src/cpp/rtps/security/SecurityManager.cpp index c1fb61a9244..8798f14601b 100644 --- a/src/cpp/rtps/security/SecurityManager.cpp +++ b/src/cpp/rtps/security/SecurityManager.cpp @@ -64,9 +64,11 @@ // TODO(Ricardo) Add event because stateless messages can be not received. -using namespace eprosima::fastdds; -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; inline bool usleep_bool() { @@ -4357,3 +4359,7 @@ void SecurityManager::onWriterChangeReceivedByAll( participant_volatile_message_secure_writer_history_->remove_change(change); } } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/rtps/security/SecurityPluginFactory.cpp b/src/cpp/rtps/security/SecurityPluginFactory.cpp index 8f84d9a8968..c81d66b6a45 100644 --- a/src/cpp/rtps/security/SecurityPluginFactory.cpp +++ b/src/cpp/rtps/security/SecurityPluginFactory.cpp @@ -22,8 +22,11 @@ #include #include -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; Authentication* SecurityPluginFactory::create_authentication_plugin( const PropertyPolicy& property_policy) @@ -117,3 +120,7 @@ Logging* SecurityPluginFactory::create_builtin_logging_plugin() { return new LogTopic(); } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima \ No newline at end of file diff --git a/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp b/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp index 91640346586..fa51945c801 100644 --- a/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp +++ b/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp @@ -16,8 +16,6 @@ #include -using namespace eprosima::fastdds::rtps; - namespace eprosima { namespace fastdds { namespace rtps { diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp b/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp index 7b477ff0b06..922e9e03ee9 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp +++ b/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp @@ -19,8 +19,6 @@ #include #include -using namespace eprosima::fastdds::rtps; - namespace eprosima { namespace fastdds { namespace rtps { @@ -29,10 +27,6 @@ static constexpr uint32_t shm_default_segment_size = 0; static constexpr uint32_t shm_default_port_queue_capacity = 512; static constexpr uint32_t shm_default_healthy_check_timeout_ms = 1000; -} // rtps -} // fastdds -} // eprosima - //********************************************************* // SharedMemTransportDescriptor //********************************************************* @@ -64,3 +58,7 @@ TransportInterface* SharedMemTransportDescriptor::create_transport() const } #endif // ifdef FASTDDS_SHM_TRANSPORT_DISABLED + +} // rtps +} // fastdds +} // eprosima diff --git a/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp b/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp index 35566afd799..925a159d259 100644 --- a/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp +++ b/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp @@ -33,8 +33,6 @@ #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << -//using namespace eprosima::fastdds; - namespace eprosima { namespace fastdds { namespace rtps { diff --git a/src/cpp/rtps/writer/StatefulWriter.cpp b/src/cpp/rtps/writer/StatefulWriter.cpp index 26c1be85212..ac4b058644b 100644 --- a/src/cpp/rtps/writer/StatefulWriter.cpp +++ b/src/cpp/rtps/writer/StatefulWriter.cpp @@ -1023,7 +1023,7 @@ void StatefulWriter::select_all_readers_nts( bool StatefulWriter::matched_reader_add( const ReaderProxyData& rdata) { - using fastdds::rtps::network::external_locators::filter_remote_locators; + using network::external_locators::filter_remote_locators; if (rdata.guid() == c_Guid_Unknown) { diff --git a/src/cpp/rtps/writer/StatelessWriter.cpp b/src/cpp/rtps/writer/StatelessWriter.cpp index ecbaf124537..3986da62401 100644 --- a/src/cpp/rtps/writer/StatelessWriter.cpp +++ b/src/cpp/rtps/writer/StatelessWriter.cpp @@ -465,7 +465,7 @@ bool StatelessWriter::wait_for_acknowledgement( bool StatelessWriter::matched_reader_add( const ReaderProxyData& data) { - using fastdds::rtps::network::external_locators::filter_remote_locators; + using network::external_locators::filter_remote_locators; std::unique_lock guard(mp_mutex); std::unique_lock locator_selector_guard(locator_selector_); diff --git a/src/cpp/security/accesscontrol/Permissions.cpp b/src/cpp/security/accesscontrol/Permissions.cpp index 698b3078f20..ad7888b2da2 100644 --- a/src/cpp/security/accesscontrol/Permissions.cpp +++ b/src/cpp/security/accesscontrol/Permissions.cpp @@ -53,9 +53,11 @@ #define LOCATION " (" __FILE__ ":" S2(__LINE__) ")" #define _SecurityException_(str) SecurityException(std::string(str) + LOCATION) -using namespace eprosima::fastdds; -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; static bool is_domain_in_set( const uint32_t domain_id, @@ -1381,3 +1383,7 @@ bool Permissions::get_datareader_sec_attributes( return false; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/security/authentication/PKIDH.cpp b/src/cpp/security/authentication/PKIDH.cpp index bb9f2c5c15c..e67336a6dd5 100644 --- a/src/cpp/security/authentication/PKIDH.cpp +++ b/src/cpp/security/authentication/PKIDH.cpp @@ -61,9 +61,11 @@ #define LOCATION " (" __FILE__ ":" S2(__LINE__) ")" #define _SecurityException_(str) SecurityException(std::string(str) + LOCATION) -using namespace eprosima::fastdds; -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; using ParameterList = eprosima::fastdds::dds::ParameterList; @@ -2588,3 +2590,7 @@ bool PKIDH::check_guid_comes_from( return adjusted == original; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp b/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp index fc286e31cf1..2f70c07769f 100644 --- a/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp +++ b/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp @@ -102,8 +102,11 @@ static bool create_kx_key( return true; } -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; ParticipantCryptoHandleDeleter::ParticipantCryptoHandleDeleter( AESGCMGMAC_KeyFactory& factory) @@ -995,3 +998,7 @@ void AESGCMGMAC_KeyFactory::release_key_id( m_CryptoTransformKeyIds.erase(it); } } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp index a574031cbc8..f8813b42496 100644 --- a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp +++ b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp @@ -47,8 +47,11 @@ #define set_state setState #endif // FASTCDR_VERSION_MAJOR == 1 -using namespace eprosima::fastdds::rtps; -using namespace eprosima::fastdds::rtps::security; +namespace eprosima { +namespace fastdds { +namespace rtps { + +using namespace security; constexpr int initialization_vector_suffix_length = 8; @@ -2322,3 +2325,7 @@ bool AESGCMGMAC_Transform::lookup_writer( return false; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp index 20cb800b352..5c0c8f9cc2b 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp @@ -56,9 +56,9 @@ namespace fastdds { namespace statistics { namespace dds { -using fastdds::xmlparser::XMLProfileManager; -using fastdds::xmlparser::XMLP_ret; -using fastdds::xmlparser::DEFAULT_STATISTICS_DATAWRITER_PROFILE; +using xmlparser::XMLProfileManager; +using xmlparser::XMLP_ret; +using xmlparser::DEFAULT_STATISTICS_DATAWRITER_PROFILE; constexpr const char* HISTORY_LATENCY_TOPIC_ALIAS = "HISTORY_LATENCY_TOPIC"; constexpr const char* NETWORK_LATENCY_TOPIC_ALIAS = "NETWORK_LATENCY_TOPIC"; diff --git a/src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp b/src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp index ec7e4124ff0..8fb0ff59fcc 100644 --- a/src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp +++ b/src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp @@ -29,9 +29,7 @@ namespace eprosima { namespace fastdds { namespace statistics { namespace rtps { - -using namespace eprosima::fastdds::statistics; - + struct IProxyQueryable { /** diff --git a/src/cpp/utils/IPFinder.cpp b/src/cpp/utils/IPFinder.cpp index fa4d48820fb..10acc633150 100644 --- a/src/cpp/utils/IPFinder.cpp +++ b/src/cpp/utils/IPFinder.cpp @@ -70,8 +70,10 @@ #include #include -using namespace eprosima::fastdds::rtps; - +namespace eprosima { +namespace fastdds { +namespace rtps { + IPFinder::IPFinder() { } @@ -651,3 +653,7 @@ std::string IPFinder::getIPv6Address( freeaddrinfo(result); return ""; } + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima diff --git a/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h index 48af486b437..c2b2b1800a4 100644 --- a/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h +++ b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h @@ -75,9 +75,6 @@ std::basic_ostream& operator <<( return output; } -using fastdds::rtps::RemoteServerList_t; -using fastdds::rtps::ros_super_client_env; - } // namespace rtps } // namespace fastdds } // namespace eprosima diff --git a/test/unittest/dds/participant/ParticipantTests.cpp b/test/unittest/dds/participant/ParticipantTests.cpp index 219ce7f3fa1..1fe54a7a112 100644 --- a/test/unittest/dds/participant/ParticipantTests.cpp +++ b/test/unittest/dds/participant/ParticipantTests.cpp @@ -83,9 +83,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastdds::PublisherAttributes; -using fastdds::SubscriberAttributes; - // Mocked TopicDataType for Topic creation tests class TopicDataTypeMock : public TopicDataType { diff --git a/test/unittest/dds/publisher/PublisherTests.cpp b/test/unittest/dds/publisher/PublisherTests.cpp index d93627ac426..b83e858eb4d 100644 --- a/test/unittest/dds/publisher/PublisherTests.cpp +++ b/test/unittest/dds/publisher/PublisherTests.cpp @@ -31,7 +31,7 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastdds::rtps::PropertyPolicyHelper; +using rtps::PropertyPolicyHelper; class TopicDataTypeMock : public TopicDataType { diff --git a/test/unittest/dds/subscriber/SubscriberTests.cpp b/test/unittest/dds/subscriber/SubscriberTests.cpp index 739d8b05dae..b667f484810 100644 --- a/test/unittest/dds/subscriber/SubscriberTests.cpp +++ b/test/unittest/dds/subscriber/SubscriberTests.cpp @@ -34,7 +34,7 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastdds::rtps::PropertyPolicyHelper; +using rtps::PropertyPolicyHelper; class FooType { diff --git a/test/unittest/xmlparser/XMLElementParserTests.cpp b/test/unittest/xmlparser/XMLElementParserTests.cpp index d2943833f81..e5c09f7523a 100644 --- a/test/unittest/xmlparser/XMLElementParserTests.cpp +++ b/test/unittest/xmlparser/XMLElementParserTests.cpp @@ -43,17 +43,17 @@ using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds; using namespace eprosima::testing; -using eprosima::fastdds::xmlparser::BaseNode; -using eprosima::fastdds::xmlparser::DataNode; -using eprosima::fastdds::xmlparser::NodeType; -using eprosima::fastdds::xmlparser::XMLP_ret; -using eprosima::fastdds::xmlparser::XMLParser; -using eprosima::fastdds::xmlparser::up_participant_t; -using eprosima::fastdds::xmlparser::up_node_participant_t; -using eprosima::fastdds::xmlparser::node_participant_t; -using eprosima::fastdds::xmlparser::sp_transport_t; - -using eprosima::fastdds::xmlparser::XMLProfileManager; +using xmlparser::BaseNode; +using xmlparser::DataNode; +using xmlparser::NodeType; +using xmlparser::XMLP_ret; +using xmlparser::XMLParser; +using xmlparser::up_participant_t; +using xmlparser::up_node_participant_t; +using xmlparser::node_participant_t; +using xmlparser::sp_transport_t; + +using xmlparser::XMLProfileManager; class XMLParserTests : public ::testing::Test {