diff --git a/README.md b/README.md index 6a412bb4..940ab79d 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ The *Fast DDS* XML schema was duly updated to accommodate the new Discovery Serv - The participant profile ```` tag contains a ```` tag where all discovery-related info is gathered. This new tag contains the following new XML child elements: - - ````: specifies the discovery type through the ``DiscoveryProtocol_t`` enumeration. + - ````: specifies the discovery type through the ``DiscoveryProtocol`` enumeration. - ````: specifies the server or servers to which a Client/Server connects. - ````: specifies the time span between PDP metatraffic exchange. diff --git a/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.cxx b/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.cxx index 85cb4778..a115d8bc 100644 --- a/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.cxx +++ b/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.cxx @@ -25,8 +25,8 @@ #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; diff --git a/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.h b/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.h index 545c68b1..4e3b9277 100644 --- a/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.h +++ b/examples/HelloWorldExampleDS/HelloWorldPubSubTypes.h @@ -56,18 +56,18 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + eprosima::fastdds::rtps::SerializedPayload_t* payload) override { return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::rtps::SerializedPayload_t* payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::rtps::SerializedPayload_t* payload, void* data) override; eProsima_user_DllExport std::function getSerializedSizeProvider( @@ -82,7 +82,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport bool getKey( void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; eProsima_user_DllExport void* createData() override; diff --git a/examples/HelloWorldExampleDS/HelloWorldPublisher.cpp b/examples/HelloWorldExampleDS/HelloWorldPublisher.cpp index 19c46e14..789e6d49 100644 --- a/examples/HelloWorldExampleDS/HelloWorldPublisher.cpp +++ b/examples/HelloWorldExampleDS/HelloWorldPublisher.cpp @@ -33,10 +33,8 @@ #include #include -using namespace eprosima::fastdds; -using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::rtps; HelloWorldPublisher::HelloWorldPublisher() : mp_participant(nullptr) @@ -96,9 +94,9 @@ bool HelloWorldPublisher::init( participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(ratt); } - participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol_t::CLIENT; + participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::CLIENT; participant_qos.wire_protocol().participant_id = 2; - participant_qos.wire_protocol().builtin.discovery_config.leaseDuration = eprosima::fastrtps::c_TimeInfinite; + participant_qos.wire_protocol().builtin.discovery_config.leaseDuration = eprosima::fastdds::c_TimeInfinite; participant_qos.name("Participant_pub"); mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, participant_qos); @@ -115,7 +113,7 @@ bool HelloWorldPublisher::init( TopicQos topic_qos = TOPIC_QOS_DEFAULT; topic_qos.history().depth = 30; - topic_qos.history().kind = KEEP_LAST_HISTORY_QOS; + topic_qos.history().kind = eprosima::fastdds::KEEP_LAST_HISTORY_QOS; topic_qos.resource_limits().max_samples = 50; topic_qos.resource_limits().allocated_samples = 20; @@ -124,7 +122,7 @@ bool HelloWorldPublisher::init( datawriter_qos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2; datawriter_qos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 0; - datawriter_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + datawriter_qos.reliability().kind = eprosima::fastdds::RELIABLE_RELIABILITY_QOS; mp_publisher = mp_participant->create_publisher(publisher_qos); diff --git a/examples/HelloWorldExampleDS/HelloWorldServer.cpp b/examples/HelloWorldExampleDS/HelloWorldServer.cpp index ef795f05..c9be9bdd 100644 --- a/examples/HelloWorldExampleDS/HelloWorldServer.cpp +++ b/examples/HelloWorldExampleDS/HelloWorldServer.cpp @@ -27,9 +27,6 @@ #include #include -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -43,9 +40,9 @@ bool HelloWorldServer::init( Locator server_address) { - eprosima::fastdds::dds::DomainParticipantQos participant_qos = eprosima::fastdds::dds::PARTICIPANT_QOS_DEFAULT; + DomainParticipantQos participant_qos = PARTICIPANT_QOS_DEFAULT; - participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol_t::SERVER; + participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; std::istringstream iss("44.49.53.43.53.45.52.56.45.52.5F.31"); iss >> participant_qos.wire_protocol().prefix; participant_qos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; diff --git a/examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp b/examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp index c4aca217..e0baf16e 100644 --- a/examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp +++ b/examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp @@ -32,8 +32,6 @@ #include #include -using namespace eprosima::fastdds; -using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds::dds; @@ -92,9 +90,9 @@ bool HelloWorldSubscriber::init( participant_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(ratt); } - participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol_t::CLIENT; + participant_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::CLIENT; participant_qos.wire_protocol().participant_id = 3; - participant_qos.wire_protocol().builtin.discovery_config.leaseDuration = eprosima::fastrtps::c_TimeInfinite; + participant_qos.wire_protocol().builtin.discovery_config.leaseDuration = eprosima::fastdds::c_TimeInfinite; participant_qos.name("Participant_sub"); mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, participant_qos); @@ -111,15 +109,15 @@ bool HelloWorldSubscriber::init( TopicQos topic_qos = TOPIC_QOS_DEFAULT; topic_qos.history().depth = 30; - topic_qos.history().kind = KEEP_LAST_HISTORY_QOS; + topic_qos.history().kind = eprosima::fastdds::KEEP_LAST_HISTORY_QOS; topic_qos.resource_limits().max_samples = 50; topic_qos.resource_limits().allocated_samples = 20; SubscriberQos subscriber_qos = SUBSCRIBER_QOS_DEFAULT; DataReaderQos datareader_qos = DATAREADER_QOS_DEFAULT; - datareader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - datareader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + datareader_qos.reliability().kind = eprosima::fastdds::RELIABLE_RELIABILITY_QOS; + datareader_qos.durability().kind = eprosima::fastdds::TRANSIENT_LOCAL_DURABILITY_QOS; mp_subscriber = mp_participant->create_subscriber(subscriber_qos); diff --git a/examples/HelloWorldExampleDS/HelloWorld_main.cpp b/examples/HelloWorldExampleDS/HelloWorld_main.cpp index 7891b16d..91756015 100644 --- a/examples/HelloWorldExampleDS/HelloWorld_main.cpp +++ b/examples/HelloWorldExampleDS/HelloWorld_main.cpp @@ -115,7 +115,7 @@ const option::Descriptor usage[] = { /*static*/ const std::regex Arg::ipv4(R"(^((?:[0-9]{1,3}\.){3}[0-9]{1,3})?:?(?:(\d+))?$)"); /*static*/ const std::regex Arg::ipv6(R"(^\[?((?:[0-9a-fA-F]{0,4}\:){7}[0-9a-fA-F]{0,4})?(?:\]:)?(?:(\d+))?$)"); -using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds::dds; int main(int argc, char** argv) diff --git a/include/DiscoveryItem.h b/include/DiscoveryItem.h index 9d98d71a..07dece91 100644 --- a/include/DiscoveryItem.h +++ b/include/DiscoveryItem.h @@ -34,7 +34,7 @@ class XMLDocument; namespace eprosima { namespace discovery_server { -typedef fastrtps::rtps::GUID_t GUID_t; +typedef fastdds::rtps::GUID_t GUID_t; //! common discovery info struct DiscoveryItem diff --git a/include/DiscoveryServerManager.h b/include/DiscoveryServerManager.h index 8fb6303d..e11dff91 100644 --- a/include/DiscoveryServerManager.h +++ b/include/DiscoveryServerManager.h @@ -32,9 +32,7 @@ #include "DiscoveryItem.h" -using namespace eprosima::fastrtps; using namespace eprosima::fastdds; -using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds::dds; @@ -43,14 +41,14 @@ class XMLElement; } // namespace tinyxml2 namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { class PDP; class BuiltinProtocols; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds namespace discovery_server { @@ -87,7 +85,7 @@ class DelayedParticipantCreation; class DelayedParticipantDestruction; class DiscoveryServerManager - : public eprosima::fastdds::dds::DomainParticipantListener // receive discovery callback information and + : public DomainParticipantListener // receive discovery callback information and // subscriber lifeliness information { diff --git a/include/LateJoiner.h b/include/LateJoiner.h index fbf3fdc2..f9405c82 100644 --- a/include/LateJoiner.h +++ b/include/LateJoiner.h @@ -30,7 +30,7 @@ namespace eprosima { namespace discovery_server { -using eprosima::fastrtps::rtps::GUID_t; +using eprosima::fastdds::rtps::GUID_t; class DelayedParticipantDestruction; diff --git a/resources/static_types/HelloWorldPubSubTypes.cxx b/resources/static_types/HelloWorldPubSubTypes.cxx index 85cb4778..a115d8bc 100644 --- a/resources/static_types/HelloWorldPubSubTypes.cxx +++ b/resources/static_types/HelloWorldPubSubTypes.cxx @@ -25,8 +25,8 @@ #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; diff --git a/resources/static_types/HelloWorldPubSubTypes.h b/resources/static_types/HelloWorldPubSubTypes.h index 545c68b1..4e3b9277 100644 --- a/resources/static_types/HelloWorldPubSubTypes.h +++ b/resources/static_types/HelloWorldPubSubTypes.h @@ -56,18 +56,18 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + eprosima::fastdds::rtps::SerializedPayload_t* payload) override { return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::rtps::SerializedPayload_t* payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::rtps::SerializedPayload_t* payload, void* data) override; eProsima_user_DllExport std::function getSerializedSizeProvider( @@ -82,7 +82,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport bool getKey( void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; eProsima_user_DllExport void* createData() override; diff --git a/src/DiscoveryItem.cpp b/src/DiscoveryItem.cpp index ad39bd24..8cb891f8 100644 --- a/src/DiscoveryItem.cpp +++ b/src/DiscoveryItem.cpp @@ -31,7 +31,7 @@ return a_eResult; } #endif // ifndef XMLCheckResult -using namespace eprosima::fastrtps; +using namespace eprosima::fastdds; using namespace eprosima::discovery_server; // basic discovery items operations @@ -581,7 +581,7 @@ void DiscoveryItemDatabase::UpdateSubLiveliness( // Retrieve the participant that owns this subscriber GUID_t pguid(subs); - pguid.entityId = eprosima::fastrtps::rtps::c_EntityId_RTPSParticipant; + pguid.entityId = eprosima::fastdds::rtps::c_EntityId_RTPSParticipant; if (image.find(pguid) == image.end()) { @@ -962,8 +962,8 @@ void Snapshot::from_xml( tinyxml2::XMLElement* pRoot) { using namespace tinyxml2; - using eprosima::fastrtps::rtps::GuidPrefix_t; - using eprosima::fastrtps::rtps::EntityId_t; + using eprosima::fastdds::rtps::GuidPrefix_t; + using eprosima::fastdds::rtps::EntityId_t; if (pRoot != nullptr) { diff --git a/src/DiscoveryServerManager.cpp b/src/DiscoveryServerManager.cpp index cf559506..176e698e 100644 --- a/src/DiscoveryServerManager.cpp +++ b/src/DiscoveryServerManager.cpp @@ -29,15 +29,12 @@ #include "LateJoiner.h" #include "log/DSLog.h" -using namespace eprosima::fastrtps; using namespace eprosima::fastdds; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastdds::rtps; using namespace eprosima::discovery_server; // non exported from Fast DDS (watch out they may be updated) namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace DSxmlparser { const char* PROFILES = "profiles"; const char* PROFILE_NAME = "profile_name"; @@ -50,7 +47,7 @@ const char* PUBLISHER = "publisher"; const char* SUBSCRIBER = "subscriber"; const char* TOPIC = "topic"; } // namespace DSxmlparser -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima /*static members*/ @@ -923,7 +920,7 @@ void DiscoveryServerManager::loadServer( // We define the PDP as external (when moved to fast library it would be SERVER) DiscoverySettings& b = dpQOS.wire_protocol().builtin.discovery_config; (void)b; - assert(b.discoveryProtocol == SERVER || b.discoveryProtocol == BACKUP); + assert(b.discoveryProtocol == eprosima::fastdds::rtps::DiscoveryProtocol::SERVER || b.discoveryProtocol == eprosima::fastdds::rtps::DiscoveryProtocol::BACKUP); // Create the participant or the associated events DelayedParticipantCreation event(creation_time, std::move(dpQOS), &DiscoveryServerManager::addServer); @@ -1006,8 +1003,8 @@ void DiscoveryServerManager::loadClient( // we must assert that DiscoveryProtocol is CLIENT - if (dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol_t::CLIENT && - dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol_t::SUPER_CLIENT) + if (dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol::CLIENT && + dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol::SUPER_CLIENT) { LOG_ERROR( "DiscoveryServerManager::loadClient try to create a client with an incompatible profile: " << @@ -1279,7 +1276,7 @@ void DiscoveryServerManager::loadSimple( } // we must assert that DiscoveryProtocol is CLIENT - if (dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol_t::SIMPLE) + if (dpQOS.wire_protocol().builtin.discovery_config.discoveryProtocol != DiscoveryProtocol::SIMPLE) { LOG_ERROR( "DiscoveryServerManager::loadSimple try to create a simple participant with an incompatible profile: " << @@ -1402,7 +1399,7 @@ void DiscoveryServerManager::loadSubscriber( TopicAttributes topicAttr; if (topic_name != nullptr) { - if (!eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(std::string( + if (!eprosima::fastdds::rtps::RTPSDomain::get_topic_attributes_from_profile(std::string( topic_name), topicAttr)) { LOG_ERROR("DiscoveryServerManager::loadSubscriber couldn't load topic profile "); @@ -1505,7 +1502,7 @@ void DiscoveryServerManager::loadPublisher( TopicAttributes topicAttr; if (topic_name != nullptr) { - if (!eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(std::string( + if (!eprosima::fastdds::rtps::RTPSDomain::get_topic_attributes_from_profile(std::string( topic_name), topicAttr)) { LOG_ERROR("DiscoveryServerManager::loadPublisher couldn't load topic profile "); diff --git a/src/LateJoiner.cpp b/src/LateJoiner.cpp index e8e61416..b0d9840d 100644 --- a/src/LateJoiner.cpp +++ b/src/LateJoiner.cpp @@ -19,10 +19,9 @@ #include "log/DSLog.h" #include "DiscoveryServerManager.h" -using namespace eprosima::fastrtps; -using namespace eprosima::discovery_server; -// New API +using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; +using namespace eprosima::discovery_server; // delayed creation of a new participant void DelayedParticipantCreation::operator ()( @@ -31,8 +30,8 @@ void DelayedParticipantCreation::operator ()( DomainParticipant* p = DomainParticipantFactory::get_instance()->create_participant(0, qos, &manager); - fastdds::dds::Publisher* publisher_ = p->create_publisher(PUBLISHER_QOS_DEFAULT); - fastdds::dds::Subscriber* subscriber_ = p->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + Publisher* publisher_ = p->create_publisher(PUBLISHER_QOS_DEFAULT); + Subscriber* subscriber_ = p->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ParticipantCreatedEntityInfo info; @@ -101,13 +100,13 @@ const LateJoinerDataTraits::removeEndpoint LateJoinerDataTraits::createEndpoint( - fastdds::dds::DomainEntity* publisher, + DomainEntity* publisher, Topic* topic, const std::string& profile_name, void*) { - fastdds::dds::Publisher* pub = static_cast(publisher); + Publisher* pub = static_cast(publisher); if (profile_name.empty()) { @@ -129,12 +128,12 @@ const LateJoinerDataTraits::removeEndpoint LateJoinerDataTraits::createEndpoint( - fastdds::dds::DomainEntity* subscriber, + DomainEntity* subscriber, Topic* topic, const std::string& profile_name, - fastdds::dds::SubscriberListener* list /* = nullptr*/) + SubscriberListener* list /* = nullptr*/) { - fastdds::dds::Subscriber* sub = static_cast(subscriber); + Subscriber* sub = static_cast(subscriber); if (profile_name.empty()) { diff --git a/src/main.cpp b/src/main.cpp index c0ae5057..589c98a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,9 +24,7 @@ #include "arguments.h" using namespace eprosima; -using namespace fastrtps; using namespace fastdds; -using namespace fastrtps::rtps; using namespace fastdds::rtps; using namespace discovery_server;