Skip to content

Commit

Permalink
Refs #21129: Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <[email protected]>
  • Loading branch information
elianalf committed Jun 17, 2024
1 parent af4ecdc commit 8aa916e
Show file tree
Hide file tree
Showing 51 changed files with 218 additions and 143 deletions.
11 changes: 0 additions & 11 deletions include/fastdds/rtps/attributes/ServerAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
namespace eprosima {

using namespace fastdds::rtps;
using eprosima::fastdds::dds::Log;

namespace fastdds {
namespace dds {
Expand Down
9 changes: 7 additions & 2 deletions src/cpp/fastdds/domain/DomainParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/domain/DomainParticipantImpl.hpp>

using namespace eprosima;
using namespace eprosima::fastdds::dds;
namespace eprosima {
namespace fastdds {
namespace dds{

DomainParticipant::DomainParticipant(
const StatusMask& mask)
Expand Down Expand Up @@ -496,3 +497,7 @@ bool DomainParticipant::has_active_entities()
{
return impl_->has_active_entities();
}

} // namespace dds
} // namespace fastdds
} // namespace eprosima
24 changes: 11 additions & 13 deletions src/cpp/fastdds/domain/DomainParticipantFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

using namespace eprosima::fastdds::xmlparser;

using eprosima::fastdds::dds::Log;

using eprosima::fastdds::rtps::RTPSDomain;
using eprosima::fastdds::rtps::RTPSParticipant;

Expand All @@ -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())
{
}
Expand All @@ -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()
Expand Down Expand Up @@ -112,8 +110,8 @@ ReturnCode_t DomainParticipantFactory::delete_participant(
std::lock_guard<std::mutex> guard(mtx_participants_);
#ifdef FASTDDS_STATISTICS
// Delete builtin statistics entities
eprosima::fastdds::statistics::dds::DomainParticipantImpl* stat_part_impl =
static_cast<eprosima::fastdds::statistics::dds::DomainParticipantImpl*>(part->impl_);
statistics::dds::DomainParticipantImpl* stat_part_impl =
static_cast<statistics::dds::DomainParticipantImpl*>(part->impl_);
stat_part_impl->delete_statistics_builtin_entities();
#endif // ifdef FASTDDS_STATISTICS
if (part->has_active_entities())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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");
Expand Down
35 changes: 16 additions & 19 deletions src/cpp/fastdds/domain/DomainParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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_;
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/publisher/DataWriterImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter

private:

using fastdds::rtps::WriterListener::onWriterMatched;
using rtps::WriterListener::onWriterMatched;
}
writer_listener_;

Expand Down
9 changes: 7 additions & 2 deletions src/cpp/fastdds/publisher/Publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@

#include <fastdds/dds/log/Log.hpp>

using namespace eprosima;
using namespace eprosima::fastdds::dds;
namespace eprosima {
namespace fastdds {
namespace dds{

Publisher::Publisher(
PublisherImpl* p,
Expand Down Expand Up @@ -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
13 changes: 9 additions & 4 deletions src/cpp/fastdds/publisher/qos/DataWriterQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@

#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/core/policy/QosPolicyUtils.hpp>
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()
{
Expand Down Expand Up @@ -64,3 +65,7 @@ WriterQos DataWriterQos::get_writerqos(

return qos;
}

} // namespace dds
} // namespace fastdds
} // namespace eprosima
8 changes: 7 additions & 1 deletion src/cpp/fastdds/subscriber/ReadCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#include <fastdds/subscriber/ReadConditionImpl.hpp>

using namespace eprosima::fastdds::dds;
namespace eprosima {
namespace fastdds {
namespace dds{

ReadCondition::ReadCondition()
{
Expand Down Expand Up @@ -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
9 changes: 7 additions & 2 deletions src/cpp/fastdds/subscriber/Subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/subscriber/SubscriberImpl.hpp>

using namespace eprosima;
using namespace eprosima::fastdds::dds;
namespace eprosima {
namespace fastdds {
namespace dds{

Subscriber::Subscriber(
SubscriberImpl* pimpl,
Expand Down Expand Up @@ -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
9 changes: 4 additions & 5 deletions src/cpp/fastdds/subscriber/SubscriberImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions src/cpp/fastdds/topic/qos/TopicQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@

#include <fastdds/dds/topic/qos/TopicQos.hpp>

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
2 changes: 1 addition & 1 deletion src/cpp/fastdds/utils/QosConverters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/fastdds/utils/QosConverters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ namespace fastdds {
namespace dds {
namespace utils {

using fastdds::TopicAttributes;

/**
* Obtains the DataWriterQos from the PublisherAttributes provided.
*
Expand Down
8 changes: 7 additions & 1 deletion src/cpp/rtps/attributes/PropertyPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

#include <algorithm>

using namespace eprosima::fastdds::rtps;
namespace eprosima {
namespace fastdds {
namespace rtps{

PropertyPolicy PropertyPolicyHelper::get_properties_with_prefix(
const PropertyPolicy& property_policy,
Expand Down Expand Up @@ -118,3 +120,7 @@ const Property* PropertyPolicyHelper::get_property(

return returnedValue;
}

} // namespace rtps
} // namespace fastdds
} // namespace eprosima
8 changes: 7 additions & 1 deletion src/cpp/rtps/attributes/ThreadSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include <fastdds/rtps/attributes/ThreadSettings.hpp>

using namespace eprosima::fastdds::rtps;
namespace eprosima {
namespace fastdds {
namespace rtps{

bool ThreadSettings::operator ==(
const ThreadSettings& rhs) const
Expand All @@ -30,3 +32,7 @@ bool ThreadSettings::operator !=(
{
return !(*this == rhs);
}

} // namespace rtps
} // namespace fastdds
} // namespace eprosima
6 changes: 5 additions & 1 deletion src/cpp/rtps/attributes/TopicAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
#include <fastdds/rtps/attributes/TopicAttributes.h>
#include <fastdds/dds/log/Log.hpp>

using namespace eprosima::fastdds;
namespace eprosima {
namespace fastdds {

bool TopicAttributes::checkQos() const
{
Expand Down Expand Up @@ -70,3 +71,6 @@ bool TopicAttributes::checkQos() const
}
return true;
}

} // namespace fastdds
} // namespace eprosima
Loading

0 comments on commit 8aa916e

Please sign in to comment.