From 26814522844c1ea7634a9b2ccb94a204beea8613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Bueno=20L=C3=B3pez?= <69244257+JLBuenoLopez-eProsima@users.noreply.github.com> Date: Sat, 9 Mar 2024 08:24:51 +0100 Subject: [PATCH] Make XML Parser API private (#4318) * Refs #20301: move XML Parser implementation to root source folder Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: sort alphabetically source files Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: make XML Parser private Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: remove private headers from Blackbox tests Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: new LibrarySettings class superseding LibrarySettingsAttributes Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: add library settings DDS & RTPS API. RTPSDomainTests testing the new API Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: library settings DDS API test Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: generate monitor service types in blackbox types and use them in corresponding test Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: XML profile manager get dynamic type builder wrapper and related test Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: refactor XML library settings, use new migrated structure Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: migrate to public API Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: reintroduce private headers in blackbox tests Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: update versions.md and copyright Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: remove exportation macro from private API Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: remove participant without using mocked code Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: apply review suggestion Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: linters Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: avoid using protected interface name Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: avoid using non-exported API in ParticipantTests Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: linters Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: fix Publisher and Subscriber tests Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: add get_topic_attributes_from_profile API Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: get topic attributes from profile test Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: fixes after rebase Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: fix Windows warning Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: linters Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: fix Windows warning Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: fix memory leak Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz * Refs #20301: Run Github Windows CI on 3.0.x-devel PRs Signed-off-by: EduPonz --------- Signed-off-by: JLBuenoLopez-eProsima Signed-off-by: EduPonz Co-authored-by: EduPonz --- .github/workflows/windows-ci.yml | 2 +- .../HelloWorldPublisher.cpp | 17 +- .../TypeLookupService/TypeLookupPublisher.cpp | 15 +- .../C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx | 6 +- include/fastdds/LibrarySettings.hpp | 66 + .../dds/domain/DomainParticipantFactory.hpp | 38 + include/fastdds/rtps/RTPSDomain.h | 33 + src/cpp/CMakeLists.txt | 12 +- .../domain/DomainParticipantFactory.cpp | 40 +- .../fastdds/domain/DomainParticipantImpl.cpp | 14 +- src/cpp/fastdds/publisher/PublisherImpl.cpp | 22 +- src/cpp/fastdds/subscriber/SubscriberImpl.cpp | 18 +- src/cpp/rtps/RTPSDomain.cpp | 74 +- src/cpp/rtps/RTPSDomainImpl.hpp | 31 + .../attributes/RTPSParticipantAttributes.cpp | 5 +- .../builtin/discovery/endpoint/EDPStatic.cpp | 22 +- .../rtps/participant/RTPSParticipantImpl.cpp | 18 +- src/cpp/rtps/transport/TCPAcceptor.cpp | 6 +- src/cpp/rtps/transport/TCPAcceptor.h | 2 +- src/cpp/rtps/transport/TCPAcceptorBasic.cpp | 6 +- src/cpp/rtps/transport/TCPAcceptorBasic.h | 2 +- src/cpp/rtps/transport/TCPAcceptorSecure.cpp | 4 +- src/cpp/rtps/transport/TCPAcceptorSecure.h | 2 +- .../rtps/transport/TCPTransportInterface.h | 2 +- src/cpp/rtps/transport/TCPv4Transport.cpp | 4 +- src/cpp/rtps/transport/TCPv4Transport.h | 2 +- src/cpp/rtps/transport/TCPv6Transport.cpp | 4 +- src/cpp/rtps/transport/TCPv6Transport.h | 2 +- src/cpp/rtps/transport/UDPChannelResource.cpp | 2 +- src/cpp/rtps/transport/UDPChannelResource.h | 12 +- .../rtps/transport/UDPTransportInterface.h | 2 +- src/cpp/rtps/transport/UDPv4Transport.cpp | 14 +- src/cpp/rtps/transport/UDPv4Transport.h | 2 +- src/cpp/rtps/transport/UDPv6Transport.cpp | 12 +- src/cpp/rtps/transport/UDPv6Transport.h | 2 +- .../fastdds/domain/DomainParticipantImpl.cpp | 16 +- src/cpp/statistics/rtps/StatisticsBase.hpp | 1 + .../{rtps => }/xmlparser/XMLDynamicParser.cpp | 23 +- .../{rtps => }/xmlparser/XMLElementParser.cpp | 20 +- .../xmlparser/XMLEndpointParser.cpp | 4 +- .../cpp}/xmlparser/XMLEndpointParser.h | 5 +- src/cpp/{rtps => }/xmlparser/XMLParser.cpp | 13 +- .../cpp}/xmlparser/XMLParser.h | 239 +- .../{rtps => }/xmlparser/XMLParserCommon.cpp | 2 +- .../cpp}/xmlparser/XMLParserCommon.h | 0 .../{rtps => }/xmlparser/XMLParserUtils.hpp | 0 .../xmlparser/XMLProfileManager.cpp | 11 +- .../cpp}/xmlparser/XMLProfileManager.h | 80 +- .../fastrtps => src/cpp}/xmlparser/XMLTree.h | 0 test/blackbox/api/dds-pim/PubSubReader.hpp | 12 +- test/blackbox/api/dds-pim/PubSubWriter.hpp | 4 - test/blackbox/common/BlackboxTests.cpp | 21 +- .../common/BlackboxTestsDeadlineQos.cpp | 18 +- .../common/BlackboxTestsDiscovery.cpp | 21 +- .../common/BlackboxTestsLifespanQoS.cpp | 25 +- .../common/BlackboxTestsLivelinessQos.cpp | 32 +- .../common/BlackboxTestsNetworkConf.cpp | 19 +- .../common/BlackboxTestsPubSubBasic.cpp | 35 +- .../BlackboxTestsPubSubFlowControllers.cpp | 2 - .../common/BlackboxTestsPubSubFragments.cpp | 19 +- .../common/BlackboxTestsPubSubHistory.cpp | 18 +- .../BlackboxTestsRealtimeAllocations.cpp | 20 +- .../common/BlackboxTestsReliability.cpp | 5 +- .../blackbox/common/BlackboxTestsSecurity.cpp | 39 +- .../blackbox/common/BlackboxTestsVolatile.cpp | 28 +- .../common/DDSBlackboxTestsAckPositive.cpp | 1 + .../common/DDSBlackboxTestsContentFilter.cpp | 19 +- .../common/DDSBlackboxTestsDataReader.cpp | 26 +- .../DDSBlackboxTestsDataRepresentationQos.cpp | 10 +- .../common/DDSBlackboxTestsDataSharing.cpp | 17 +- .../common/DDSBlackboxTestsDataWriter.cpp | 26 +- .../common/DDSBlackboxTestsDiscovery.cpp | 33 +- .../common/DDSBlackboxTestsListeners.cpp | 16 +- .../common/DDSBlackboxTestsMonitorService.cpp | 13 +- .../common/DDSBlackboxTestsOwnershipQos.cpp | 17 +- .../common/DDSBlackboxTestsPersistence.cpp | 17 +- .../DDSBlackboxTestsPersistenceGuid.cpp | 25 +- .../common/DDSBlackboxTestsPropertyQos.cpp | 22 +- ...ackboxTestsStatisticsDomainParticipant.cpp | 30 +- .../DDSBlackboxTestsTransportSHMUDP.cpp | 23 +- .../common/DDSBlackboxTestsUserDataQos.cpp | 22 +- test/blackbox/common/RTPSBlackboxTests.cpp | 8 +- .../common/RTPSBlackboxTestsBasic.cpp | 15 +- .../common/RTPSBlackboxTestsDiscovery.cpp | 16 +- .../common/RTPSBlackboxTestsPersistence.cpp | 22 +- .../RTPSBlackboxTestsPersistenceGuid.cpp | 28 +- .../common/RTPSBlackboxTestsPools.cpp | 26 +- .../common/RTPSBlackboxTestsVolatile.cpp | 19 +- .../types/statistics/monitorservice_types.cxx | 2056 +++++++++++ .../types/statistics/monitorservice_types.h | 1370 ++++++++ .../statistics/monitorservice_typesCdrAux.hpp | 143 + .../statistics/monitorservice_typesCdrAux.ipp | 959 ++++++ .../monitorservice_typesPubSubTypes.cxx | 1390 ++++++++ .../monitorservice_typesPubSubTypes.h | 695 ++++ .../statistics/monitorservice_typesv1.cxx | 3011 +++++++++++++++++ .../types/statistics/monitorservice_typesv1.h | 1762 ++++++++++ test/dds/communication/PublisherDynamic.cpp | 23 +- test/dds/communication/SubscriberDynamic.cpp | 8 - .../fastdds/domain/DomainParticipantImpl.hpp | 8 +- .../network/ExternalLocatorsProcessor.hpp | 6 + .../RTPSDomainImpl/rtps/RTPSDomainImpl.hpp | 13 + .../rtps/participant/RTPSParticipant.h | 2 + .../rtps/participant/RTPSParticipantImpl.h | 88 + .../rtps/attributes/ServerAttributes.h | 91 + .../xmlparser/XMLEndpointParser.h | 2 +- .../xmlparser/XMLProfileManager.h | 2 +- .../latency/LatencyTestPublisher.cpp | 5 +- .../latency/LatencyTestSubscriber.cpp | 1 - test/performance/latency/main_LatencyTest.cpp | 5 +- .../throughput/ThroughputPublisher.cpp | 1 - .../throughput/ThroughputSubscriber.cpp | 1 - .../throughput/main_ThroughputTest.cpp | 4 +- test/performance/video/VideoTestPublisher.cpp | 27 - .../performance/video/VideoTestSubscriber.cpp | 3 +- test/performance/video/main_VideoTest.cpp | 4 +- .../allocations/AllocTestPublisher.cpp | 2 +- .../allocations/AllocTestSubscriber.cpp | 2 +- test/profiling/main_MemoryTest.cpp | 3 +- test/realtime/UserThreadNonBlockedTest.cpp | 8 +- test/unittest/CMakeLists.txt | 37 +- .../dds/participant/ParticipantTests.cpp | 162 +- test/unittest/dds/publisher/CMakeLists.txt | 12 +- .../unittest/dds/publisher/PublisherTests.cpp | 57 +- test/unittest/dds/status/CMakeLists.txt | 10 +- .../dds/subscriber/DataReaderTests.cpp | 15 +- .../dds/subscriber/SubscriberTests.cpp | 60 +- test/unittest/dds/topic/TopicTests.cpp | 7 - test/unittest/dynamic_types/CMakeLists.txt | 10 +- .../dynamic_types/DynamicTypesTests.cpp | 27 +- test/unittest/rtps/domain/CMakeLists.txt | 67 + test/unittest/rtps/domain/RTPSDomainTests.cpp | 107 + test/unittest/statistics/dds/CMakeLists.txt | 45 +- .../statistics/dds/StatisticsQosTests.cpp | 2 - .../statistics/rtps/RTPSStatisticsTests.cpp | 8 +- test/unittest/transport/UDPv4Tests.cpp | 8 +- test/unittest/transport/UDPv6Tests.cpp | 8 +- test/unittest/xmlparser/CMakeLists.txt | 27 +- .../xmlparser/XMLElementParserTests.cpp | 20 +- .../xmlparser/XMLEndpointParserTests.cpp | 3 +- test/unittest/xmlparser/XMLParserTests.cpp | 7 +- test/unittest/xmlparser/XMLParserTests.hpp | 6 +- .../xmlparser/XMLProfileParserTests.cpp | 13 +- test/unittest/xmlparser/XMLTreeTests.cpp | 18 +- .../xmlparser/wrapper/XMLParserTest.hpp | 6 +- tools/fds/server.cpp | 5 +- .../scripts/update_generated_code_from_idl.sh | 2 +- versions.md | 1 + 147 files changed, 13038 insertions(+), 1105 deletions(-) create mode 100644 include/fastdds/LibrarySettings.hpp rename src/cpp/{rtps => }/xmlparser/XMLDynamicParser.cpp (99%) rename src/cpp/{rtps => }/xmlparser/XMLElementParser.cpp (99%) rename src/cpp/{rtps => }/xmlparser/XMLEndpointParser.cpp (99%) rename {include/fastrtps => src/cpp}/xmlparser/XMLEndpointParser.h (98%) rename src/cpp/{rtps => }/xmlparser/XMLParser.cpp (99%) rename {include/fastrtps => src/cpp}/xmlparser/XMLParser.h (73%) rename src/cpp/{rtps => }/xmlparser/XMLParserCommon.cpp (99%) rename {include/fastrtps => src/cpp}/xmlparser/XMLParserCommon.h (100%) rename src/cpp/{rtps => }/xmlparser/XMLParserUtils.hpp (100%) rename src/cpp/{rtps => }/xmlparser/XMLProfileManager.cpp (98%) rename {include/fastrtps => src/cpp}/xmlparser/XMLProfileManager.h (83%) rename {include/fastrtps => src/cpp}/xmlparser/XMLTree.h (100%) create mode 100644 test/blackbox/types/statistics/monitorservice_types.cxx create mode 100644 test/blackbox/types/statistics/monitorservice_types.h create mode 100644 test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp create mode 100644 test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp create mode 100644 test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx create mode 100644 test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h create mode 100644 test/blackbox/types/statistics/monitorservice_typesv1.cxx create mode 100644 test/blackbox/types/statistics/monitorservice_typesv1.h create mode 100644 test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h rename test/mock/rtps/XMLEndPointParser/{fastrtps => }/xmlparser/XMLEndpointParser.h (96%) rename test/mock/rtps/XMLProfileManager/{fastrtps => }/xmlparser/XMLProfileManager.h (96%) create mode 100644 test/unittest/rtps/domain/CMakeLists.txt create mode 100644 test/unittest/rtps/domain/RTPSDomainTests.cpp diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 7302e0f6931..73ba9cf75a6 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -26,7 +26,7 @@ on: pull_request: branches: - - 'master' + - '3.0.x-devel' paths-ignore: - '**.md' - '**.txt' diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp index d76b8a82707..4e172f77ae5 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp @@ -27,7 +27,6 @@ #include #include #include -#include using namespace eprosima::fastdds::dds; @@ -39,8 +38,8 @@ HelloWorldPublisher::HelloWorldPublisher() bool HelloWorldPublisher::init() { - if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK != - eprosima::fastrtps::xmlparser::XMLProfileManager::loadXMLFile("helloworld_example_type_profile.xml")) + if (ReturnCode_t::RETCODE_OK != + DomainParticipantFactory::get_instance()->load_XML_profiles_file("helloworld_example_type_profile.xml")) { std::cout << "Cannot open XML file \"helloworld_example_type_profile.xml\". Please, run the publisher from the folder " @@ -48,8 +47,16 @@ bool HelloWorldPublisher::init() return false; } - eprosima::fastrtps::types::DynamicType_ptr dyn_type = - eprosima::fastrtps::xmlparser::XMLProfileManager::getDynamicTypeByName("HelloWorld")->build(); + eprosima::fastrtps::types::DynamicTypeBuilder* type; + if (ReturnCode_t::RETCODE_OK != + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", type)) + { + std::cout << + "Error getting dynamic type \"HelloWorld\"." << std::endl; + return false; + } + + eprosima::fastrtps::types::DynamicType_ptr dyn_type = type->build(); TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); m_Hello = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(dyn_type); diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp index c7d565d96f5..fff5a448ed3 100644 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp +++ b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp @@ -27,7 +27,6 @@ #include #include #include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps; @@ -41,15 +40,23 @@ TypeLookupPublisher::TypeLookupPublisher() bool TypeLookupPublisher::init() { - if (xmlparser::XMLP_ret::XML_OK != - xmlparser::XMLProfileManager::loadXMLFile("example_type_profile.xml")) + if (ReturnCode_t::RETCODE_OK != + DomainParticipantFactory::get_instance()->load_XML_profiles_file("example_type_profile.xml")) { std::cout << "Cannot open XML file \"example_type_profile.xml\". Please, run the publisher from the folder " << "that contatins this XML file." << std::endl; return false; } - types::DynamicType_ptr dyn_type = xmlparser::XMLProfileManager::getDynamicTypeByName("TypeLookup")->build(); + eprosima::fastrtps::types::DynamicTypeBuilder* type; + if (ReturnCode_t::RETCODE_OK != + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("TypeLookup", type)) + { + std::cout << + "Error getting dynamic type \"TypeLookup\"." << std::endl; + return false; + } + types::DynamicType_ptr dyn_type = type->build(); TypeSupport m_type(new types::DynamicPubSubType(dyn_type)); m_Hello = types::DynamicDataFactory::get_instance()->create_data(dyn_type); diff --git a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx index 55544768807..17eccca18e6 100644 --- a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx +++ b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx @@ -1,7 +1,7 @@ -#include - #include "fuzz_utils.h" +#include + using namespace eprosima; using namespace eprosima::fastrtps; @@ -31,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput( // TODO change this to a func. taking buf + len (or C string) // to avoid using `buf_to_file` - xmlparser::XMLProfileManager::loadXMLFile(filename); + fastdds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(filename); if (delete_file(filename) != 0) { diff --git a/include/fastdds/LibrarySettings.hpp b/include/fastdds/LibrarySettings.hpp new file mode 100644 index 00000000000..a84dd5eb96d --- /dev/null +++ b/include/fastdds/LibrarySettings.hpp @@ -0,0 +1,66 @@ +// Copyright 2024 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 LibrarySettings.hpp + * + */ + +#ifndef _FASTDDS_LIBRARY_SETTINGS_HPP_ +#define _FASTDDS_LIBRARY_SETTINGS_HPP_ + +namespace eprosima { +namespace fastdds { + +enum IntraprocessDeliveryType +{ + INTRAPROCESS_OFF, + INTRAPROCESS_USER_DATA_ONLY, + INTRAPROCESS_FULL +}; + +/** + * Class LibraySettings, used by the user to define the Fast DDS library behaviour + * @ingroup FASTDDS_MODULE + */ +class LibrarySettings +{ +public: + + LibrarySettings() + { + } + + virtual ~LibrarySettings() + { + } + + bool operator ==( + const LibrarySettings& b) const + { + return (intraprocess_delivery == b.intraprocess_delivery); + } + + IntraprocessDeliveryType intraprocess_delivery = +#if HAVE_STRICT_REALTIME + INTRAPROCESS_OFF; +#else + INTRAPROCESS_FULL; +#endif // if HAVE_STRICT_REALTIME +}; + +} // namespace fastdds +} // namespace eprosima + +#endif /* _FASTDDS_LIBRARY_SETTINGS_HPP_ */ diff --git a/include/fastdds/dds/domain/DomainParticipantFactory.hpp b/include/fastdds/dds/domain/DomainParticipantFactory.hpp index df14c4a40c2..3346cbf01b6 100644 --- a/include/fastdds/dds/domain/DomainParticipantFactory.hpp +++ b/include/fastdds/dds/domain/DomainParticipantFactory.hpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include using eprosima::fastrtps::types::ReturnCode_t; @@ -267,6 +269,42 @@ class DomainParticipantFactory RTPS_DllAPI ReturnCode_t set_qos( const DomainParticipantFactoryQos& qos); + /** + * @brief This operation returns the value of the DomainParticipant library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return RETCODE_OK + */ + RTPS_DllAPI ReturnCode_t get_library_settings( + LibrarySettings& library_settings) const; + + /** + * @brief This operation sets the library settings. + * + * Library settings must be set before enabling the DomainParticipants. + * Otherwise, failure of the setting operation is expected. + * + * @param library_settings LibrarySettings to be set. + * @return RETCODE_PRECONDITION_NOT_MET if any DomainParticipant is already enabled. + * RETCODE_OK otherwise. + */ + RTPS_DllAPI ReturnCode_t set_library_settings( + const LibrarySettings& library_settings); + + /** + * @brief Get the DynamicTypeBuilder defined in XML file. + * The XML file shall be previously loaded. + * + * @param type_name Dynamic type name. + * @param type Reference where the Dynamic type builder is returned. + * @return RETCODE_BAD_PARAMETER if type_name is empty. + * RETCODE_NO_DATA if type_name is unknown. + * RETCODE_OK otherwise. + */ + RTPS_DllAPI ReturnCode_t get_dynamic_type_builder_from_xml_by_name( + const std::string& type_name, + fastrtps::types::DynamicTypeBuilder*& type); + protected: friend class DomainParticipant; diff --git a/include/fastdds/rtps/RTPSDomain.h b/include/fastdds/rtps/RTPSDomain.h index 401a1d1a6b3..f234ec103b5 100644 --- a/include/fastdds/rtps/RTPSDomain.h +++ b/include/fastdds/rtps/RTPSDomain.h @@ -23,11 +23,13 @@ #include #include +#include #include #include #include #include #include +#include namespace eprosima { namespace fastrtps { @@ -291,6 +293,37 @@ class RTPSDomain RTPS_DllAPI static bool removeRTPSParticipant( RTPSParticipant* p); + /** + * @brief Get the library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return True. + */ + RTPS_DllAPI static bool get_library_settings( + fastdds::LibrarySettings& library_settings); + + /** + * @brief Set the library settings- + * + * @param library_settings LibrarySettings to be set. + * @return False if there is any RTPSParticipant already created. + * True if correctly set. + */ + RTPS_DllAPI static bool set_library_settings( + const fastdds::LibrarySettings& library_settings); + + /** + * @brief Get the TopicAttributes from XML profile. + * + * @param profile_name Topic profile name. + * @param topic_att TopicAttributes object where the attributes are returned. + * @return bool true if the profile exists. + * false otherwise. + */ + RTPS_DllAPI static bool get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_att); + private: RTPSDomain() = delete; diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 64f31768a00..b29cb779894 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -210,12 +210,6 @@ set(${PROJECT_NAME}_source_files rtps/writer/StatefulWriter.cpp rtps/writer/StatelessPersistentWriter.cpp rtps/writer/StatelessWriter.cpp - rtps/xmlparser/XMLDynamicParser.cpp - rtps/xmlparser/XMLElementParser.cpp - rtps/xmlparser/XMLEndpointParser.cpp - rtps/xmlparser/XMLParser.cpp - rtps/xmlparser/XMLParserCommon.cpp - rtps/xmlparser/XMLProfileManager.cpp statistics/fastdds/domain/DomainParticipant.cpp statistics/fastdds/publisher/qos/DataWriterQos.cpp statistics/fastdds/subscriber/qos/DataReaderQos.cpp @@ -227,6 +221,12 @@ set(${PROJECT_NAME}_source_files utils/SystemInfo.cpp utils/TimedConditionVariable.cpp utils/UnitsParser.cpp + xmlparser/XMLDynamicParser.cpp + xmlparser/XMLElementParser.cpp + xmlparser/XMLEndpointParser.cpp + xmlparser/XMLParser.cpp + xmlparser/XMLParserCommon.cpp + xmlparser/XMLProfileManager.cpp ) # Statistics support diff --git a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp index bb9457b8bd4..c5a31e2aac5 100644 --- a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp @@ -17,10 +17,11 @@ * */ +#include + #include #include -#include #include #include #include @@ -31,14 +32,14 @@ #include #include #include -#include -#include #include #include #include #include #include +#include +#include using namespace eprosima::fastrtps::xmlparser; @@ -481,6 +482,39 @@ void DomainParticipantFactory::participant_has_been_deleted( } } +ReturnCode_t DomainParticipantFactory::get_library_settings( + LibrarySettings& library_settings) const +{ + rtps_domain_->get_library_settings(library_settings); + return ReturnCode_t::RETCODE_OK; +} + +ReturnCode_t DomainParticipantFactory::set_library_settings( + const LibrarySettings& library_settings) +{ + if (rtps_domain_->set_library_settings(library_settings)) + { + return ReturnCode_t::RETCODE_OK; + } + return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; +} + +ReturnCode_t DomainParticipantFactory::get_dynamic_type_builder_from_xml_by_name( + const std::string& type_name, + fastrtps::types::DynamicTypeBuilder*& type) +{ + if (type_name.empty()) + { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } + type = XMLProfileManager::getDynamicTypeByName(type_name); + if (nullptr == type) + { + return ReturnCode_t::RETCODE_NO_DATA; + } + return ReturnCode_t::RETCODE_OK; +} + } /* namespace dds */ } /* namespace fastdds */ } /* namespace eprosima */ diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 99dfd432229..6a500351e0f 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -17,16 +17,15 @@ * */ -#include "fastdds/rtps/common/Guid.h" -#include "fastdds/rtps/common/GuidPrefix_t.hpp" +#include + #include -#include #include #include -#include - +#include "fastdds/rtps/common/Guid.h" +#include "fastdds/rtps/common/GuidPrefix_t.hpp" #include #include #include @@ -39,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -55,9 +53,10 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -66,6 +65,7 @@ #include #include #include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/publisher/PublisherImpl.cpp b/src/cpp/fastdds/publisher/PublisherImpl.cpp index d8c28640737..48b1c669f64 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.cpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.cpp @@ -18,31 +18,27 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include #include -#include #include - #include -#include - #include -#include - -#include - +#include +#include +#include +#include #ifdef FASTDDS_STATISTICS #include #endif //FASTDDS_STATISTICS +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp index 13ed8cbc8fe..5a91ed5f8ee 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp @@ -18,30 +18,26 @@ */ #include -#include -#include -#include #include #include - +#include +#include #include #include -#include #include -#include - #include #include -#include - #include -#include - +#include +#include +#include +#include #ifdef FASTDDS_STATISTICS #include #endif //FASTDDS_STATISTICS +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/RTPSDomain.cpp b/src/cpp/rtps/RTPSDomain.cpp index 0cda3bb9486..ee6e47056ae 100644 --- a/src/cpp/rtps/RTPSDomain.cpp +++ b/src/cpp/rtps/RTPSDomain.cpp @@ -27,28 +27,27 @@ #include #include +#include #include #include #include #include - -#include -#include -#include -#include -#include - #include #include #include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include +#include namespace eprosima { namespace fastrtps { @@ -836,13 +835,13 @@ bool RTPSDomainImpl::should_intraprocess_between( switch (xmlparser::XMLProfileManager::library_settings().intraprocess_delivery) { - case IntraprocessDeliveryType::INTRAPROCESS_FULL: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL: return true; - case IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY: return !matched_guid.is_builtin(); - case IntraprocessDeliveryType::INTRAPROCESS_OFF: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF: default: break; } @@ -876,6 +875,55 @@ void RTPSDomainImpl::set_filewatch_thread_config( instance->callback_thread_config_ = callback_thread; } +bool RTPSDomain::get_library_settings( + fastdds::LibrarySettings& library_settings) +{ + return RTPSDomainImpl::get_library_settings(library_settings); +} + +bool RTPSDomainImpl::get_library_settings( + fastdds::LibrarySettings& library_settings) +{ + library_settings = xmlparser::XMLProfileManager::library_settings(); + return true; +} + +bool RTPSDomain::set_library_settings( + const fastdds::LibrarySettings& library_settings) +{ + return RTPSDomainImpl::set_library_settings(library_settings); +} + +bool RTPSDomainImpl::set_library_settings( + const fastdds::LibrarySettings& library_settings) +{ + if (!get_instance()->m_RTPSParticipants.empty()) + { + return false; + } + xmlparser::XMLProfileManager::library_settings(library_settings); + return true; +} + +bool RTPSDomain::get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes) +{ + return RTPSDomainImpl::get_topic_attributes_from_profile(profile_name, topic_attributes); +} + +bool RTPSDomainImpl::get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes) +{ + if (xmlparser::XMLP_ret::XML_OK == + xmlparser::XMLProfileManager::fillTopicAttributes(profile_name, topic_attributes)) + { + return true; + } + return false; +} + } // namespace rtps } // namespace fastrtps } // namespace eprosima diff --git a/src/cpp/rtps/RTPSDomainImpl.hpp b/src/cpp/rtps/RTPSDomainImpl.hpp index 08bf31beb4b..99e2ef7dbe1 100644 --- a/src/cpp/rtps/RTPSDomainImpl.hpp +++ b/src/cpp/rtps/RTPSDomainImpl.hpp @@ -214,6 +214,37 @@ class RTPSDomainImpl const fastdds::rtps::ThreadSettings& watch_thread, const fastdds::rtps::ThreadSettings& callback_thread); + /** + * @brief Get the library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return True. + */ + static bool get_library_settings( + fastdds::LibrarySettings& library_settings); + + /** + * @brief Set the library settings. + * + * @param library_settings LibrarySettings to be set. + * @return False if there is any RTPSParticipant already created. + * True if correctly set. + */ + static bool set_library_settings( + const fastdds::LibrarySettings& library_settings); + + /** + * @brief Get the TopicAttributes from XML profile. + * + * @param profile_name Topic profile name. + * @param topic_att TopicAttributes object where the attributes are returned. + * @return bool true if the profile exists. + * false otherwise. + */ + static bool get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes); + private: /** diff --git a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp index 88a7f1dc389..e0713b61e61 100644 --- a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp +++ b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -26,9 +27,9 @@ #include #include #include -#include #include +#include namespace eprosima { namespace fastrtps { @@ -38,7 +39,7 @@ static bool is_intraprocess_only( const RTPSParticipantAttributes& att) { return - xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == INTRAPROCESS_FULL && + xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == fastdds::INTRAPROCESS_FULL && att.builtin.discovery_config.ignoreParticipantFlags == (ParticipantFilteringFlags::FILTER_DIFFERENT_HOST | ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS); } diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp index 4a034dcf000..05959acc497 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp @@ -17,24 +17,22 @@ * */ -#include -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include - #include - -#include -#include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index 36a777fb0a0..284b8a6024b 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -17,6 +17,8 @@ * */ +#include + #include #include #include @@ -24,6 +26,7 @@ #include #include +#include #include #include #include @@ -33,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -50,23 +54,19 @@ #include #include #include -#include - -#include - #include #include -#include +#include -#include #include +#include #include #include -#include #include #include -#include #include +#include +#include #ifdef FASTDDS_STATISTICS #include @@ -206,7 +206,7 @@ static bool should_be_intraprocess_only( const RTPSParticipantAttributes& att) { return - xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == INTRAPROCESS_FULL && + xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == fastdds::INTRAPROCESS_FULL && att.builtin.discovery_config.ignoreParticipantFlags == (ParticipantFilteringFlags::FILTER_DIFFERENT_HOST | ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS); } diff --git a/src/cpp/rtps/transport/TCPAcceptor.cpp b/src/cpp/rtps/transport/TCPAcceptor.cpp index 435eadd6900..af165de1ec7 100644 --- a/src/cpp/rtps/transport/TCPAcceptor.cpp +++ b/src/cpp/rtps/transport/TCPAcceptor.cpp @@ -37,15 +37,15 @@ TCPAcceptor::TCPAcceptor( TCPAcceptor::TCPAcceptor( asio::io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator& locator) - : acceptor_(io_service, asio::ip::tcp::endpoint(asio::ip::address::from_string(interface), + : acceptor_(io_service, asio::ip::tcp::endpoint(asio::ip::address::from_string(tcp_interface), IPLocator::getPhysicalPort(locator))) , locator_(locator) , io_service_(&io_service) { locator_.port = acceptor_.local_endpoint().port(); - endpoint_ = asio::ip::tcp::endpoint(asio::ip::address::from_string(interface), + endpoint_ = asio::ip::tcp::endpoint(asio::ip::address::from_string(tcp_interface), IPLocator::getPhysicalPort(locator_)); } diff --git a/src/cpp/rtps/transport/TCPAcceptor.h b/src/cpp/rtps/transport/TCPAcceptor.h index 8e6ae2e38b4..23dceff635e 100644 --- a/src/cpp/rtps/transport/TCPAcceptor.h +++ b/src/cpp/rtps/transport/TCPAcceptor.h @@ -46,7 +46,7 @@ class TCPAcceptor TCPAcceptor( asio::io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator& locator); const Locator& locator() const diff --git a/src/cpp/rtps/transport/TCPAcceptorBasic.cpp b/src/cpp/rtps/transport/TCPAcceptorBasic.cpp index bddf035389f..ae778f7e22e 100644 --- a/src/cpp/rtps/transport/TCPAcceptorBasic.cpp +++ b/src/cpp/rtps/transport/TCPAcceptorBasic.cpp @@ -35,12 +35,12 @@ TCPAcceptorBasic::TCPAcceptorBasic( TCPAcceptorBasic::TCPAcceptorBasic( asio::io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator& locator) - : TCPAcceptor(io_service, interface, locator) + : TCPAcceptor(io_service, tcp_interface, locator) , socket_(*io_service_) { - endpoint_ = asio::ip::tcp::endpoint(asio::ip::address::from_string(interface), + endpoint_ = asio::ip::tcp::endpoint(asio::ip::address::from_string(tcp_interface), IPLocator::getPhysicalPort(locator_)); } diff --git a/src/cpp/rtps/transport/TCPAcceptorBasic.h b/src/cpp/rtps/transport/TCPAcceptorBasic.h index c997fdd8b22..63d61d42811 100644 --- a/src/cpp/rtps/transport/TCPAcceptorBasic.h +++ b/src/cpp/rtps/transport/TCPAcceptorBasic.h @@ -48,7 +48,7 @@ class TCPAcceptorBasic : public TCPAcceptor */ TCPAcceptorBasic( asio::io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator& locator); /** diff --git a/src/cpp/rtps/transport/TCPAcceptorSecure.cpp b/src/cpp/rtps/transport/TCPAcceptorSecure.cpp index 3563eb12373..1015c2cfe39 100644 --- a/src/cpp/rtps/transport/TCPAcceptorSecure.cpp +++ b/src/cpp/rtps/transport/TCPAcceptorSecure.cpp @@ -36,9 +36,9 @@ TCPAcceptorSecure::TCPAcceptorSecure( TCPAcceptorSecure::TCPAcceptorSecure( io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator_t& locator) - : TCPAcceptor(io_service, interface, locator) + : TCPAcceptor(io_service, tcp_interface, locator) { } diff --git a/src/cpp/rtps/transport/TCPAcceptorSecure.h b/src/cpp/rtps/transport/TCPAcceptorSecure.h index dc8d28d465a..71709d7dd6e 100644 --- a/src/cpp/rtps/transport/TCPAcceptorSecure.h +++ b/src/cpp/rtps/transport/TCPAcceptorSecure.h @@ -51,7 +51,7 @@ class TCPAcceptorSecure : public TCPAcceptor */ TCPAcceptorSecure( asio::io_service& io_service, - const std::string& interface, + const std::string& tcp_interface, const Locator& locator); /** diff --git a/src/cpp/rtps/transport/TCPTransportInterface.h b/src/cpp/rtps/transport/TCPTransportInterface.h index b73b4b1abee..1f1a5dc29a4 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.h +++ b/src/cpp/rtps/transport/TCPTransportInterface.h @@ -289,7 +289,7 @@ class TCPTransportInterface : public TransportInterface const Locator& loc) const = 0; virtual bool is_interface_allowed( - const std::string& interface) const = 0; + const std::string& network_interface) const = 0; //! Checks for TCP kinds. bool IsLocatorSupported( diff --git a/src/cpp/rtps/transport/TCPv4Transport.cpp b/src/cpp/rtps/transport/TCPv4Transport.cpp index 67c7e62c014..3ceaee812c5 100644 --- a/src/cpp/rtps/transport/TCPv4Transport.cpp +++ b/src/cpp/rtps/transport/TCPv4Transport.cpp @@ -230,9 +230,9 @@ bool TCPv4Transport::is_interface_whitelist_empty() const } bool TCPv4Transport::is_interface_allowed( - const std::string& interface) const + const std::string& tcp_interface) const { - return is_interface_allowed(asio::ip::address_v4::from_string(interface)); + return is_interface_allowed(asio::ip::address_v4::from_string(tcp_interface)); } bool TCPv4Transport::is_interface_allowed( diff --git a/src/cpp/rtps/transport/TCPv4Transport.h b/src/cpp/rtps/transport/TCPv4Transport.h index a305ab8b722..384769f72b5 100644 --- a/src/cpp/rtps/transport/TCPv4Transport.h +++ b/src/cpp/rtps/transport/TCPv4Transport.h @@ -97,7 +97,7 @@ class TCPv4Transport : public TCPTransportInterface //! Checks if the given ip has been included in the white list to use it. virtual bool is_interface_allowed( - const std::string& interface) const override; + const std::string& tcp_interface) const override; //! Checks if the given interface is allowed by the white list. bool is_interface_allowed( diff --git a/src/cpp/rtps/transport/TCPv6Transport.cpp b/src/cpp/rtps/transport/TCPv6Transport.cpp index 3530d3916e8..5736035e706 100644 --- a/src/cpp/rtps/transport/TCPv6Transport.cpp +++ b/src/cpp/rtps/transport/TCPv6Transport.cpp @@ -233,9 +233,9 @@ bool TCPv6Transport::is_interface_whitelist_empty() const } bool TCPv6Transport::is_interface_allowed( - const std::string& interface) const + const std::string& tcp_interface) const { - return is_interface_allowed(asio::ip::address_v6::from_string(interface)); + return is_interface_allowed(asio::ip::address_v6::from_string(tcp_interface)); } bool TCPv6Transport::is_interface_allowed( diff --git a/src/cpp/rtps/transport/TCPv6Transport.h b/src/cpp/rtps/transport/TCPv6Transport.h index e7e1b2e7820..f2e53e13a79 100644 --- a/src/cpp/rtps/transport/TCPv6Transport.h +++ b/src/cpp/rtps/transport/TCPv6Transport.h @@ -102,7 +102,7 @@ class TCPv6Transport : public TCPTransportInterface //! Checks if the given interface is allowed by the white list. virtual bool is_interface_allowed( - const std::string& interface) const override; + const std::string& tcp_interface) const override; //! Checks if the given interface is allowed by the white list. bool is_interface_allowed( diff --git a/src/cpp/rtps/transport/UDPChannelResource.cpp b/src/cpp/rtps/transport/UDPChannelResource.cpp index a3ea13b5ae1..541d6df0bac 100644 --- a/src/cpp/rtps/transport/UDPChannelResource.cpp +++ b/src/cpp/rtps/transport/UDPChannelResource.cpp @@ -41,7 +41,7 @@ UDPChannelResource::UDPChannelResource( , message_receiver_(receiver) , socket_(moveSocket(socket)) , only_multicast_purpose_(false) - , interface_(sInterface) + , udp_interface_(sInterface) , transport_(transport) { auto fn = [this, locator]() diff --git a/src/cpp/rtps/transport/UDPChannelResource.h b/src/cpp/rtps/transport/UDPChannelResource.h index a496a89bf13..8643e7c2ad9 100644 --- a/src/cpp/rtps/transport/UDPChannelResource.h +++ b/src/cpp/rtps/transport/UDPChannelResource.h @@ -150,15 +150,15 @@ class UDPChannelResource : public ChannelResource return getSocketPtr(socket_); } - inline void interface( - const std::string& interface) + inline void udp_interface( + const std::string& udp_interface) { - interface_ = interface; + udp_interface_ = udp_interface; } - inline const std::string& interface() const + inline const std::string& udp_interface() const { - return interface_; + return udp_interface_; } inline void message_receiver( @@ -208,7 +208,7 @@ class UDPChannelResource : public ChannelResource TransportReceiverInterface* message_receiver_; //Associated Readers/Writers inside of MessageReceiver eProsimaUDPSocket socket_; bool only_multicast_purpose_; - std::string interface_; + std::string udp_interface_; UDPTransportInterface* transport_; UDPChannelResource( diff --git a/src/cpp/rtps/transport/UDPTransportInterface.h b/src/cpp/rtps/transport/UDPTransportInterface.h index 38ceac4e9c5..135a46b2a99 100644 --- a/src/cpp/rtps/transport/UDPTransportInterface.h +++ b/src/cpp/rtps/transport/UDPTransportInterface.h @@ -231,7 +231,7 @@ class UDPTransportInterface : public TransportInterface //! Checks if the given interface is allowed by the white list. virtual bool is_interface_allowed( - const std::string& interface) const = 0; + const std::string& udp_interface) const = 0; /** * Method to get a list of interfaces to bind the socket associated to the given locator. diff --git a/src/cpp/rtps/transport/UDPv4Transport.cpp b/src/cpp/rtps/transport/UDPv4Transport.cpp index a3c0d4c1486..2604ccf8491 100644 --- a/src/cpp/rtps/transport/UDPv4Transport.cpp +++ b/src/cpp/rtps/transport/UDPv4Transport.cpp @@ -353,7 +353,7 @@ bool UDPv4Transport::OpenInputChannel( auto& channelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator)); for (UDPChannelResource* channelResource : channelResources) { - if (channelResource->interface() == locatorAddressStr) + if (channelResource->udp_interface() == locatorAddressStr) { found = true; break; @@ -394,7 +394,7 @@ bool UDPv4Transport::OpenInputChannel( auto& channelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator)); for (UDPChannelResource* channelResource : channelResources) { - if (channelResource->interface() == s_IPv4AddressAny) + if (channelResource->udp_interface() == s_IPv4AddressAny) { std::vector locNames; get_ipv4s_unique_interfaces(locNames, true); @@ -415,7 +415,7 @@ bool UDPv4Transport::OpenInputChannel( } else { - auto ip = asio::ip::address_v4::from_string(channelResource->interface()); + auto ip = asio::ip::address_v4::from_string(channelResource->udp_interface()); try { channelResource->socket()->set_option(ip::multicast::join_group(locatorAddress, ip)); @@ -453,9 +453,9 @@ std::vector UDPv4Transport::get_binding_interfaces_list() } bool UDPv4Transport::is_interface_allowed( - const std::string& interface) const + const std::string& udp_interface) const { - return is_interface_allowed(asio::ip::address_v4::from_string(interface)); + return is_interface_allowed(asio::ip::address_v4::from_string(udp_interface)); } bool UDPv4Transport::is_interface_allowed( @@ -574,7 +574,7 @@ void UDPv4Transport::update_network_interfaces() { for (UDPChannelResource* channelResource : channelResources.second) { - if (channelResource->interface() == s_IPv4AddressAny) + if (channelResource->udp_interface() == s_IPv4AddressAny) { std::vector locNames; get_ipv4s_unique_interfaces(locNames, true); @@ -596,7 +596,7 @@ void UDPv4Transport::update_network_interfaces() } else { - auto ip = asio::ip::address_v4::from_string(channelResource->interface()); + auto ip = asio::ip::address_v4::from_string(channelResource->udp_interface()); try { channelResource->socket()->set_option(ip::multicast::join_group( diff --git a/src/cpp/rtps/transport/UDPv4Transport.h b/src/cpp/rtps/transport/UDPv4Transport.h index a575e0b84f0..6815d449f1c 100644 --- a/src/cpp/rtps/transport/UDPv4Transport.h +++ b/src/cpp/rtps/transport/UDPv4Transport.h @@ -134,7 +134,7 @@ class UDPv4Transport : public UDPTransportInterface //! Checks if the given interface is allowed by the white list. bool is_interface_allowed( - const std::string& interface) const override; + const std::string& udp_interface) const override; /** * Method to get a list of interfaces to bind the socket associated to the given locator. diff --git a/src/cpp/rtps/transport/UDPv6Transport.cpp b/src/cpp/rtps/transport/UDPv6Transport.cpp index 37f5ce98dc3..5b59b1cf5ab 100644 --- a/src/cpp/rtps/transport/UDPv6Transport.cpp +++ b/src/cpp/rtps/transport/UDPv6Transport.cpp @@ -358,7 +358,7 @@ bool UDPv6Transport::OpenInputChannel( auto& channelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator)); for (UDPChannelResource* channelResource : channelResources) { - if (locatorAddressStr == channelResource->interface()) + if (locatorAddressStr == channelResource->udp_interface()) { found = true; break; @@ -400,7 +400,7 @@ bool UDPv6Transport::OpenInputChannel( auto pChannelResources = mInputSockets.at(IPLocator::getPhysicalPort(locator)); for (auto& channelResource : pChannelResources) { - if (channelResource->interface() == s_IPv6AddressAny) + if (channelResource->udp_interface() == s_IPv6AddressAny) { std::vector locNames; get_ipv6s_unique_interfaces(locNames, true); @@ -422,7 +422,7 @@ bool UDPv6Transport::OpenInputChannel( } else { - auto ip = asio::ip::address_v6::from_string(channelResource->interface()); + auto ip = asio::ip::address_v6::from_string(channelResource->udp_interface()); try { channelResource->socket()->set_option(ip::multicast::join_group(locatorAddress, ip.scope_id())); @@ -459,21 +459,21 @@ std::vector UDPv6Transport::get_binding_interfaces_list() } bool UDPv6Transport::is_interface_allowed( - const std::string& interface) const + const std::string& udp_interface) const { if (interface_whitelist_.empty()) { return true; } - if (asio::ip::address_v6::from_string(interface) == ip::address_v6::any()) + if (asio::ip::address_v6::from_string(udp_interface) == ip::address_v6::any()) { return true; } for (auto& whitelist : interface_whitelist_) { - if (compare_ips(whitelist.to_string(), interface)) + if (compare_ips(whitelist.to_string(), udp_interface)) { return true; } diff --git a/src/cpp/rtps/transport/UDPv6Transport.h b/src/cpp/rtps/transport/UDPv6Transport.h index 6e760eea0e1..1972b570e1b 100644 --- a/src/cpp/rtps/transport/UDPv6Transport.h +++ b/src/cpp/rtps/transport/UDPv6Transport.h @@ -141,7 +141,7 @@ class UDPv6Transport : public UDPTransportInterface //! Checks if the given interface is allowed by the white list. bool is_interface_allowed( - const std::string& interface) const override; + const std::string& udp_interface) const override; //! Checks if the interfaces white list is empty. bool is_interface_whitelist_empty() const override; diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp index 7440faa2d6d..2a904ed9af6 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp @@ -18,37 +18,37 @@ #include -#include #include +#include #include #include + +#include #include #include #include #include +#include #include #include #include -#include #include #include #include #include +#include -#include #include +#include #include #include #include #include #include #include - -#include -#include -#include -#include +#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/statistics/rtps/StatisticsBase.hpp b/src/cpp/statistics/rtps/StatisticsBase.hpp index 62c32188547..a563de76d5e 100644 --- a/src/cpp/statistics/rtps/StatisticsBase.hpp +++ b/src/cpp/statistics/rtps/StatisticsBase.hpp @@ -459,6 +459,7 @@ class StatisticsParticipantImpl }; // auxiliary conversion functions +// TODO(jlbueno): private headers shall not export API RTPS_DllAPI detail::Locator_s to_statistics_type(fastrtps::rtps::Locator_t); RTPS_DllAPI fastrtps::rtps::Locator_t to_fastdds_type( detail::Locator_s); diff --git a/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp b/src/cpp/xmlparser/XMLDynamicParser.cpp similarity index 99% rename from src/cpp/rtps/xmlparser/XMLDynamicParser.cpp rename to src/cpp/xmlparser/XMLDynamicParser.cpp index 816475f492f..7af2be73a24 100644 --- a/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp +++ b/src/cpp/xmlparser/XMLDynamicParser.cpp @@ -13,24 +13,23 @@ // limitations under the License. // -#include -#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 namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/src/cpp/rtps/xmlparser/XMLElementParser.cpp b/src/cpp/xmlparser/XMLElementParser.cpp similarity index 99% rename from src/cpp/rtps/xmlparser/XMLElementParser.cpp rename to src/cpp/xmlparser/XMLElementParser.cpp index ff7d2fc2f41..e3eaa295647 100644 --- a/src/cpp/rtps/xmlparser/XMLElementParser.cpp +++ b/src/cpp/xmlparser/XMLElementParser.cpp @@ -27,14 +27,14 @@ #include #include -#include -#include -#include +#include -#include -#include #include -#include +#include +#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -3823,7 +3823,7 @@ XMLP_ret XMLParser::getXMLBool( XMLP_ret XMLParser::getXMLEnum( tinyxml2::XMLElement* elem, - IntraprocessDeliveryType* e, + fastdds::IntraprocessDeliveryType* e, uint8_t /*ident*/) { // @@ -3848,9 +3848,9 @@ XMLP_ret XMLParser::getXMLEnum( } if (!get_element_enum_value(text.c_str(), *e, - OFF, IntraprocessDeliveryType::INTRAPROCESS_OFF, - USER_DATA_ONLY, IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, - FULL, IntraprocessDeliveryType::INTRAPROCESS_FULL)) + OFF, fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF, + USER_DATA_ONLY, fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, + FULL, fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL)) { EPROSIMA_LOG_ERROR(XMLPARSER, "Node '" << INTRAPROCESS_DELIVERY << "' with bad content"); return XMLP_ret::XML_ERROR; diff --git a/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp b/src/cpp/xmlparser/XMLEndpointParser.cpp similarity index 99% rename from src/cpp/rtps/xmlparser/XMLEndpointParser.cpp rename to src/cpp/xmlparser/XMLEndpointParser.cpp index 5be0f9f8e85..f961a1f403c 100644 --- a/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp +++ b/src/cpp/xmlparser/XMLEndpointParser.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include @@ -30,7 +30,7 @@ #include #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastrtps/xmlparser/XMLEndpointParser.h b/src/cpp/xmlparser/XMLEndpointParser.h similarity index 98% rename from include/fastrtps/xmlparser/XMLEndpointParser.h rename to src/cpp/xmlparser/XMLEndpointParser.h index 64743af59b6..adaa26ce67b 100644 --- a/include/fastrtps/xmlparser/XMLEndpointParser.h +++ b/src/cpp/xmlparser/XMLEndpointParser.h @@ -30,8 +30,9 @@ #include #include -#include -#include + +#include +#include namespace tinyxml2 { class XMLElement; diff --git a/src/cpp/rtps/xmlparser/XMLParser.cpp b/src/cpp/xmlparser/XMLParser.cpp similarity index 99% rename from src/cpp/rtps/xmlparser/XMLParser.cpp rename to src/cpp/xmlparser/XMLParser.cpp index ad0ef7f6353..66bf75ed5fd 100644 --- a/src/cpp/rtps/xmlparser/XMLParser.cpp +++ b/src/cpp/xmlparser/XMLParser.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include #include #include @@ -24,17 +24,18 @@ #include #include #include +#include #include #include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace eprosima { namespace fastrtps { @@ -1310,7 +1311,7 @@ XMLP_ret XMLParser::parseXMLLibrarySettings( } else { - LibrarySettingsAttributes library_settings; + fastdds::LibrarySettings library_settings; if (XMLP_ret::XML_OK != getXMLEnum(p_aux0, &library_settings.intraprocess_delivery, ident)) { return XMLP_ret::XML_ERROR; diff --git a/include/fastrtps/xmlparser/XMLParser.h b/src/cpp/xmlparser/XMLParser.h similarity index 73% rename from include/fastrtps/xmlparser/XMLParser.h rename to src/cpp/xmlparser/XMLParser.h index 2e7b8e26971..f686e2774fb 100644 --- a/include/fastrtps/xmlparser/XMLParser.h +++ b/src/cpp/xmlparser/XMLParser.h @@ -23,10 +23,10 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -34,7 +34,8 @@ #include #include #include -#include + +#include namespace tinyxml2 { class XMLElement; @@ -107,7 +108,7 @@ class XMLParser * Load the default XML file. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadDefaultXMLFile( + static XMLP_ret loadDefaultXMLFile( up_base_node_t& root); /** @@ -116,7 +117,7 @@ class XMLParser * @param root Root node. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXML( + static XMLP_ret loadXML( const std::string& filename, up_base_node_t& root); @@ -127,7 +128,7 @@ class XMLParser * @param root Root node. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXML( + static XMLP_ret loadXML( const char* data, size_t length, up_base_node_t& root); @@ -138,7 +139,7 @@ class XMLParser * @param root Root node. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXML( + static XMLP_ret loadXML( tinyxml2::XMLDocument& xmlDoc, up_base_node_t& root); @@ -148,7 +149,7 @@ class XMLParser * @param root Root node. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLProfiles( + static XMLP_ret loadXMLProfiles( tinyxml2::XMLElement& profiles, up_base_node_t& root); @@ -157,20 +158,20 @@ class XMLParser * @param types Node to be loaded. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLDynamicTypes( + static XMLP_ret loadXMLDynamicTypes( tinyxml2::XMLElement& types); protected: - RTPS_DllAPI static XMLP_ret parseXML( + static XMLP_ret parseXML( tinyxml2::XMLDocument& xmlDoc, up_base_node_t& root); - RTPS_DllAPI static XMLP_ret parseXMLProfiles( + static XMLP_ret parseXMLProfiles( tinyxml2::XMLElement& profiles, up_base_node_t& root); - RTPS_DllAPI static XMLP_ret parseProfiles( + static XMLP_ret parseProfiles( tinyxml2::XMLElement* p_root, BaseNode& profilesNode); @@ -180,74 +181,74 @@ class XMLParser * @param p_root Node to be loaded. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret parseLogConfig( + static XMLP_ret parseLogConfig( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLLibrarySettings( + static XMLP_ret parseXMLLibrarySettings( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLTransportsProf( + static XMLP_ret parseXMLTransportsProf( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLDomainParticipantFactoryProf( + static XMLP_ret parseXMLDomainParticipantFactoryProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLParticipantProf( + static XMLP_ret parseXMLParticipantProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLPublisherProf( + static XMLP_ret parseXMLPublisherProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLSubscriberProf( + static XMLP_ret parseXMLSubscriberProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLTopicData( + static XMLP_ret parseXMLTopicData( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLRequesterProf( + static XMLP_ret parseXMLRequesterProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLReplierProf( + static XMLP_ret parseXMLReplierProf( tinyxml2::XMLElement* p_root, BaseNode& rootNode); - RTPS_DllAPI static XMLP_ret parseXMLTransportData( + static XMLP_ret parseXMLTransportData( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret validateXMLTransportElements( + static XMLP_ret validateXMLTransportElements( tinyxml2::XMLElement& p_root); - RTPS_DllAPI static XMLP_ret parseXMLCommonTransportData( + static XMLP_ret parseXMLCommonTransportData( tinyxml2::XMLElement* p_root, sp_transport_t p_transport); - RTPS_DllAPI static XMLP_ret parseXMLPortBasedTransportData( + static XMLP_ret parseXMLPortBasedTransportData( tinyxml2::XMLElement* p_root, std::shared_ptr p_transport); - RTPS_DllAPI static XMLP_ret parseXMLSocketTransportData( + static XMLP_ret parseXMLSocketTransportData( tinyxml2::XMLElement* p_root, std::shared_ptr p_transport); - RTPS_DllAPI static XMLP_ret parseXMLCommonTCPTransportData( + static XMLP_ret parseXMLCommonTCPTransportData( tinyxml2::XMLElement* p_root, sp_transport_t p_transport); - RTPS_DllAPI static XMLP_ret parseXMLCommonSharedMemTransportData( + static XMLP_ret parseXMLCommonSharedMemTransportData( tinyxml2::XMLElement* p_root, sp_transport_t p_transport); - RTPS_DllAPI static XMLP_ret parse_tls_config( + static XMLP_ret parse_tls_config( tinyxml2::XMLElement* p_root, sp_transport_t tcp_transport); - RTPS_DllAPI static XMLP_ret parseXMLReceptionThreads( + static XMLP_ret parseXMLReceptionThreads( tinyxml2::XMLElement& p_root, fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap& reception_threads); @@ -256,105 +257,105 @@ class XMLParser * @param consumer Node to be loaded. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret parseXMLConsumer( + static XMLP_ret parseXMLConsumer( tinyxml2::XMLElement& consumer); - RTPS_DllAPI static XMLP_ret parseXMLDynamicTypes( + static XMLP_ret parseXMLDynamicTypes( tinyxml2::XMLElement& types); - RTPS_DllAPI static XMLP_ret parseDynamicTypes( + static XMLP_ret parseDynamicTypes( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLTypes( + static XMLP_ret parseXMLTypes( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLDynamicType( + static XMLP_ret parseXMLDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLStructDynamicType( + static XMLP_ret parseXMLStructDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLUnionDynamicType( + static XMLP_ret parseXMLUnionDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLEnumDynamicType( + static XMLP_ret parseXMLEnumDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLAliasDynamicType( + static XMLP_ret parseXMLAliasDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLBitsetDynamicType( + static XMLP_ret parseXMLBitsetDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static XMLP_ret parseXMLBitmaskDynamicType( + static XMLP_ret parseXMLBitmaskDynamicType( tinyxml2::XMLElement* p_root); - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLBitfieldDynamicType( + static p_dynamictypebuilder_t parseXMLBitfieldDynamicType( tinyxml2::XMLElement* p_root, p_dynamictypebuilder_t p_dynamictype, types::MemberId mId, uint16_t& position); - RTPS_DllAPI static XMLP_ret parseXMLBitvalueDynamicType( + static XMLP_ret parseXMLBitvalueDynamicType( tinyxml2::XMLElement* p_root, p_dynamictypebuilder_t p_dynamictype, uint16_t& position); - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLMemberDynamicType( + static p_dynamictypebuilder_t parseXMLMemberDynamicType( tinyxml2::XMLElement* p_root, p_dynamictypebuilder_t p_dynamictype, types::MemberId mId); - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLMemberDynamicType( + static p_dynamictypebuilder_t parseXMLMemberDynamicType( tinyxml2::XMLElement* p_root, p_dynamictypebuilder_t p_dynamictype, types::MemberId mId, const std::string& values); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* p_profile, DataNode& factory_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* p_profile, DataNode& participant_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* p_profile, DataNode& publisher_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* p_profile, DataNode& subscriber_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* node, DataNode& topic_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* node, DataNode& requester_node); - RTPS_DllAPI static XMLP_ret fillDataNode( + static XMLP_ret fillDataNode( tinyxml2::XMLElement* node, DataNode& replier_node); template - RTPS_DllAPI static void addAllAttributes( + static void addAllAttributes( tinyxml2::XMLElement* p_profile, DataNode& node); - RTPS_DllAPI static XMLP_ret getXMLEnum( + static XMLP_ret getXMLEnum( tinyxml2::XMLElement* elem, - fastrtps::IntraprocessDeliveryType* e, + fastdds::IntraprocessDeliveryType* e, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLPropertiesPolicy( + static XMLP_ret getXMLPropertiesPolicy( tinyxml2::XMLElement* elem, rtps::PropertyPolicy& propertiesPolicy, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLHistoryMemoryPolicy( + static XMLP_ret getXMLHistoryMemoryPolicy( tinyxml2::XMLElement* elem, rtps::MemoryManagementPolicy_t& historyMemoryPolicy, uint8_t ident); @@ -364,296 +365,296 @@ class XMLParser fastdds::rtps::ExternalLocators& external_locators, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLocatorList( + static XMLP_ret getXMLLocatorList( tinyxml2::XMLElement* elem, rtps::LocatorList_t& locatorList, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLocatorUDPv4( + static XMLP_ret getXMLLocatorUDPv4( tinyxml2::XMLElement* elem, rtps::Locator_t& locator, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLocatorUDPv6( + static XMLP_ret getXMLLocatorUDPv6( tinyxml2::XMLElement* elem, rtps::Locator_t& locator, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLocatorTCPv4( + static XMLP_ret getXMLLocatorTCPv4( tinyxml2::XMLElement* elem, rtps::Locator_t& locator, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLocatorTCPv6( + static XMLP_ret getXMLLocatorTCPv6( tinyxml2::XMLElement* elem, rtps::Locator_t& locator, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLWriterTimes( + static XMLP_ret getXMLWriterTimes( tinyxml2::XMLElement* elem, rtps::WriterTimes& times, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLReaderTimes( + static XMLP_ret getXMLReaderTimes( tinyxml2::XMLElement* elem, rtps::ReaderTimes& times, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDuration( + static XMLP_ret getXMLDuration( tinyxml2::XMLElement* elem, Duration_t& duration, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLWriterQosPolicies( + static XMLP_ret getXMLWriterQosPolicies( tinyxml2::XMLElement* elem, WriterQos& qos, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLReaderQosPolicies( + static XMLP_ret getXMLReaderQosPolicies( tinyxml2::XMLElement* elem, ReaderQos& qos, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLPublishModeQos( + static XMLP_ret getXMLPublishModeQos( tinyxml2::XMLElement* elem, PublishModeQosPolicy& publishMode, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLGroupDataQos( + static XMLP_ret getXMLGroupDataQos( tinyxml2::XMLElement* elem, GroupDataQosPolicy& groupData, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLTopicDataQos( + static XMLP_ret getXMLTopicDataQos( tinyxml2::XMLElement* elem, TopicDataQosPolicy& topicData, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLPartitionQos( + static XMLP_ret getXMLPartitionQos( tinyxml2::XMLElement* elem, PartitionQosPolicy& partition, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLPresentationQos( + static XMLP_ret getXMLPresentationQos( tinyxml2::XMLElement* elem, PresentationQosPolicy& presentation, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDestinationOrderQos( + static XMLP_ret getXMLDestinationOrderQos( tinyxml2::XMLElement* elem, DestinationOrderQosPolicy& destinationOrder, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLOwnershipStrengthQos( + static XMLP_ret getXMLOwnershipStrengthQos( tinyxml2::XMLElement* elem, OwnershipStrengthQosPolicy& ownershipStrength, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLOwnershipQos( + static XMLP_ret getXMLOwnershipQos( tinyxml2::XMLElement* elem, OwnershipQosPolicy& ownership, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLTimeBasedFilterQos( + static XMLP_ret getXMLTimeBasedFilterQos( tinyxml2::XMLElement* elem, TimeBasedFilterQosPolicy& timeBasedFilter, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLUserDataQos( + static XMLP_ret getXMLUserDataQos( tinyxml2::XMLElement* elem, UserDataQosPolicy& userData, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLifespanQos( + static XMLP_ret getXMLLifespanQos( tinyxml2::XMLElement* elem, LifespanQosPolicy& lifespan, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLReliabilityQos( + static XMLP_ret getXMLReliabilityQos( tinyxml2::XMLElement* elem, ReliabilityQosPolicy& reliability, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLivelinessQos( + static XMLP_ret getXMLLivelinessQos( tinyxml2::XMLElement* elem, LivelinessQosPolicy& liveliness, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLLatencyBudgetQos( + static XMLP_ret getXMLLatencyBudgetQos( tinyxml2::XMLElement* elem, LatencyBudgetQosPolicy& latencyBudget, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDeadlineQos( + static XMLP_ret getXMLDeadlineQos( tinyxml2::XMLElement* elem, DeadlineQosPolicy& deadline, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDurabilityServiceQos( + static XMLP_ret getXMLDurabilityServiceQos( tinyxml2::XMLElement* elem, DurabilityServiceQosPolicy& durabilityService, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDurabilityQos( + static XMLP_ret getXMLDurabilityQos( tinyxml2::XMLElement* elem, DurabilityQosPolicy& durability, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLTopicAttributes( + static XMLP_ret getXMLTopicAttributes( tinyxml2::XMLElement* elem, TopicAttributes& topic, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLHistoryQosPolicy( + static XMLP_ret getXMLHistoryQosPolicy( tinyxml2::XMLElement* elem, HistoryQosPolicy& historyQos, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLResourceLimitsQos( + static XMLP_ret getXMLResourceLimitsQos( tinyxml2::XMLElement* elem, ResourceLimitsQosPolicy& resourceLimitsQos, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLContainerAllocationConfig( + static XMLP_ret getXMLContainerAllocationConfig( tinyxml2::XMLElement* elem, ResourceLimitedContainerConfig& resourceLimitsQos, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLThroughputController( + static XMLP_ret getXMLThroughputController( tinyxml2::XMLElement* elem, rtps::ThroughputControllerDescriptor& throughputController, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLPortParameters( + static XMLP_ret getXMLPortParameters( tinyxml2::XMLElement* elem, rtps::PortParameters& port, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLParticipantAllocationAttributes( + static XMLP_ret getXMLParticipantAllocationAttributes( tinyxml2::XMLElement* elem, rtps::RTPSParticipantAllocationAttributes& allocation, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLRemoteLocatorsAllocationAttributes( + static XMLP_ret getXMLRemoteLocatorsAllocationAttributes( tinyxml2::XMLElement* elem, rtps::RemoteLocatorsAllocationAttributes& allocation, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLSendBuffersAllocationAttributes( + static XMLP_ret getXMLSendBuffersAllocationAttributes( tinyxml2::XMLElement* elem, rtps::SendBuffersAllocationAttributes& allocation, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDiscoverySettings( + static XMLP_ret getXMLDiscoverySettings( tinyxml2::XMLElement* elem, rtps::DiscoverySettings& settings, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLTypeLookupSettings( + static XMLP_ret getXMLTypeLookupSettings( tinyxml2::XMLElement* elem, rtps::TypeLookupSettings& settings, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLInitialAnnouncementsConfig( + static XMLP_ret getXMLInitialAnnouncementsConfig( tinyxml2::XMLElement* elem, rtps::InitialAnnouncementConfig& config, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLBuiltinAttributes( + static XMLP_ret getXMLBuiltinAttributes( tinyxml2::XMLElement* elem, rtps::BuiltinAttributes& builtin, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLOctetVector( + static XMLP_ret getXMLOctetVector( tinyxml2::XMLElement* elem, std::vector& octet_vector, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLInt( + static XMLP_ret getXMLInt( tinyxml2::XMLElement* elem, int* i, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLUint( + static XMLP_ret getXMLUint( tinyxml2::XMLElement* elem, unsigned int* ui, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLUint( + static XMLP_ret getXMLUint( tinyxml2::XMLElement* elem, uint16_t* ui16, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLUint( + static XMLP_ret getXMLUint( tinyxml2::XMLElement* elem, uint64_t* ui64, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLBool( + static XMLP_ret getXMLBool( tinyxml2::XMLElement* elem, bool* b, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLEnum( + static XMLP_ret getXMLEnum( tinyxml2::XMLElement* elem, rtps::DiscoveryProtocol_t* e, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLList( + static XMLP_ret getXMLList( tinyxml2::XMLElement* elem, eprosima::fastdds::rtps::RemoteServerList_t& list, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLEnum( + static XMLP_ret getXMLEnum( tinyxml2::XMLElement* elem, rtps::ParticipantFilteringFlags_t* e, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLRemoteServer( + static XMLP_ret getXMLRemoteServer( tinyxml2::XMLElement* elem, eprosima::fastdds::rtps::RemoteServerAttributes& server, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLString( + static XMLP_ret getXMLString( tinyxml2::XMLElement* elem, std::string* s, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLTransports( + static XMLP_ret getXMLTransports( tinyxml2::XMLElement* elem, std::vector>& transports, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDisablePositiveAcksQos( + static XMLP_ret getXMLDisablePositiveAcksQos( tinyxml2::XMLElement* elem, DisablePositiveACKsQosPolicy& disablePositiveAcks, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDataSharingQos( + static XMLP_ret getXMLDataSharingQos( tinyxml2::XMLElement* elem, DataSharingQosPolicy& data_sharing, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLguidPrefix( + static XMLP_ret getXMLguidPrefix( tinyxml2::XMLElement* elem, rtps::GuidPrefix_t& prefix, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLDomainParticipantFactoryQos( + static XMLP_ret getXMLDomainParticipantFactoryQos( tinyxml2::XMLElement& elem, fastdds::dds::DomainParticipantFactoryQos& qos); - RTPS_DllAPI static XMLP_ret getXMLPublisherAttributes( + static XMLP_ret getXMLPublisherAttributes( tinyxml2::XMLElement* elem, PublisherAttributes& publisher, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLSubscriberAttributes( + static XMLP_ret getXMLSubscriberAttributes( tinyxml2::XMLElement* elem, SubscriberAttributes& subscriber, uint8_t ident); - RTPS_DllAPI static XMLP_ret getXMLThreadSettings( + static XMLP_ret getXMLThreadSettings( tinyxml2::XMLElement& elem, fastdds::rtps::ThreadSettings& thread_setting); @@ -661,16 +662,16 @@ class XMLParser Return XMLP_ret::XML_OK when OK, XMLP_ret::XML_NOK when port attribute is not present, and XMLP_ret::XML_ERROR if error */ - RTPS_DllAPI static XMLP_ret getXMLThreadSettingsWithPort( + static XMLP_ret getXMLThreadSettingsWithPort( tinyxml2::XMLElement& elem, fastdds::rtps::ThreadSettings& thread_setting, uint32_t& port); - RTPS_DllAPI static XMLP_ret getXMLEntityFactoryQos( + static XMLP_ret getXMLEntityFactoryQos( tinyxml2::XMLElement& elem, fastdds::dds::EntityFactoryQosPolicy& entity_factory); - RTPS_DllAPI static XMLP_ret getXMLBuiltinTransports( + static XMLP_ret getXMLBuiltinTransports( tinyxml2::XMLElement* elem, eprosima::fastdds::rtps::BuiltinTransports* bt, eprosima::fastdds::rtps::BuiltinTransportsOptions* bt_opts, diff --git a/src/cpp/rtps/xmlparser/XMLParserCommon.cpp b/src/cpp/xmlparser/XMLParserCommon.cpp similarity index 99% rename from src/cpp/rtps/xmlparser/XMLParserCommon.cpp rename to src/cpp/xmlparser/XMLParserCommon.cpp index aca41bd7240..51fc07c3de5 100644 --- a/src/cpp/rtps/xmlparser/XMLParserCommon.cpp +++ b/src/cpp/xmlparser/XMLParserCommon.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastrtps/xmlparser/XMLParserCommon.h b/src/cpp/xmlparser/XMLParserCommon.h similarity index 100% rename from include/fastrtps/xmlparser/XMLParserCommon.h rename to src/cpp/xmlparser/XMLParserCommon.h diff --git a/src/cpp/rtps/xmlparser/XMLParserUtils.hpp b/src/cpp/xmlparser/XMLParserUtils.hpp similarity index 100% rename from src/cpp/rtps/xmlparser/XMLParserUtils.hpp rename to src/cpp/xmlparser/XMLParserUtils.hpp diff --git a/src/cpp/rtps/xmlparser/XMLProfileManager.cpp b/src/cpp/xmlparser/XMLProfileManager.cpp similarity index 98% rename from src/cpp/rtps/xmlparser/XMLProfileManager.cpp rename to src/cpp/xmlparser/XMLProfileManager.cpp index 2aca5eff846..f861d6c2fde 100644 --- a/src/cpp/rtps/xmlparser/XMLProfileManager.cpp +++ b/src/cpp/xmlparser/XMLProfileManager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include #include #ifdef _WIN32 @@ -23,13 +23,14 @@ #include #include -#include + +#include using namespace eprosima::fastrtps; using namespace eprosima::fastdds; using namespace ::xmlparser; -LibrarySettingsAttributes XMLProfileManager::library_settings_; +LibrarySettings XMLProfileManager::library_settings_; std::map XMLProfileManager::participant_factory_profiles_; dds::DomainParticipantFactoryQos default_participant_factory_qos; std::map XMLProfileManager::participant_profiles_; @@ -636,13 +637,13 @@ bool XMLProfileManager::insertTransportById( return false; } -const LibrarySettingsAttributes& XMLProfileManager::library_settings() +const LibrarySettings& XMLProfileManager::library_settings() { return library_settings_; } void XMLProfileManager::library_settings( - const LibrarySettingsAttributes& library_settings) + const LibrarySettings& library_settings) { library_settings_ = library_settings; } diff --git a/include/fastrtps/xmlparser/XMLProfileManager.h b/src/cpp/xmlparser/XMLProfileManager.h similarity index 83% rename from include/fastrtps/xmlparser/XMLProfileManager.h rename to src/cpp/xmlparser/XMLProfileManager.h index 3352ab4c926..353f3ade898 100644 --- a/include/fastrtps/xmlparser/XMLProfileManager.h +++ b/src/cpp/xmlparser/XMLProfileManager.h @@ -20,14 +20,16 @@ #include #include +#include #include #include #include #include #include #include -#include -#include + +#include +#include namespace eprosima { namespace fastrtps { @@ -61,7 +63,7 @@ class XMLProfileManager /** * Load the default profiles XML file. */ - RTPS_DllAPI static void loadDefaultXMLFile(); + static void loadDefaultXMLFile(); /** * Load a profiles XML file. @@ -69,7 +71,7 @@ class XMLProfileManager * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, * XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLFile( + static XMLP_ret loadXMLFile( const std::string& filename); /** @@ -79,7 +81,7 @@ class XMLProfileManager * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, * XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLString( + static XMLP_ret loadXMLString( const char* data, size_t length); @@ -89,7 +91,7 @@ class XMLProfileManager * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, * XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLNode( + static XMLP_ret loadXMLNode( tinyxml2::XMLDocument& doc); /** @@ -98,7 +100,7 @@ class XMLProfileManager * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, * XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLProfiles( + static XMLP_ret loadXMLProfiles( tinyxml2::XMLElement& profiles); /** @@ -106,21 +108,21 @@ class XMLProfileManager * @param types Node to be loaded. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret loadXMLDynamicTypes( + static XMLP_ret loadXMLDynamicTypes( tinyxml2::XMLElement& types); /** * Library settings setter. * @param library_settings New value for library settings. */ - RTPS_DllAPI static void library_settings( - const LibrarySettingsAttributes& library_settings); + static void library_settings( + const fastdds::LibrarySettings& library_settings); /** * Library settings getter. * @return const ref to current library settings. */ - RTPS_DllAPI static const LibrarySettingsAttributes& library_settings(); + static const fastdds::LibrarySettings& library_settings(); /** * Search for the profile specified and fill the structure. @@ -129,13 +131,13 @@ class XMLProfileManager * @param log_error Flag to log an error if the profile_name is not found. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. */ - RTPS_DllAPI static XMLP_ret fillParticipantAttributes( + static XMLP_ret fillParticipantAttributes( const std::string& profile_name, ParticipantAttributes& atts, bool log_error = true); //!Fills participant_attributes with the default values. - RTPS_DllAPI static void getDefaultParticipantAttributes( + static void getDefaultParticipantAttributes( ParticipantAttributes& participant_attributes); /** @@ -145,7 +147,7 @@ class XMLProfileManager * @param log_error Flag to log an error if the profile_name is not found. Defaults true. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret fillDomainParticipantFactoryQos( + static XMLP_ret fillDomainParticipantFactoryQos( const std::string& profile_name, fastdds::dds::DomainParticipantFactoryQos& qos, bool log_error = true); @@ -154,7 +156,7 @@ class XMLProfileManager * Fills input domain participant factory qos with the default values. * @param qos Structure to be filled. */ - RTPS_DllAPI static void getDefaultDomainParticipantFactoryQos( + static void getDefaultDomainParticipantFactoryQos( fastdds::dds::DomainParticipantFactoryQos& qos); /** @@ -164,13 +166,13 @@ class XMLProfileManager * @param log_error Flag to log an error if the profile_name is not found. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. */ - RTPS_DllAPI static XMLP_ret fillPublisherAttributes( + static XMLP_ret fillPublisherAttributes( const std::string& profile_name, PublisherAttributes& atts, bool log_error = true); //!Fills publisher_attributes with the default values. - RTPS_DllAPI static void getDefaultPublisherAttributes( + static void getDefaultPublisherAttributes( PublisherAttributes& publisher_attributes); /** @@ -180,22 +182,22 @@ class XMLProfileManager * @param log_error Flag to log an error if the profile_name is not found. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. */ - RTPS_DllAPI static XMLP_ret fillSubscriberAttributes( + static XMLP_ret fillSubscriberAttributes( const std::string& profile_name, SubscriberAttributes& atts, bool log_error = true); //!Fills subscriber_attributes with the default values. - RTPS_DllAPI static void getDefaultSubscriberAttributes( + static void getDefaultSubscriberAttributes( SubscriberAttributes& subscriber_attributes); //!Add a new transport instance along with its id. - RTPS_DllAPI static bool insertTransportById( + static bool insertTransportById( const std::string& transport_id, sp_transport_t transport); //!Retrieves a transport instance by its id. - RTPS_DllAPI static sp_transport_t getTransportById( + static sp_transport_t getTransportById( const std::string& transport_id); /** @@ -204,21 +206,21 @@ class XMLProfileManager * @param atts Structure to be filled. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret fillTopicAttributes( + static XMLP_ret fillTopicAttributes( const std::string& profile_name, TopicAttributes& atts); //!Fills topic_attributes with the default values. - RTPS_DllAPI static void getDefaultTopicAttributes( + static void getDefaultTopicAttributes( TopicAttributes& topic_attributes); //!Add a new dynamic type instance along with its name. - RTPS_DllAPI static bool insertDynamicTypeByName( + static bool insertDynamicTypeByName( const std::string& type_name, p_dynamictypebuilder_t type); //!Retrieves a transport instance by its name. - RTPS_DllAPI static p_dynamictypebuilder_t getDynamicTypeByName( + static p_dynamictypebuilder_t getDynamicTypeByName( const std::string& type_name); @@ -228,7 +230,7 @@ class XMLProfileManager * @param atts Structure to be filled. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret fillRequesterAttributes( + static XMLP_ret fillRequesterAttributes( const std::string& profile_name, RequesterAttributes& atts); @@ -238,7 +240,7 @@ class XMLProfileManager * @param atts Structure to be filled. * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. */ - RTPS_DllAPI static XMLP_ret fillReplierAttributes( + static XMLP_ret fillReplierAttributes( const std::string& profile_name, ReplierAttributes& atts); @@ -247,7 +249,7 @@ class XMLProfileManager * FastDDS's Domain calls this method automatically on its destructor, but * if using XMLProfileManager outside of FastDDS, it should be called manually. */ - RTPS_DllAPI static void DeleteInstance() + static void DeleteInstance() { participant_factory_profiles_.clear(); participant_profiles_.clear(); @@ -265,7 +267,7 @@ class XMLProfileManager * Any instance retrieve by calling this method must be deleted calling the * XMLProfileManager::DeleteDynamicPubSubType method. */ - RTPS_DllAPI static types::DynamicPubSubType* CreateDynamicPubSubType( + static types::DynamicPubSubType* CreateDynamicPubSubType( const std::string& type_name) { if (dynamic_types_.find(type_name) != dynamic_types_.end()) @@ -279,7 +281,7 @@ class XMLProfileManager * Deletes the given DynamicPubSubType previously created by calling * XMLProfileManager::CreateDynamicPubSubType method. */ - RTPS_DllAPI static void DeleteDynamicPubSubType( + static void DeleteDynamicPubSubType( types::DynamicPubSubType* type) { delete type; @@ -287,41 +289,41 @@ class XMLProfileManager private: - RTPS_DllAPI static XMLP_ret extractProfiles( + static XMLP_ret extractProfiles( up_base_node_t properties, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractDomainParticipantFactoryProfile( + static XMLP_ret extractDomainParticipantFactoryProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractParticipantProfile( + static XMLP_ret extractParticipantProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractPublisherProfile( + static XMLP_ret extractPublisherProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractSubscriberProfile( + static XMLP_ret extractSubscriberProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractTopicProfile( + static XMLP_ret extractTopicProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractRequesterProfile( + static XMLP_ret extractRequesterProfile( up_base_node_t& profile, const std::string& filename); - RTPS_DllAPI static XMLP_ret extractReplierProfile( + static XMLP_ret extractReplierProfile( up_base_node_t& profile, const std::string& filename); static BaseNode* root; - static LibrarySettingsAttributes library_settings_; + static fastdds::LibrarySettings library_settings_; static participant_factory_map_t participant_factory_profiles_; diff --git a/include/fastrtps/xmlparser/XMLTree.h b/src/cpp/xmlparser/XMLTree.h similarity index 100% rename from include/fastrtps/xmlparser/XMLTree.h rename to src/cpp/xmlparser/XMLTree.h diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp index 37445e5598a..b87a38a8247 100644 --- a/test/blackbox/api/dds-pim/PubSubReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubReader.hpp @@ -31,28 +31,26 @@ #if _MSC_VER #include #endif // _MSC_VER -#include #include +#include #include -#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 DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index b050b50173c..edd49488784 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -29,11 +29,9 @@ #include #include - #if _MSC_VER #include #endif // _MSC_VER - #include #include #include @@ -54,8 +52,6 @@ #include #include #include -#include -#include using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; using eprosima::fastrtps::rtps::IPLocator; diff --git a/test/blackbox/common/BlackboxTests.cpp b/test/blackbox/common/BlackboxTests.cpp index dd07dd84f66..784693520e8 100644 --- a/test/blackbox/common/BlackboxTests.cpp +++ b/test/blackbox/common/BlackboxTests.cpp @@ -14,16 +14,17 @@ #include "BlackboxTests.hpp" +#include +#include +#include +#include + #include -#include -#include +#include #include - -#include -#include -#include -#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -64,9 +65,9 @@ class BlackboxEnvironment : public ::testing::Environment // conditions related to network packets being lost should not use intraprocess // nor datasharing. Setting it off here ensures that intraprocess and // datasharing are only tested when required. - LibrarySettingsAttributes att; - att.intraprocess_delivery = INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(att); enable_datasharing = false; use_pull_mode = false; use_udpv4 = true; diff --git a/test/blackbox/common/BlackboxTestsDeadlineQos.cpp b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp index b97bd366859..9a1a6f08a60 100644 --- a/test/blackbox/common/BlackboxTestsDeadlineQos.cpp +++ b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp @@ -14,10 +14,10 @@ #include -#include - +#include +#include #include -#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -41,12 +41,12 @@ class DeadlineQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -59,12 +59,12 @@ class DeadlineQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsDiscovery.cpp b/test/blackbox/common/BlackboxTestsDiscovery.cpp index bed4615816c..8a335a00208 100644 --- a/test/blackbox/common/BlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/BlackboxTestsDiscovery.cpp @@ -12,18 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #ifndef _WIN32 #include #endif // _WIN32 - #include +#include +#include #include #include -#include +#include + +// TODO(jlbueno): remove private header #include -#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -48,12 +49,12 @@ class Discovery : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -66,12 +67,12 @@ class Discovery : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsLifespanQoS.cpp b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp index 5c1b40fc81c..23f127eb8f6 100644 --- a/test/blackbox/common/BlackboxTestsLifespanQoS.cpp +++ b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp @@ -12,17 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include - -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -40,12 +39,12 @@ class LifespanQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -58,12 +57,12 @@ class LifespanQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp index 5634fcb51b2..5014bfe38a5 100644 --- a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp +++ b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #include +#include +#include +#include + +#include "BlackboxTests.hpp" +#include "PubSubParticipant.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "PubSubWriterReader.hpp" -#include "PubSubParticipant.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -42,12 +42,12 @@ class LivelinessQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -60,12 +60,12 @@ class LivelinessQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -1902,9 +1902,9 @@ TEST_P(LivelinessQos, AssertLivelinessParticipant) TEST(LivelinessTests, Detect_Deadlock_ManualByParticipant_Intraprocess) { // Set up intraprocess - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); // Create two participants PubSubWriterReader participantA(TEST_TOPIC_NAME), participantB(TEST_TOPIC_NAME); diff --git a/test/blackbox/common/BlackboxTestsNetworkConf.cpp b/test/blackbox/common/BlackboxTestsNetworkConf.cpp index 4b9e97fb6b4..a1fec026ffe 100644 --- a/test/blackbox/common/BlackboxTestsNetworkConf.cpp +++ b/test/blackbox/common/BlackboxTestsNetworkConf.cpp @@ -278,15 +278,15 @@ void interface_whitelist_test( } // include the interfaces in the transport descriptor - for (const auto& interface : pub_interfaces) + for (const auto& network_interface : pub_interfaces) { if (!interface_name) { - pub_udp_descriptor->interfaceWhiteList.push_back(interface.name); + pub_udp_descriptor->interfaceWhiteList.push_back(network_interface.name); } else { - pub_udp_descriptor->interfaceWhiteList.push_back(interface.dev); + pub_udp_descriptor->interfaceWhiteList.push_back(network_interface.dev); } } @@ -309,15 +309,15 @@ void interface_whitelist_test( } // include the interfaces in the transport descriptor - for (const auto& interface : sub_interfaces) + for (const auto& network_interface : sub_interfaces) { if (!interface_name) { - sub_udp_descriptor->interfaceWhiteList.push_back(interface.name); + sub_udp_descriptor->interfaceWhiteList.push_back(network_interface.name); } else { - sub_udp_descriptor->interfaceWhiteList.push_back(interface.dev); + sub_udp_descriptor->interfaceWhiteList.push_back(network_interface.dev); } } @@ -588,10 +588,11 @@ TEST_P(NetworkConfig, PubGetSendingLocatorsWhitelist) constexpr uint32_t port = 31337u; descriptor_->m_output_udp_socket = static_cast(port); - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - std::cout << "Adding interface '" << interface.name << "' (" << interface.name.size() << ")" << std::endl; - descriptor_->interfaceWhiteList.push_back(interface.name); + std::cout << "Adding interface '" << network_interface.name << "' (" << network_interface.name.size() << ")" << + std::endl; + descriptor_->interfaceWhiteList.push_back(network_interface.name); } writer.disable_builtin_transport(). diff --git a/test/blackbox/common/BlackboxTestsPubSubBasic.cpp b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp index 03e4387bad6..029e80c573e 100644 --- a/test/blackbox/common/BlackboxTestsPubSubBasic.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp @@ -12,8 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -21,17 +31,6 @@ #include "ReqRepAsReliableHelloWorldReplier.hpp" #include "ReqRepAsReliableHelloWorldRequester.hpp" -#include -#include -#include - -#include - -#include -#include -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -48,12 +47,12 @@ class PubSubBasic : public testing::TestWithParam(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -68,12 +67,12 @@ class PubSubBasic : public testing::TestWithParam(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp index 32a59f10aca..3c742ba5fa8 100644 --- a/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp @@ -16,8 +16,6 @@ #include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" diff --git a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp index a0476b6bd74..0442eac6fc0 100644 --- a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp @@ -14,13 +14,16 @@ #include +#include #include -#include +#include + +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -42,12 +45,12 @@ class PubSubFragments : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -62,12 +65,12 @@ class PubSubFragments : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp index 11d22a04f9f..f8c894e1ac5 100644 --- a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp @@ -16,14 +16,16 @@ #include #include +#include +#include #include -#include +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastdds::rtps; @@ -43,12 +45,12 @@ class PubSubHistory : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -73,12 +75,12 @@ class PubSubHistory : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp index eac950589c3..1c19d1bfb2d 100644 --- a/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp +++ b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -36,12 +36,12 @@ class RealtimeAllocations : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -54,12 +54,12 @@ class RealtimeAllocations : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsReliability.cpp b/test/blackbox/common/BlackboxTestsReliability.cpp index 43a26ad510a..501914ea4ea 100644 --- a/test/blackbox/common/BlackboxTestsReliability.cpp +++ b/test/blackbox/common/BlackboxTestsReliability.cpp @@ -14,14 +14,15 @@ #include +#include #include -#include +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/test/blackbox/common/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp index a82659c30a0..8df61f4f13e 100644 --- a/test/blackbox/common/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -16,26 +16,27 @@ #if HAVE_SECURITY -#include #include +#include #include #include +#include +#include +#include +#include +#include #include +// TODO(jlbueno): remove private header +#include + +#include "PubSubParticipant.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "PubSubWriterReader.hpp" -#include "PubSubParticipant.hpp" #include "UDPMessageSender.hpp" -#include -#include -#include -#include - -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; @@ -54,12 +55,12 @@ class Security : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -72,12 +73,12 @@ class Security : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -3505,10 +3506,10 @@ TEST_P(Security, RemoveParticipantProxyDataonSecurityManagerLeaseExpired_validat //!Lambda for configuring publisher participant qos and security properties auto secure_participant_pub_configurator = [&governance_file, &permissions_file](const std::shared_ptr>& part, - const std::shared_ptr& interface) + const std::shared_ptr& transport_interface) { part->lease_duration(3, 1); - part->disable_builtin_transport().add_user_transport_to_pparams(interface); + part->disable_builtin_transport().add_user_transport_to_pparams(transport_interface); PropertyPolicy property_policy; @@ -3542,10 +3543,10 @@ TEST_P(Security, RemoveParticipantProxyDataonSecurityManagerLeaseExpired_validat //!Lambda for configuring subscriber participant qos and security properties auto secure_participant_sub_configurator = [&governance_file, &permissions_file](const std::shared_ptr>& part, - const std::shared_ptr& interface) + const std::shared_ptr& transport_interface) { part->lease_duration(3, 1); - part->disable_builtin_transport().add_user_transport_to_pparams(interface); + part->disable_builtin_transport().add_user_transport_to_pparams(transport_interface); PropertyPolicy property_policy; diff --git a/test/blackbox/common/BlackboxTestsVolatile.cpp b/test/blackbox/common/BlackboxTestsVolatile.cpp index a7bf3769b1f..4a9b03d0878 100644 --- a/test/blackbox/common/BlackboxTestsVolatile.cpp +++ b/test/blackbox/common/BlackboxTestsVolatile.cpp @@ -12,17 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +// TODO(jlbueno): remove private header +#include + +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include -#include -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" using namespace eprosima::fastrtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; @@ -41,12 +43,12 @@ class Volatile : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -59,12 +61,12 @@ class Volatile : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp index d142ba1aa43..ff7f69ef7b7 100644 --- a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp +++ b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp @@ -40,6 +40,7 @@ #include #include +// TODO(jlbueno): remove private headers #include #include "BlackboxTests.hpp" diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index 53e46e925db..539a45dab2a 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -15,14 +15,13 @@ #include #include -#include - +#include #include #include #include +#include #include -#include -#include +#include #include "../types/HelloWorldTypeObject.h" #include "../types/TestRegression3361PubSubTypes.h" @@ -144,12 +143,12 @@ class DDSContentFilter : public testing::TestWithParam enable_datasharing = false; - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case communication_type::INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case communication_type::DATASHARING: enable_datasharing = true; @@ -167,12 +166,12 @@ class DDSContentFilter : public testing::TestWithParam { using namespace eprosima::fastrtps; - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case communication_type::INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case communication_type::DATASHARING: break; diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index d2bb301541b..398a967df94 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -14,10 +14,10 @@ #include +#include +#include #include -#include - #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -43,12 +43,12 @@ class DDSDataReader : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -61,12 +61,12 @@ class DDSDataReader : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -238,9 +238,9 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) { //! Manually set intraprocess - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); auto participant = DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, @@ -293,8 +293,8 @@ TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) ASSERT_TRUE(unread_count > 0); //! Reset back to INTRAPROCESS_OFF - library_settings.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } /** diff --git a/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp b/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp index 3818d4e4364..f436b441e6b 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp @@ -12,20 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - -#include #include - -#include +#include #include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include - using namespace eprosima::fastdds::dds; #if FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp b/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp index 5563a5ccad4..38379c2f560 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp @@ -16,10 +16,11 @@ #include #include -#include +#include #include +#include #include -#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -54,9 +55,9 @@ class DDSDataSharing : public testing::TestWithParam { if (GetParam()) { - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } } @@ -64,9 +65,9 @@ class DDSDataSharing : public testing::TestWithParam { if (GetParam()) { - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } } diff --git a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp index 9de2bca0c88..0b16f2f3ba3 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp @@ -14,17 +14,17 @@ #include -#include "BlackboxTests.hpp" - -#include "PubSubReader.hpp" -#include "PubSubWriter.hpp" - +#include +#include #include -#include -#include +// TODO(jlbueno): remove private header #include +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" + using namespace eprosima::fastrtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; using test_UDPv4TransportDescriptor = eprosima::fastdds::rtps::test_UDPv4TransportDescriptor; @@ -42,12 +42,12 @@ class DDSDataWriter : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -60,12 +60,12 @@ class DDSDataWriter : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp index 4840288faec..ec69a16e185 100644 --- a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp @@ -12,25 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include #include #include +#include +#include #include #include #include #include #include -#include - -#include "BlackboxTests.hpp" -#include "PubSubParticipant.hpp" -#include "PubSubReader.hpp" -#include "PubSubWriter.hpp" - #include #include #include @@ -41,9 +33,16 @@ #include #include #include -#include +#include + +// TODO(jlbueno): remove private header #include -#include + +#include "BlackboxTests.hpp" +#include "PubSubParticipant.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" + // Regression test for redmine issue 11857 TEST(DDSDiscovery, IgnoreParticipantFlags) @@ -1650,6 +1649,7 @@ TEST(DDSDiscovery, WaitSetMatchedStatus) TEST(DDSDiscovery, DataracePDP) { using namespace eprosima; + using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -1707,10 +1707,11 @@ TEST(DDSDiscovery, DataracePDP) }; // Disable intraprocess - auto settings = fastrtps::xmlparser::XMLProfileManager::library_settings(); + LibrarySettings settings; + DomainParticipantFactory::get_instance()->get_library_settings(settings); auto prev_intraprocess_delivery = settings.intraprocess_delivery; - settings.intraprocess_delivery = fastrtps::INTRAPROCESS_OFF; - fastrtps::xmlparser::XMLProfileManager::library_settings(settings); + settings.intraprocess_delivery = INTRAPROCESS_OFF; + DomainParticipantFactory::get_instance()->set_library_settings(settings); // DDS Domain Id const unsigned int DOMAIN_ID = (uint32_t)GET_PID() % 230; @@ -1778,5 +1779,5 @@ TEST(DDSDiscovery, DataracePDP) // Reestablish previous intraprocess configuration settings.intraprocess_delivery = prev_intraprocess_delivery; - fastrtps::xmlparser::XMLProfileManager::library_settings(settings); + DomainParticipantFactory::get_instance()->set_library_settings(settings); } diff --git a/test/blackbox/common/DDSBlackboxTestsListeners.cpp b/test/blackbox/common/DDSBlackboxTestsListeners.cpp index 90a0d9d4bfb..00f3a588c81 100644 --- a/test/blackbox/common/DDSBlackboxTestsListeners.cpp +++ b/test/blackbox/common/DDSBlackboxTestsListeners.cpp @@ -19,15 +19,15 @@ #include #include #include +#include +#include #include -#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::xmlparser; using test_UDPv4TransportDescriptor = eprosima::fastdds::rtps::test_UDPv4TransportDescriptor; @@ -48,13 +48,13 @@ class DDSStatus : public testing::TestWithParam void SetUp() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: library_settings.intraprocess_delivery = - eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_FULL; - XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -67,12 +67,12 @@ class DDSStatus : public testing::TestWithParam void TearDown() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_OFF; - XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp index 9a6494a2691..34e8ae2f24b 100644 --- a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp +++ b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp @@ -12,18 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include #include #include -#include +#include -#include +// TODO(jlbueno): remove private header #include -#include +#include "../types/statistics/monitorservice_typesPubSubTypes.h" #include "BlackboxTests.hpp" -#include "../dds-pim/PubSubReader.hpp" +#include "PubSubReader.hpp" #include "PubSubWriter.hpp" using namespace eprosima::fastdds; @@ -1176,9 +1175,9 @@ TEST(DDSMonitorServiceTest, monitor_service_environment_variable) const char* value = "NETWORK_LATENCY_TOPIC;MONITOR_SERVICE_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 //! Setup diff --git a/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp b/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp index 15ee89558c2..b770d277ca0 100644 --- a/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp @@ -14,9 +14,10 @@ #include -#include +#include +#include #include -#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -38,12 +39,12 @@ class OwnershipQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -56,12 +57,12 @@ class OwnershipQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsPersistence.cpp b/test/blackbox/common/DDSBlackboxTestsPersistence.cpp index d99e28ceb0a..78be1c59d7e 100644 --- a/test/blackbox/common/DDSBlackboxTestsPersistence.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPersistence.cpp @@ -14,9 +14,10 @@ #include -#include +#include #include -#include +#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -49,12 +50,12 @@ class PersistenceLargeData : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -80,12 +81,12 @@ class PersistenceLargeData : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp b/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp index 7a4cfac6029..090b9c840fe 100644 --- a/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp @@ -12,13 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 - -#include "PubSubReader.hpp" -#include "PubSubWriter.hpp" - #include #include #include @@ -26,8 +20,13 @@ #include #include +#include +#include #include -#include + +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds::dds; @@ -45,13 +44,13 @@ class PersistenceGuid : public ::testing::TestWithParam void SetUp() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: library_settings.intraprocess_delivery = - eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_FULL; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -76,12 +75,12 @@ class PersistenceGuid : public ::testing::TestWithParam void TearDown() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp b/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp index 832b8ef1eba..beb06dc37b7 100644 --- a/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp @@ -12,17 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include +#include #include #include "BlackboxTests.hpp" - #include "PubSubParticipant.hpp" -#include -#include -#include -#include - namespace test { const std::string EXTERNAL_PROPERTY_NAME = "CustomExternalProperty"; const std::string EXTERNAL_PROPERTY_VALUE = "My Value"; @@ -46,12 +44,12 @@ class PropertyQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -64,12 +62,12 @@ class PropertyQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp index 4be3ef5f5f1..152084e4611 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp @@ -14,11 +14,6 @@ #include -#include - -#include "BlackboxTests.hpp" -#include "PubSubReader.hpp" - #include #include #include @@ -26,9 +21,12 @@ #include #include #include -#include -#include -#include +#include + +#include "../types/statistics/types.h" +#include "../types/statistics/typesPubSubTypes.h" +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" class WriterReaderDataTest : public eprosima::fastdds::statistics::WriterReaderData { @@ -302,9 +300,9 @@ TEST(StatisticsDomainParticipant, CreateParticipant) // 1. Set environment variable and create participant using Qos set by code const char* value = "HISTORY_LATENCY_TOPIC;NETWORK_LATENCY_TOPIC;RTPS_LOST_TOPIC;RTPS_SENT_TOPIC;GAP_COUNT_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 // There is no problem if some topic name is repeated. @@ -352,9 +350,9 @@ TEST(StatisticsDomainParticipant, CreateParticipant) // Otherwise each domainParticipant (each DataReader is launched in its own domainParticipant) will also enable // the statistics DataWriters set with the environment variable. #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, "")); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", "")); #else - ASSERT_EQ(0, unsetenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE)); + ASSERT_EQ(0, unsetenv("FASTDDS_STATISTICS")); #endif // ifdef _WIN32 // Check that the statistics DataWriters has been created by matching a corresponding DataReader on those topics @@ -476,9 +474,9 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) // 1. Set environment variable and create participant using Qos set by code const char* value = "PUBLICATION_THROUGHPUT_TOPIC;HEARTBEAT_COUNT_TOPIC;RESENT_DATAS_TOPIC;ACKNACK_COUNT_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 // Load XML profiles @@ -523,9 +521,9 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) // Otherwise each domainParticipant (each DataReader is launched in its own domainParticipant) will also enable // the statistics DataWriters set with the environment variable. #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, "")); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", "")); #else - ASSERT_EQ(0, unsetenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE)); + ASSERT_EQ(0, unsetenv("FASTDDS_STATISTICS")); #endif // ifdef _WIN32 // Check that the statistics DataWriters has been created by matching a corresponding DataReader on those topics diff --git a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp index 5ed748d713d..212d03ce0bf 100644 --- a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp +++ b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp @@ -18,19 +18,20 @@ #include #include -#include +#include #include +#include #include #include -#include +#include +// TODO(jlbueno): remove private header #include -// BlackboxTests.hpp should be included before API #include "BlackboxTests.hpp" -#include "../api/dds-pim/PubSubReader.hpp" -#include "../api/dds-pim/PubSubWriter.hpp" #include "mock/BlackboxMockConsumer.h" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -49,12 +50,12 @@ class SHMUDP : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -67,12 +68,12 @@ class SHMUDP : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp b/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp index 34ea870eda6..7c11834b750 100644 --- a/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp @@ -12,17 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include +#include #include #include "BlackboxTests.hpp" - #include "PubSubParticipant.hpp" -#include -#include -#include -#include - using namespace eprosima::fastrtps; enum communication_type @@ -38,12 +36,12 @@ class UserDataQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -56,12 +54,12 @@ class UserDataQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/RTPSBlackboxTests.cpp b/test/blackbox/common/RTPSBlackboxTests.cpp index fe00f941db0..c4eba1e7cdf 100644 --- a/test/blackbox/common/RTPSBlackboxTests.cpp +++ b/test/blackbox/common/RTPSBlackboxTests.cpp @@ -18,8 +18,8 @@ #include #include +#include #include -#include #include #include "BlackboxTests.hpp" @@ -63,9 +63,9 @@ class BlackboxEnvironment : public ::testing::Environment // conditions related to network packets being lost should not use intraprocessr // nor datasharing. Setting it off here ensures that intraprocess and // datasharing are only tested when required. - LibrarySettingsAttributes att; - att.intraprocess_delivery = INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); //enable_datasharing = false; //Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); diff --git a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp index 9698cb088fb..13e42bc553e 100644 --- a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -19,15 +19,16 @@ #include #include +#include #include #include #include #include #include #include -#include #include +// TODO(jlbueno): remove private headers #include #include "BlackboxTests.hpp" @@ -52,12 +53,12 @@ class RTPS : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -67,12 +68,12 @@ class RTPS : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp b/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp index 84befaae27a..8d21db1a268 100644 --- a/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp @@ -14,10 +14,10 @@ #include "BlackboxTests.hpp" +#include +#include #include -#include - #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" @@ -36,12 +36,12 @@ class RTPSDiscovery : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -51,12 +51,12 @@ class RTPSDiscovery : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp index eaa9ce59e64..81c728dcc8b 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 #include #include +#include +#include +#include + +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" -#include - -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -115,12 +115,12 @@ class Persistence : public ::testing::TestWithParam virtual void SetUp() { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: @@ -163,12 +163,12 @@ class Persistence : public ::testing::TestWithParam virtual void TearDown() { std::remove(db_file_name_.c_str()); - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp b/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp index 43c8b63fddb..1f385e5517a 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 #include -#include -#include #include +#include +#include -#include "RTPSWithRegistrationWriter.hpp" -#include "RTPSWithRegistrationReader.hpp" - +#include +#include #include -#include + +#include "BlackboxTests.hpp" +#include "RTPSWithRegistrationReader.hpp" +#include "RTPSWithRegistrationWriter.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -42,12 +42,12 @@ class PersistenceGuid : public ::testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: @@ -57,12 +57,12 @@ class PersistenceGuid : public ::testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPools.cpp b/test/blackbox/common/RTPSBlackboxTestsPools.cpp index d1a5d130dc3..9d8cc4766b9 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPools.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPools.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - -#include "RTPSWithRegistrationReader.hpp" -#include "RTPSWithRegistrationWriter.hpp" +#include +#include +#include +#include #include -#include -#include -#include +#include "BlackboxTests.hpp" +#include "RTPSWithRegistrationReader.hpp" +#include "RTPSWithRegistrationWriter.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -38,12 +38,12 @@ class RTPSCustomPools : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -53,12 +53,12 @@ class RTPSCustomPools : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp index d3981ab4575..8d92d9d3b3c 100644 --- a/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp @@ -12,15 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #include #include +#include +#include #include -#include - +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" @@ -38,12 +37,12 @@ class Volatile : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -53,12 +52,12 @@ class Volatile : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/types/statistics/monitorservice_types.cxx b/test/blackbox/types/statistics/monitorservice_types.cxx new file mode 100644 index 00000000000..2ea9407d9ef --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_types.cxx @@ -0,0 +1,2056 @@ +// 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 monitorservice_types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "monitorservice_types.h" + +#if FASTCDR_VERSION_MAJOR > 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + + + + + +Connection::Connection() +{ +} + +Connection::~Connection() +{ +} + +Connection::Connection( + const Connection& x) +{ + m_mode = x.m_mode; + m_guid = x.m_guid; + m_announced_locators = x.m_announced_locators; + m_used_locators = x.m_used_locators; +} + +Connection::Connection( + Connection&& x) noexcept +{ + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); +} + +Connection& Connection::operator =( + const Connection& x) +{ + + m_mode = x.m_mode; + m_guid = x.m_guid; + m_announced_locators = x.m_announced_locators; + m_used_locators = x.m_used_locators; + return *this; +} + +Connection& Connection::operator =( + Connection&& x) noexcept +{ + + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); + return *this; +} + +bool Connection::operator ==( + const Connection& x) const +{ + return (m_mode == x.m_mode && + m_guid == x.m_guid && + m_announced_locators == x.m_announced_locators && + m_used_locators == x.m_used_locators); +} + +bool Connection::operator !=( + const Connection& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ +void Connection::mode( + eprosima::fastdds::statistics::ConnectionMode _mode) +{ + m_mode = _mode; +} + +/*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ +eprosima::fastdds::statistics::ConnectionMode Connection::mode() const +{ + return m_mode; +} + +/*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ +eprosima::fastdds::statistics::ConnectionMode& Connection::mode() +{ + return m_mode; +} + + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void Connection::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void Connection::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() +{ + return m_guid; +} + + +/*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ +void Connection::announced_locators( + const std::vector& _announced_locators) +{ + m_announced_locators = _announced_locators; +} + +/*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ +void Connection::announced_locators( + std::vector&& _announced_locators) +{ + m_announced_locators = std::move(_announced_locators); +} + +/*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ +const std::vector& Connection::announced_locators() const +{ + return m_announced_locators; +} + +/*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ +std::vector& Connection::announced_locators() +{ + return m_announced_locators; +} + + +/*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ +void Connection::used_locators( + const std::vector& _used_locators) +{ + m_used_locators = _used_locators; +} + +/*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ +void Connection::used_locators( + std::vector&& _used_locators) +{ + m_used_locators = std::move(_used_locators); +} + +/*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ +const std::vector& Connection::used_locators() const +{ + return m_used_locators; +} + +/*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ +std::vector& Connection::used_locators() +{ + return m_used_locators; +} + + + + +QosPolicyCount_s::QosPolicyCount_s() +{ +} + +QosPolicyCount_s::~QosPolicyCount_s() +{ +} + +QosPolicyCount_s::QosPolicyCount_s( + const QosPolicyCount_s& x) +{ + m_policy_id = x.m_policy_id; + m_count = x.m_count; +} + +QosPolicyCount_s::QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept +{ + m_policy_id = x.m_policy_id; + m_count = x.m_count; +} + +QosPolicyCount_s& QosPolicyCount_s::operator =( + const QosPolicyCount_s& x) +{ + + m_policy_id = x.m_policy_id; + m_count = x.m_count; + return *this; +} + +QosPolicyCount_s& QosPolicyCount_s::operator =( + QosPolicyCount_s&& x) noexcept +{ + + m_policy_id = x.m_policy_id; + m_count = x.m_count; + return *this; +} + +bool QosPolicyCount_s::operator ==( + const QosPolicyCount_s& x) const +{ + return (m_policy_id == x.m_policy_id && + m_count == x.m_count); +} + +bool QosPolicyCount_s::operator !=( + const QosPolicyCount_s& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ +void QosPolicyCount_s::policy_id( + uint32_t _policy_id) +{ + m_policy_id = _policy_id; +} + +/*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ +uint32_t QosPolicyCount_s::policy_id() const +{ + return m_policy_id; +} + +/*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ +uint32_t& QosPolicyCount_s::policy_id() +{ + return m_policy_id; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void QosPolicyCount_s::count( + uint32_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint32_t QosPolicyCount_s::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint32_t& QosPolicyCount_s::count() +{ + return m_count; +} + + + + +BaseStatus_s::BaseStatus_s() +{ +} + +BaseStatus_s::~BaseStatus_s() +{ +} + +BaseStatus_s::BaseStatus_s( + const BaseStatus_s& x) +{ + m_total_count = x.m_total_count; +} + +BaseStatus_s::BaseStatus_s( + BaseStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; +} + +BaseStatus_s& BaseStatus_s::operator =( + const BaseStatus_s& x) +{ + + m_total_count = x.m_total_count; + return *this; +} + +BaseStatus_s& BaseStatus_s::operator =( + BaseStatus_s&& x) noexcept +{ + + m_total_count = x.m_total_count; + return *this; +} + +bool BaseStatus_s::operator ==( + const BaseStatus_s& x) const +{ + return (m_total_count == x.m_total_count); +} + +bool BaseStatus_s::operator !=( + const BaseStatus_s& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void BaseStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t BaseStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& BaseStatus_s::total_count() +{ + return m_total_count; +} + + + + + + + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s() +{ +} + +IncompatibleQoSStatus_s::~IncompatibleQoSStatus_s() +{ +} + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x) +{ + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = x.m_policies; +} + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); +} + +IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( + const IncompatibleQoSStatus_s& x) +{ + + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = x.m_policies; + return *this; +} + +IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( + IncompatibleQoSStatus_s&& x) noexcept +{ + + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); + return *this; +} + +bool IncompatibleQoSStatus_s::operator ==( + const IncompatibleQoSStatus_s& x) const +{ + return (m_total_count == x.m_total_count && + m_last_policy_id == x.m_last_policy_id && + m_policies == x.m_policies); +} + +bool IncompatibleQoSStatus_s::operator !=( + const IncompatibleQoSStatus_s& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void IncompatibleQoSStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t IncompatibleQoSStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& IncompatibleQoSStatus_s::total_count() +{ + return m_total_count; +} + + +/*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ +void IncompatibleQoSStatus_s::last_policy_id( + uint32_t _last_policy_id) +{ + m_last_policy_id = _last_policy_id; +} + +/*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ +uint32_t IncompatibleQoSStatus_s::last_policy_id() const +{ + return m_last_policy_id; +} + +/*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ +uint32_t& IncompatibleQoSStatus_s::last_policy_id() +{ + return m_last_policy_id; +} + + +/*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ +void IncompatibleQoSStatus_s::policies( + const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies) +{ + m_policies = _policies; +} + +/*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ +void IncompatibleQoSStatus_s::policies( + eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies) +{ + m_policies = std::move(_policies); +} + +/*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ +const eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() const +{ + return m_policies; +} + +/*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ +eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() +{ + return m_policies; +} + + + + +LivelinessChangedStatus_s::LivelinessChangedStatus_s() +{ +} + +LivelinessChangedStatus_s::~LivelinessChangedStatus_s() +{ +} + +LivelinessChangedStatus_s::LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x) +{ + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = x.m_last_publication_handle; +} + +LivelinessChangedStatus_s::LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept +{ + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); +} + +LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( + const LivelinessChangedStatus_s& x) +{ + + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = x.m_last_publication_handle; + return *this; +} + +LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( + LivelinessChangedStatus_s&& x) noexcept +{ + + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); + return *this; +} + +bool LivelinessChangedStatus_s::operator ==( + const LivelinessChangedStatus_s& x) const +{ + return (m_alive_count == x.m_alive_count && + m_not_alive_count == x.m_not_alive_count && + m_last_publication_handle == x.m_last_publication_handle); +} + +bool LivelinessChangedStatus_s::operator !=( + const LivelinessChangedStatus_s& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ +void LivelinessChangedStatus_s::alive_count( + uint32_t _alive_count) +{ + m_alive_count = _alive_count; +} + +/*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ +uint32_t LivelinessChangedStatus_s::alive_count() const +{ + return m_alive_count; +} + +/*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ +uint32_t& LivelinessChangedStatus_s::alive_count() +{ + return m_alive_count; +} + + +/*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ +void LivelinessChangedStatus_s::not_alive_count( + uint32_t _not_alive_count) +{ + m_not_alive_count = _not_alive_count; +} + +/*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ +uint32_t LivelinessChangedStatus_s::not_alive_count() const +{ + return m_not_alive_count; +} + +/*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ +uint32_t& LivelinessChangedStatus_s::not_alive_count() +{ + return m_not_alive_count; +} + + +/*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ +void LivelinessChangedStatus_s::last_publication_handle( + const std::array& _last_publication_handle) +{ + m_last_publication_handle = _last_publication_handle; +} + +/*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ +void LivelinessChangedStatus_s::last_publication_handle( + std::array&& _last_publication_handle) +{ + m_last_publication_handle = std::move(_last_publication_handle); +} + +/*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ +const std::array& LivelinessChangedStatus_s::last_publication_handle() const +{ + return m_last_publication_handle; +} + +/*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ +std::array& LivelinessChangedStatus_s::last_publication_handle() +{ + return m_last_publication_handle; +} + + + + +DeadlineMissedStatus_s::DeadlineMissedStatus_s() +{ +} + +DeadlineMissedStatus_s::~DeadlineMissedStatus_s() +{ +} + +DeadlineMissedStatus_s::DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x) +{ + m_total_count = x.m_total_count; + m_last_instance_handle = x.m_last_instance_handle; +} + +DeadlineMissedStatus_s::DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); +} + +DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( + const DeadlineMissedStatus_s& x) +{ + + m_total_count = x.m_total_count; + m_last_instance_handle = x.m_last_instance_handle; + return *this; +} + +DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( + DeadlineMissedStatus_s&& x) noexcept +{ + + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); + return *this; +} + +bool DeadlineMissedStatus_s::operator ==( + const DeadlineMissedStatus_s& x) const +{ + return (m_total_count == x.m_total_count && + m_last_instance_handle == x.m_last_instance_handle); +} + +bool DeadlineMissedStatus_s::operator !=( + const DeadlineMissedStatus_s& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void DeadlineMissedStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t DeadlineMissedStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& DeadlineMissedStatus_s::total_count() +{ + return m_total_count; +} + + +/*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ +void DeadlineMissedStatus_s::last_instance_handle( + const std::array& _last_instance_handle) +{ + m_last_instance_handle = _last_instance_handle; +} + +/*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ +void DeadlineMissedStatus_s::last_instance_handle( + std::array&& _last_instance_handle) +{ + m_last_instance_handle = std::move(_last_instance_handle); +} + +/*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ +const std::array& DeadlineMissedStatus_s::last_instance_handle() const +{ + return m_last_instance_handle; +} + +/*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ +std::array& DeadlineMissedStatus_s::last_instance_handle() +{ + return m_last_instance_handle; +} + + + + + + + + +MonitorServiceData::MonitorServiceData() +{ + m__d = eprosima::fastdds::statistics::PROXY; +} + +MonitorServiceData::~MonitorServiceData() +{ +} + +MonitorServiceData::MonitorServiceData( + const MonitorServiceData& x) +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = x.m_entity_proxy; + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = x.m_connection_list; + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = x.m_incompatible_qos_status; + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = x.m_inconsistent_topic_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = x.m_liveliness_lost_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = x.m_liveliness_changed_status; + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = x.m_deadline_missed_status; + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = x.m_sample_lost_status; + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } +} + +MonitorServiceData::MonitorServiceData( + MonitorServiceData&& x) noexcept +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = std::move(x.m_entity_proxy); + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = std::move(x.m_connection_list); + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = std::move(x.m_deadline_missed_status); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = std::move(x.m_sample_lost_status); + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } +} + +MonitorServiceData& MonitorServiceData::operator =( + const MonitorServiceData& x) +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = x.m_entity_proxy; + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = x.m_connection_list; + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = x.m_incompatible_qos_status; + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = x.m_inconsistent_topic_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = x.m_liveliness_lost_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = x.m_liveliness_changed_status; + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = x.m_deadline_missed_status; + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = x.m_sample_lost_status; + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } + + return *this; +} + +MonitorServiceData& MonitorServiceData::operator =( + MonitorServiceData&& x) noexcept +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = std::move(x.m_entity_proxy); + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = std::move(x.m_connection_list); + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = std::move(x.m_deadline_missed_status); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = std::move(x.m_sample_lost_status); + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } + + return *this; +} + +bool MonitorServiceData::operator ==( + const MonitorServiceData& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + return (m_entity_proxy == x.m_entity_proxy); + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + return (m_connection_list == x.m_connection_list); + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + return (m_incompatible_qos_status == x.m_incompatible_qos_status); + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + return (m_inconsistent_topic_status == x.m_inconsistent_topic_status); + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + return (m_liveliness_lost_status == x.m_liveliness_lost_status); + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + return (m_liveliness_changed_status == x.m_liveliness_changed_status); + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + return (m_deadline_missed_status == x.m_deadline_missed_status); + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + return (m_sample_lost_status == x.m_sample_lost_status); + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + return (m_statuses_size == x.m_statuses_size); + break; + + default: + break; + } + return false; +} + +bool MonitorServiceData::operator !=( + const MonitorServiceData& x) const +{ + return !(*this == x); +} + +void MonitorServiceData::_d( + eprosima::fastdds::statistics::StatusKind __d) +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + switch (__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + switch (__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + switch (__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + switch (__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + switch (__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + switch (__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + switch (__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + switch (__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + switch (__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + break; + + default: + break; + } + + if (!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +eprosima::fastdds::statistics::StatusKind MonitorServiceData::_d() const +{ + return m__d; +} + +eprosima::fastdds::statistics::StatusKind& MonitorServiceData::_d() +{ + return m__d; +} + +void MonitorServiceData::entity_proxy( + const std::vector& _entity_proxy) +{ + m_entity_proxy = _entity_proxy; + m__d = eprosima::fastdds::statistics::PROXY; + +} + +void MonitorServiceData::entity_proxy( + std::vector&& _entity_proxy) +{ + m_entity_proxy = std::move(_entity_proxy); + m__d = eprosima::fastdds::statistics::PROXY; + +} + +const std::vector& MonitorServiceData::entity_proxy() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_proxy; +} + +std::vector& MonitorServiceData::entity_proxy() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_proxy; +} + + +void MonitorServiceData::connection_list( + const std::vector& _connection_list) +{ + m_connection_list = _connection_list; + m__d = eprosima::fastdds::statistics::CONNECTION_LIST; + +} + +void MonitorServiceData::connection_list( + std::vector&& _connection_list) +{ + m_connection_list = std::move(_connection_list); + m__d = eprosima::fastdds::statistics::CONNECTION_LIST; + +} + +const std::vector& MonitorServiceData::connection_list() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_connection_list; +} + +std::vector& MonitorServiceData::connection_list() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_connection_list; +} + + +void MonitorServiceData::incompatible_qos_status( + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status) +{ + m_incompatible_qos_status = _incompatible_qos_status; + m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; + +} + +void MonitorServiceData::incompatible_qos_status( + eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status) +{ + m_incompatible_qos_status = std::move(_incompatible_qos_status); + m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; + +} + +const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; +} + +eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; +} + + +void MonitorServiceData::inconsistent_topic_status( + const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status) +{ + m_inconsistent_topic_status = _inconsistent_topic_status; + m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; + +} + +void MonitorServiceData::inconsistent_topic_status( + eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status) +{ + m_inconsistent_topic_status = std::move(_inconsistent_topic_status); + m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; + +} + +const eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; +} + +eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; +} + + +void MonitorServiceData::liveliness_lost_status( + const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status) +{ + m_liveliness_lost_status = _liveliness_lost_status; + m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; + +} + +void MonitorServiceData::liveliness_lost_status( + eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status) +{ + m_liveliness_lost_status = std::move(_liveliness_lost_status); + m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; + +} + +const eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; +} + +eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; +} + + +void MonitorServiceData::liveliness_changed_status( + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status) +{ + m_liveliness_changed_status = _liveliness_changed_status; + m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; + +} + +void MonitorServiceData::liveliness_changed_status( + eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status) +{ + m_liveliness_changed_status = std::move(_liveliness_changed_status); + m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; + +} + +const eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; +} + +eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; +} + + +void MonitorServiceData::deadline_missed_status( + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status) +{ + m_deadline_missed_status = _deadline_missed_status; + m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; + +} + +void MonitorServiceData::deadline_missed_status( + eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status) +{ + m_deadline_missed_status = std::move(_deadline_missed_status); + m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; + +} + +const eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; +} + +eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; +} + + +void MonitorServiceData::sample_lost_status( + const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status) +{ + m_sample_lost_status = _sample_lost_status; + m__d = eprosima::fastdds::statistics::SAMPLE_LOST; + +} + +void MonitorServiceData::sample_lost_status( + eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status) +{ + m_sample_lost_status = std::move(_sample_lost_status); + m__d = eprosima::fastdds::statistics::SAMPLE_LOST; + +} + +const eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; +} + +eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; +} + + +void MonitorServiceData::statuses_size( + uint8_t _statuses_size) +{ + m_statuses_size = _statuses_size; + m__d = eprosima::fastdds::statistics::STATUSES_SIZE; + +} + +uint8_t MonitorServiceData::statuses_size() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_statuses_size; +} + +uint8_t& MonitorServiceData::statuses_size() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_statuses_size; +} + + + + +MonitorServiceStatusData::MonitorServiceStatusData() +{ +} + +MonitorServiceStatusData::~MonitorServiceStatusData() +{ +} + +MonitorServiceStatusData::MonitorServiceStatusData( + const MonitorServiceStatusData& x) +{ + m_local_entity = x.m_local_entity; + m_status_kind = x.m_status_kind; + m_value = x.m_value; +} + +MonitorServiceStatusData::MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept +{ + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); +} + +MonitorServiceStatusData& MonitorServiceStatusData::operator =( + const MonitorServiceStatusData& x) +{ + + m_local_entity = x.m_local_entity; + m_status_kind = x.m_status_kind; + m_value = x.m_value; + return *this; +} + +MonitorServiceStatusData& MonitorServiceStatusData::operator =( + MonitorServiceStatusData&& x) noexcept +{ + + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); + return *this; +} + +bool MonitorServiceStatusData::operator ==( + const MonitorServiceStatusData& x) const +{ + return (m_local_entity == x.m_local_entity && + m_status_kind == x.m_status_kind && + m_value == x.m_value); +} + +bool MonitorServiceStatusData::operator !=( + const MonitorServiceStatusData& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ +void MonitorServiceStatusData::local_entity( + const eprosima::fastdds::statistics::detail::GUID_s& _local_entity) +{ + m_local_entity = _local_entity; +} + +/*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ +void MonitorServiceStatusData::local_entity( + eprosima::fastdds::statistics::detail::GUID_s&& _local_entity) +{ + m_local_entity = std::move(_local_entity); +} + +/*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ +const eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() const +{ + return m_local_entity; +} + +/*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ +eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() +{ + return m_local_entity; +} + + +/*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ +void MonitorServiceStatusData::status_kind( + eprosima::fastdds::statistics::StatusKind _status_kind) +{ + m_status_kind = _status_kind; +} + +/*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ +eprosima::fastdds::statistics::StatusKind MonitorServiceStatusData::status_kind() const +{ + return m_status_kind; +} + +/*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ +eprosima::fastdds::statistics::StatusKind& MonitorServiceStatusData::status_kind() +{ + return m_status_kind; +} + + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void MonitorServiceStatusData::value( + const eprosima::fastdds::statistics::MonitorServiceData& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void MonitorServiceStatusData::value( + eprosima::fastdds::statistics::MonitorServiceData&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() +{ + return m_value; +} + + + + +} // namespace statistics + + +} // namespace fastdds + + +} // namespace eprosima +// Include auxiliary functions like for serializing/deserializing. +#include "monitorservice_typesCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/monitorservice_types.h b/test/blackbox/types/statistics/monitorservice_types.h new file mode 100644 index 00000000000..08f713a0ee3 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_types.h @@ -0,0 +1,1370 @@ +// 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 monitorservice_types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include +#include "monitorservice_typesv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "types.h" + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(MONITORSERVICE_TYPES_SOURCE) +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) +#else +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) +#endif // MONITORSERVICE_TYPES_SOURCE +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +/*! + * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +enum ConnectionMode : uint32_t +{ + DATA_SHARING, + INTRAPROCESS, + TRANSPORT +}; + + + + +/*! + * @brief This class represents the structure Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class Connection +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Connection(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Connection(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection( + const Connection& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection( + Connection&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + const Connection& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + Connection&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Connection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Connection& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Connection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Connection& x) const; + + /*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ + eProsima_user_DllExport void mode( + eprosima::fastdds::statistics::ConnectionMode _mode); + + /*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ + eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode mode() const; + + /*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ + eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode& mode(); + + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + const std::vector& _announced_locators); + + /*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + std::vector&& _announced_locators); + + /*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ + eProsima_user_DllExport const std::vector& announced_locators() const; + + /*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ + eProsima_user_DllExport std::vector& announced_locators(); + + + /*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ + eProsima_user_DllExport void used_locators( + const std::vector& _used_locators); + + /*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ + eProsima_user_DllExport void used_locators( + std::vector&& _used_locators); + + /*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ + eProsima_user_DllExport const std::vector& used_locators() const; + + /*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ + eProsima_user_DllExport std::vector& used_locators(); + +private: + + eprosima::fastdds::statistics::ConnectionMode m_mode{eprosima::fastdds::statistics::DATA_SHARING}; + eprosima::fastdds::statistics::detail::GUID_s m_guid; + std::vector m_announced_locators; + std::vector m_used_locators; + +}; + + +/*! + * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class QosPolicyCount_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport QosPolicyCount_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~QosPolicyCount_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + const QosPolicyCount_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + const QosPolicyCount_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + QosPolicyCount_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const QosPolicyCount_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const QosPolicyCount_s& x) const; + + /*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ + eProsima_user_DllExport void policy_id( + uint32_t _policy_id); + + /*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ + eProsima_user_DllExport uint32_t policy_id() const; + + /*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ + eProsima_user_DllExport uint32_t& policy_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint32_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count(); + +private: + + uint32_t m_policy_id{0}; + uint32_t m_count{0}; + +}; + + +/*! + * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class BaseStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BaseStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BaseStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + const BaseStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + BaseStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + const BaseStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + BaseStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BaseStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BaseStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + +private: + + uint32_t m_total_count{0}; + +}; + + +typedef std::vector QosPolicyCountSeq_s; + + + +/*! + * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class IncompatibleQoSStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~IncompatibleQoSStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + const IncompatibleQoSStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + IncompatibleQoSStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const IncompatibleQoSStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const IncompatibleQoSStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + + + /*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ + eProsima_user_DllExport void last_policy_id( + uint32_t _last_policy_id); + + /*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ + eProsima_user_DllExport uint32_t last_policy_id() const; + + /*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ + eProsima_user_DllExport uint32_t& last_policy_id(); + + + /*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ + eProsima_user_DllExport void policies( + const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies); + + /*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ + eProsima_user_DllExport void policies( + eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies); + + /*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies() const; + + /*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ + eProsima_user_DllExport eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies(); + +private: + + uint32_t m_total_count{0}; + uint32_t m_last_policy_id{0}; + eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies; + +}; + + +/*! + * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class LivelinessChangedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LivelinessChangedStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LivelinessChangedStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + const LivelinessChangedStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + LivelinessChangedStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LivelinessChangedStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LivelinessChangedStatus_s& x) const; + + /*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ + eProsima_user_DllExport void alive_count( + uint32_t _alive_count); + + /*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ + eProsima_user_DllExport uint32_t alive_count() const; + + /*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ + eProsima_user_DllExport uint32_t& alive_count(); + + + /*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ + eProsima_user_DllExport void not_alive_count( + uint32_t _not_alive_count); + + /*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ + eProsima_user_DllExport uint32_t not_alive_count() const; + + /*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ + eProsima_user_DllExport uint32_t& not_alive_count(); + + + /*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + const std::array& _last_publication_handle); + + /*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + std::array&& _last_publication_handle); + + /*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ + eProsima_user_DllExport const std::array& last_publication_handle() const; + + /*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ + eProsima_user_DllExport std::array& last_publication_handle(); + +private: + + uint32_t m_alive_count{0}; + uint32_t m_not_alive_count{0}; + std::array m_last_publication_handle{0}; + +}; + + +/*! + * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class DeadlineMissedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeadlineMissedStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeadlineMissedStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + const DeadlineMissedStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + DeadlineMissedStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeadlineMissedStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeadlineMissedStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + + + /*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + const std::array& _last_instance_handle); + + /*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + std::array&& _last_instance_handle); + + /*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ + eProsima_user_DllExport const std::array& last_instance_handle() const; + + /*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ + eProsima_user_DllExport std::array& last_instance_handle(); + +private: + + uint32_t m_total_count{0}; + std::array m_last_instance_handle{0}; + +}; +typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; + +typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; + +typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; + +/*! + * @brief This class represents the enumeration StatusKind defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +enum StatusKind : uint32_t +{ + PROXY, + CONNECTION_LIST, + INCOMPATIBLE_QOS, + INCONSISTENT_TOPIC, + LIVELINESS_LOST, + LIVELINESS_CHANGED, + DEADLINE_MISSED, + SAMPLE_LOST, + STATUSES_SIZE +}; + + +/*! + * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + const MonitorServiceData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + MonitorServiceData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + const MonitorServiceData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + MonitorServiceData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceData& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::StatusKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& _d(); + + /*! + * @brief This function copies the value in member entity_proxy + * @param _entity_proxy New value to be copied in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + const std::vector& _entity_proxy); + + /*! + * @brief This function moves the value in member entity_proxy + * @param _entity_proxy New value to be moved in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + std::vector&& _entity_proxy); + + /*! + * @brief This function returns a constant reference to member entity_proxy + * @return Constant reference to member entity_proxy + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& entity_proxy() const; + + /*! + * @brief This function returns a reference to member entity_proxy + * @return Reference to member entity_proxy + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& entity_proxy(); + + + /*! + * @brief This function copies the value in member connection_list + * @param _connection_list New value to be copied in member connection_list + */ + eProsima_user_DllExport void connection_list( + const std::vector& _connection_list); + + /*! + * @brief This function moves the value in member connection_list + * @param _connection_list New value to be moved in member connection_list + */ + eProsima_user_DllExport void connection_list( + std::vector&& _connection_list); + + /*! + * @brief This function returns a constant reference to member connection_list + * @return Constant reference to member connection_list + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& connection_list() const; + + /*! + * @brief This function returns a reference to member connection_list + * @return Reference to member connection_list + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& connection_list(); + + + /*! + * @brief This function copies the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status); + + /*! + * @brief This function moves the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status); + + /*! + * @brief This function returns a constant reference to member incompatible_qos_status + * @return Constant reference to member incompatible_qos_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status() const; + + /*! + * @brief This function returns a reference to member incompatible_qos_status + * @return Reference to member incompatible_qos_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status(); + + + /*! + * @brief This function copies the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status); + + /*! + * @brief This function moves the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status); + + /*! + * @brief This function returns a constant reference to member inconsistent_topic_status + * @return Constant reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status() const; + + /*! + * @brief This function returns a reference to member inconsistent_topic_status + * @return Reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status(); + + + /*! + * @brief This function copies the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status); + + /*! + * @brief This function moves the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status); + + /*! + * @brief This function returns a constant reference to member liveliness_lost_status + * @return Constant reference to member liveliness_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status() const; + + /*! + * @brief This function returns a reference to member liveliness_lost_status + * @return Reference to member liveliness_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status(); + + + /*! + * @brief This function copies the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status); + + /*! + * @brief This function moves the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status); + + /*! + * @brief This function returns a constant reference to member liveliness_changed_status + * @return Constant reference to member liveliness_changed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status() const; + + /*! + * @brief This function returns a reference to member liveliness_changed_status + * @return Reference to member liveliness_changed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status(); + + + /*! + * @brief This function copies the value in member deadline_missed_status + * @param _deadline_missed_status New value to be copied in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status); + + /*! + * @brief This function moves the value in member deadline_missed_status + * @param _deadline_missed_status New value to be moved in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status); + + /*! + * @brief This function returns a constant reference to member deadline_missed_status + * @return Constant reference to member deadline_missed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status() const; + + /*! + * @brief This function returns a reference to member deadline_missed_status + * @return Reference to member deadline_missed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status(); + + + /*! + * @brief This function copies the value in member sample_lost_status + * @param _sample_lost_status New value to be copied in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status); + + /*! + * @brief This function moves the value in member sample_lost_status + * @param _sample_lost_status New value to be moved in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status); + + /*! + * @brief This function returns a constant reference to member sample_lost_status + * @return Constant reference to member sample_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status() const; + + /*! + * @brief This function returns a reference to member sample_lost_status + * @return Reference to member sample_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status(); + + + /*! + * @brief This function sets a value in member statuses_size + * @param _statuses_size New value for member statuses_size + */ + eProsima_user_DllExport void statuses_size( + uint8_t _statuses_size); + + /*! + * @brief This function returns the value of member statuses_size + * @return Value of member statuses_size + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t statuses_size() const; + + /*! + * @brief This function returns a reference to member statuses_size + * @return Reference to member statuses_size + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& statuses_size(); + +private: + + eprosima::fastdds::statistics::StatusKind m__d; + + std::vector m_entity_proxy; + std::vector m_connection_list; + eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status; + eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status; + eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status; + eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status; + eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status; + eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status; + uint8_t m_statuses_size{0}; +}; + + +/*! + * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceStatusData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceStatusData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceStatusData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + const MonitorServiceStatusData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + const MonitorServiceStatusData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + MonitorServiceStatusData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceStatusData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceStatusData& x) const; + + /*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ + eProsima_user_DllExport void local_entity( + const eprosima::fastdds::statistics::detail::GUID_s& _local_entity); + + /*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ + eProsima_user_DllExport void local_entity( + eprosima::fastdds::statistics::detail::GUID_s&& _local_entity); + + /*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_entity() const; + + /*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_entity(); + + + /*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ + eProsima_user_DllExport void status_kind( + eprosima::fastdds::statistics::StatusKind _status_kind); + + /*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind status_kind() const; + + /*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& status_kind(); + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const eprosima::fastdds::statistics::MonitorServiceData& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + eprosima::fastdds::statistics::MonitorServiceData&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::MonitorServiceData& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport eprosima::fastdds::statistics::MonitorServiceData& value(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_entity; + eprosima::fastdds::statistics::StatusKind m_status_kind{eprosima::fastdds::statistics::PROXY}; + eprosima::fastdds::statistics::MonitorServiceData m_value; + +}; + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp b/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp new file mode 100644 index 00000000000..f50dc36ec34 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp @@ -0,0 +1,143 @@ +// 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 monitorservice_typesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ + +#include "monitorservice_types.h" + +constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize {0UL}; + + + + + + + +constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize {565252UL}; +constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize {32UL}; + + + + + +constexpr uint32_t eprosima_fastdds_statistics_Connection_max_cdr_typesize {5652UL}; +constexpr uint32_t eprosima_fastdds_statistics_Connection_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize {1220UL}; +constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize {0UL}; + + + + + + + +constexpr uint32_t eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data); + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data); + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data); + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp b/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp new file mode 100644 index 00000000000..1a0877a6868 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp @@ -0,0 +1,959 @@ +// 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 monitorservice_typesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ + +#include "monitorservice_typesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::Connection& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.mode(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.announced_locators(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.used_locators(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.mode() + << eprosima::fastcdr::MemberId(1) << data.guid() + << eprosima::fastcdr::MemberId(2) << data.announced_locators() + << eprosima::fastcdr::MemberId(3) << data.used_locators() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.mode(); + break; + + case 1: + dcdr >> data.guid(); + break; + + case 2: + dcdr >> data.announced_locators(); + break; + + case 3: + dcdr >> data.used_locators(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::QosPolicyCount_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.policy_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.policy_id() + << eprosima::fastcdr::MemberId(1) << data.count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.policy_id(); + break; + + case 1: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::BaseStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.last_policy_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.policies(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() + << eprosima::fastcdr::MemberId(1) << data.last_policy_id() + << eprosima::fastcdr::MemberId(2) << data.policies() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + case 1: + dcdr >> data.last_policy_id(); + break; + + case 2: + dcdr >> data.policies(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.alive_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.not_alive_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.last_publication_handle(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.alive_count() + << eprosima::fastcdr::MemberId(1) << data.not_alive_count() + << eprosima::fastcdr::MemberId(2) << data.last_publication_handle() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.alive_count(); + break; + + case 1: + dcdr >> data.not_alive_count(); + break; + + case 2: + dcdr >> data.last_publication_handle(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.last_instance_handle(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() + << eprosima::fastcdr::MemberId(1) << data.last_instance_handle() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + case 1: + dcdr >> data.last_instance_handle(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::MonitorServiceData& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case eprosima::fastdds::statistics::PROXY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.entity_proxy(), current_alignment); + break; + + case eprosima::fastdds::statistics::CONNECTION_LIST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.connection_list(), current_alignment); + break; + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.incompatible_qos_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.inconsistent_topic_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.liveliness_lost_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.liveliness_changed_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.deadline_missed_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::SAMPLE_LOST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.sample_lost_status(), current_alignment); + break; + + case eprosima::fastdds::statistics::STATUSES_SIZE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.statuses_size(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceData& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case eprosima::fastdds::statistics::PROXY: + scdr << eprosima::fastcdr::MemberId(1) << data.entity_proxy(); + break; + + case eprosima::fastdds::statistics::CONNECTION_LIST: + scdr << eprosima::fastcdr::MemberId(2) << data.connection_list(); + break; + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + scdr << eprosima::fastcdr::MemberId(3) << data.incompatible_qos_status(); + break; + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + scdr << eprosima::fastcdr::MemberId(4) << data.inconsistent_topic_status(); + break; + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + scdr << eprosima::fastcdr::MemberId(5) << data.liveliness_lost_status(); + break; + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + scdr << eprosima::fastcdr::MemberId(6) << data.liveliness_changed_status(); + break; + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + scdr << eprosima::fastcdr::MemberId(7) << data.deadline_missed_status(); + break; + + case eprosima::fastdds::statistics::SAMPLE_LOST: + scdr << eprosima::fastcdr::MemberId(8) << data.sample_lost_status(); + break; + + case eprosima::fastdds::statistics::STATUSES_SIZE: + scdr << eprosima::fastcdr::MemberId(9) << data.statuses_size(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::MonitorServiceData& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data._d(); + break; + default: + switch (data._d()) + { + case eprosima::fastdds::statistics::PROXY: + dcdr >> data.entity_proxy(); + break; + + case eprosima::fastdds::statistics::CONNECTION_LIST: + dcdr >> data.connection_list(); + break; + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + dcdr >> data.incompatible_qos_status(); + break; + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + dcdr >> data.inconsistent_topic_status(); + break; + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + dcdr >> data.liveliness_lost_status(); + break; + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + dcdr >> data.liveliness_changed_status(); + break; + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + dcdr >> data.deadline_missed_status(); + break; + + case eprosima::fastdds::statistics::SAMPLE_LOST: + dcdr >> data.sample_lost_status(); + break; + + case eprosima::fastdds::statistics::STATUSES_SIZE: + dcdr >> data.statuses_size(); + break; + + default: + break; + } + ret_value = false; + break; + } + return ret_value; + }); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.local_entity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.status_kind(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.local_entity() + << eprosima::fastcdr::MemberId(1) << data.status_kind() + << eprosima::fastcdr::MemberId(2) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.local_entity(); + break; + + case 1: + dcdr >> data.status_kind(); + break; + + case 2: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); + scdr << data.local_entity(); + + scdr << data.status_kind(); + + +} + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx new file mode 100644 index 00000000000..f43bd3147b2 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx @@ -0,0 +1,1390 @@ +// 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 monitorservice_typesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#include + +#include "monitorservice_typesPubSubTypes.h" +#include "monitorservice_typesCdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + namespace fastdds { + namespace statistics { + + + + + ConnectionPubSubType::ConnectionPubSubType() + { + setName("eprosima::fastdds::statistics::Connection"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Connection::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Connection_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_Connection_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_Connection_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ConnectionPubSubType::~ConnectionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ConnectionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Connection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool ConnectionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Connection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function ConnectionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* ConnectionPubSubType::createData() + { + return reinterpret_cast(new Connection()); + } + + void ConnectionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ConnectionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Connection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_Connection_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_Connection_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + QosPolicyCount_sPubSubType::QosPolicyCount_sPubSubType() + { + setName("eprosima::fastdds::statistics::QosPolicyCount_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(QosPolicyCount_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + QosPolicyCount_sPubSubType::~QosPolicyCount_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool QosPolicyCount_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + QosPolicyCount_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool QosPolicyCount_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + QosPolicyCount_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function QosPolicyCount_sPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* QosPolicyCount_sPubSubType::createData() + { + return reinterpret_cast(new QosPolicyCount_s()); + } + + void QosPolicyCount_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool QosPolicyCount_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + QosPolicyCount_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + BaseStatus_sPubSubType::BaseStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::BaseStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(BaseStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BaseStatus_sPubSubType::~BaseStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BaseStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + BaseStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool BaseStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + BaseStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function BaseStatus_sPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* BaseStatus_sPubSubType::createData() + { + return reinterpret_cast(new BaseStatus_s()); + } + + void BaseStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BaseStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + BaseStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + + + + + IncompatibleQoSStatus_sPubSubType::IncompatibleQoSStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::IncompatibleQoSStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(IncompatibleQoSStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + IncompatibleQoSStatus_sPubSubType::~IncompatibleQoSStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool IncompatibleQoSStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + IncompatibleQoSStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool IncompatibleQoSStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + IncompatibleQoSStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function IncompatibleQoSStatus_sPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* IncompatibleQoSStatus_sPubSubType::createData() + { + return reinterpret_cast(new IncompatibleQoSStatus_s()); + } + + void IncompatibleQoSStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool IncompatibleQoSStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + IncompatibleQoSStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + LivelinessChangedStatus_sPubSubType::LivelinessChangedStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::LivelinessChangedStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(LivelinessChangedStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LivelinessChangedStatus_sPubSubType::~LivelinessChangedStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LivelinessChangedStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + LivelinessChangedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool LivelinessChangedStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + LivelinessChangedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function LivelinessChangedStatus_sPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* LivelinessChangedStatus_sPubSubType::createData() + { + return reinterpret_cast(new LivelinessChangedStatus_s()); + } + + void LivelinessChangedStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LivelinessChangedStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LivelinessChangedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + DeadlineMissedStatus_sPubSubType::DeadlineMissedStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::DeadlineMissedStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeadlineMissedStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeadlineMissedStatus_sPubSubType::~DeadlineMissedStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeadlineMissedStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + DeadlineMissedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool DeadlineMissedStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + DeadlineMissedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function DeadlineMissedStatus_sPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* DeadlineMissedStatus_sPubSubType::createData() + { + return reinterpret_cast(new DeadlineMissedStatus_s()); + } + + void DeadlineMissedStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeadlineMissedStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeadlineMissedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + + + + + + + + + + + + + MonitorServiceStatusDataPubSubType::MonitorServiceStatusDataPubSubType() + { + setName("eprosima::fastdds::statistics::MonitorServiceStatusData"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(MonitorServiceStatusData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize; + #endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + MonitorServiceStatusDataPubSubType::~MonitorServiceStatusDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool MonitorServiceStatusDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + MonitorServiceStatusData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else + payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 + return true; + } + + bool MonitorServiceStatusDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + MonitorServiceStatusData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; + } + + std::function MonitorServiceStatusDataPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) + { + return [data, data_representation]() -> uint32_t + { + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 + }; + } + + void* MonitorServiceStatusDataPubSubType::createData() + { + return reinterpret_cast(new MonitorServiceStatusData()); + } + + void MonitorServiceStatusDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool MonitorServiceStatusDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + MonitorServiceStatusData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else + eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize > 16) + { + m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace statistics + + + } //End of namespace fastdds + + +} //End of namespace eprosima + diff --git a/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h new file mode 100644 index 00000000000..c5b04255efd --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h @@ -0,0 +1,695 @@ +// 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 monitorservice_typesPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "monitorservice_types.h" + +#include "typesPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated monitorservice_types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima +{ + namespace fastdds + { + namespace statistics + { + + + + + + /*! + * @brief This class represents the TopicDataType of the type Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class ConnectionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Connection type; + + eProsima_user_DllExport ConnectionPubSubType(); + + eProsima_user_DllExport ~ConnectionPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + + /*! + * @brief This class represents the TopicDataType of the type QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class QosPolicyCount_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef QosPolicyCount_s type; + + eProsima_user_DllExport QosPolicyCount_sPubSubType(); + + eProsima_user_DllExport ~QosPolicyCount_sPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + + /*! + * @brief This class represents the TopicDataType of the type BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class BaseStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BaseStatus_s type; + + eProsima_user_DllExport BaseStatus_sPubSubType(); + + eProsima_user_DllExport ~BaseStatus_sPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + typedef std::vector QosPolicyCountSeq_s; + + + + /*! + * @brief This class represents the TopicDataType of the type IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class IncompatibleQoSStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef IncompatibleQoSStatus_s type; + + eProsima_user_DllExport IncompatibleQoSStatus_sPubSubType(); + + eProsima_user_DllExport ~IncompatibleQoSStatus_sPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + + /*! + * @brief This class represents the TopicDataType of the type LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class LivelinessChangedStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LivelinessChangedStatus_s type; + + eProsima_user_DllExport LivelinessChangedStatus_sPubSubType(); + + eProsima_user_DllExport ~LivelinessChangedStatus_sPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + + /*! + * @brief This class represents the TopicDataType of the type DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class DeadlineMissedStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeadlineMissedStatus_s type; + + eProsima_user_DllExport DeadlineMissedStatus_sPubSubType(); + + eProsima_user_DllExport ~DeadlineMissedStatus_sPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; + typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; + typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; + + + + + + + + + /*! + * @brief This class represents the TopicDataType of the type MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class MonitorServiceStatusDataPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef MonitorServiceStatusData type; + + eProsima_user_DllExport MonitorServiceStatusDataPubSubType(); + + eProsima_user_DllExport ~MonitorServiceStatusDataPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::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::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + } + } +} + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesv1.cxx b/test/blackbox/types/statistics/monitorservice_typesv1.cxx new file mode 100644 index 00000000000..89494b4018c --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesv1.cxx @@ -0,0 +1,3011 @@ +// 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 monitorservice_types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "monitorservice_types.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; + +#define eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize 8ULL; + + +#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; + + + +#define eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize 24ULL; +#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; +#define eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize 12ULL; +#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; + +#define eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize 565252ULL; +#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; +#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; +#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; +#define eprosima_fastdds_statistics_Connection_max_cdr_typesize 5652ULL; +#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; +#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; +#define eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize 1220ULL; + + +#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; +#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize 28ULL; + + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + + + + + +Connection::Connection() +{ + // eprosima::fastdds::statistics::ConnectionMode m_mode + m_mode = eprosima::fastdds::statistics::DATA_SHARING; + // eprosima::fastdds::statistics::detail::GUID_s m_guid + + // sequence m_announced_locators + + // sequence m_used_locators + + +} + +Connection::~Connection() +{ +} + +Connection::Connection( + const Connection& x) +{ + m_mode = x.m_mode; + + + m_guid = x.m_guid; + + + m_announced_locators = x.m_announced_locators; + + + m_used_locators = x.m_used_locators; + +} + +Connection::Connection( + Connection&& x) noexcept +{ + m_mode = x.m_mode; + + + m_guid = std::move(x.m_guid); + + + m_announced_locators = std::move(x.m_announced_locators); + + + m_used_locators = std::move(x.m_used_locators); + +} + +Connection& Connection::operator =( + const Connection& x) +{ + m_mode = x.m_mode; + + + m_guid = x.m_guid; + + + m_announced_locators = x.m_announced_locators; + + + m_used_locators = x.m_used_locators; + + return *this; +} + +Connection& Connection::operator =( + Connection&& x) noexcept +{ + m_mode = x.m_mode; + + + m_guid = std::move(x.m_guid); + + + m_announced_locators = std::move(x.m_announced_locators); + + + m_used_locators = std::move(x.m_used_locators); + + return *this; +} + +bool Connection::operator ==( + const Connection& x) const +{ + return (m_mode == x.m_mode && + m_guid == x.m_guid && + m_announced_locators == x.m_announced_locators && + m_used_locators == x.m_used_locators); +} + +bool Connection::operator !=( + const Connection& x) const +{ + return !(*this == x); +} + +size_t Connection::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_Connection_max_cdr_typesize; +} + +size_t Connection::getCdrSerializedSize( + const Connection& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.announced_locators().size(); ++a) + { + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.announced_locators().at(a), current_alignment); + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.used_locators().size(); ++a) + { + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.used_locators().at(a), current_alignment); + } + + + + return current_alignment - initial_alignment; +} + + +void Connection::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_mode; + + scdr << m_guid; + + scdr << m_announced_locators; + + + scdr << m_used_locators; + + +} + +void Connection::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_mode = (eprosima::fastdds::statistics::ConnectionMode)enum_value; + } + + + + dcdr >> m_guid; + + + + dcdr >> m_announced_locators; + + + + dcdr >> m_used_locators; + + +} + + +bool Connection::isKeyDefined() +{ + return false; +} + +void Connection::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ +void Connection::mode( + eprosima::fastdds::statistics::ConnectionMode _mode) +{ + m_mode = _mode; +} + +/*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ +eprosima::fastdds::statistics::ConnectionMode Connection::mode() const +{ + return m_mode; +} + +/*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ +eprosima::fastdds::statistics::ConnectionMode& Connection::mode() +{ + return m_mode; +} + + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void Connection::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void Connection::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() +{ + return m_guid; +} + + +/*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ +void Connection::announced_locators( + const std::vector& _announced_locators) +{ + m_announced_locators = _announced_locators; +} + +/*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ +void Connection::announced_locators( + std::vector&& _announced_locators) +{ + m_announced_locators = std::move(_announced_locators); +} + +/*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ +const std::vector& Connection::announced_locators() const +{ + return m_announced_locators; +} + +/*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ +std::vector& Connection::announced_locators() +{ + return m_announced_locators; +} + + +/*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ +void Connection::used_locators( + const std::vector& _used_locators) +{ + m_used_locators = _used_locators; +} + +/*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ +void Connection::used_locators( + std::vector&& _used_locators) +{ + m_used_locators = std::move(_used_locators); +} + +/*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ +const std::vector& Connection::used_locators() const +{ + return m_used_locators; +} + +/*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ +std::vector& Connection::used_locators() +{ + return m_used_locators; +} + + + + + +QosPolicyCount_s::QosPolicyCount_s() +{ + // unsigned long m_policy_id + m_policy_id = 0; + // unsigned long m_count + m_count = 0; + +} + +QosPolicyCount_s::~QosPolicyCount_s() +{ +} + +QosPolicyCount_s::QosPolicyCount_s( + const QosPolicyCount_s& x) +{ + m_policy_id = x.m_policy_id; + + + m_count = x.m_count; + +} + +QosPolicyCount_s::QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept +{ + m_policy_id = x.m_policy_id; + + + m_count = x.m_count; + +} + +QosPolicyCount_s& QosPolicyCount_s::operator =( + const QosPolicyCount_s& x) +{ + m_policy_id = x.m_policy_id; + + + m_count = x.m_count; + + return *this; +} + +QosPolicyCount_s& QosPolicyCount_s::operator =( + QosPolicyCount_s&& x) noexcept +{ + m_policy_id = x.m_policy_id; + + + m_count = x.m_count; + + return *this; +} + +bool QosPolicyCount_s::operator ==( + const QosPolicyCount_s& x) const +{ + return (m_policy_id == x.m_policy_id && + m_count == x.m_count); +} + +bool QosPolicyCount_s::operator !=( + const QosPolicyCount_s& x) const +{ + return !(*this == x); +} + +size_t QosPolicyCount_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize; +} + +size_t QosPolicyCount_s::getCdrSerializedSize( + const QosPolicyCount_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void QosPolicyCount_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_policy_id; + + scdr << m_count; + +} + +void QosPolicyCount_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_policy_id; + + + + dcdr >> m_count; + + +} + + +bool QosPolicyCount_s::isKeyDefined() +{ + return false; +} + +void QosPolicyCount_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ +void QosPolicyCount_s::policy_id( + uint32_t _policy_id) +{ + m_policy_id = _policy_id; +} + +/*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ +uint32_t QosPolicyCount_s::policy_id() const +{ + return m_policy_id; +} + +/*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ +uint32_t& QosPolicyCount_s::policy_id() +{ + return m_policy_id; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void QosPolicyCount_s::count( + uint32_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint32_t QosPolicyCount_s::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint32_t& QosPolicyCount_s::count() +{ + return m_count; +} + + + + + +BaseStatus_s::BaseStatus_s() +{ + // unsigned long m_total_count + m_total_count = 0; + +} + +BaseStatus_s::~BaseStatus_s() +{ +} + +BaseStatus_s::BaseStatus_s( + const BaseStatus_s& x) +{ + m_total_count = x.m_total_count; + +} + +BaseStatus_s::BaseStatus_s( + BaseStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + +} + +BaseStatus_s& BaseStatus_s::operator =( + const BaseStatus_s& x) +{ + m_total_count = x.m_total_count; + + return *this; +} + +BaseStatus_s& BaseStatus_s::operator =( + BaseStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + + return *this; +} + +bool BaseStatus_s::operator ==( + const BaseStatus_s& x) const +{ + return (m_total_count == x.m_total_count); +} + +bool BaseStatus_s::operator !=( + const BaseStatus_s& x) const +{ + return !(*this == x); +} + +size_t BaseStatus_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize; +} + +size_t BaseStatus_s::getCdrSerializedSize( + const BaseStatus_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void BaseStatus_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_total_count; + +} + +void BaseStatus_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_total_count; + + +} + + +bool BaseStatus_s::isKeyDefined() +{ + return false; +} + +void BaseStatus_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void BaseStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t BaseStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& BaseStatus_s::total_count() +{ + return m_total_count; +} + + + + + + + + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s() +{ + // unsigned long m_total_count + m_total_count = 0; + // unsigned long m_last_policy_id + m_last_policy_id = 0; + // eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies + + +} + +IncompatibleQoSStatus_s::~IncompatibleQoSStatus_s() +{ +} + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x) +{ + m_total_count = x.m_total_count; + + + m_last_policy_id = x.m_last_policy_id; + + + m_policies = x.m_policies; + +} + +IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + + + m_last_policy_id = x.m_last_policy_id; + + + m_policies = std::move(x.m_policies); + +} + +IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( + const IncompatibleQoSStatus_s& x) +{ + m_total_count = x.m_total_count; + + + m_last_policy_id = x.m_last_policy_id; + + + m_policies = x.m_policies; + + return *this; +} + +IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( + IncompatibleQoSStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + + + m_last_policy_id = x.m_last_policy_id; + + + m_policies = std::move(x.m_policies); + + return *this; +} + +bool IncompatibleQoSStatus_s::operator ==( + const IncompatibleQoSStatus_s& x) const +{ + return (m_total_count == x.m_total_count && + m_last_policy_id == x.m_last_policy_id && + m_policies == x.m_policies); +} + +bool IncompatibleQoSStatus_s::operator !=( + const IncompatibleQoSStatus_s& x) const +{ + return !(*this == x); +} + +size_t IncompatibleQoSStatus_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize; +} + +size_t IncompatibleQoSStatus_s::getCdrSerializedSize( + const IncompatibleQoSStatus_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.policies().size(); ++a) + { + current_alignment += eprosima::fastdds::statistics::QosPolicyCount_s::getCdrSerializedSize(data.policies().at(a), current_alignment); + } + + + + return current_alignment - initial_alignment; +} + + +void IncompatibleQoSStatus_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_total_count; + + scdr << m_last_policy_id; + + scdr << m_policies; + + +} + +void IncompatibleQoSStatus_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_total_count; + + + + dcdr >> m_last_policy_id; + + + + dcdr >> m_policies; + + +} + + +bool IncompatibleQoSStatus_s::isKeyDefined() +{ + return false; +} + +void IncompatibleQoSStatus_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void IncompatibleQoSStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t IncompatibleQoSStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& IncompatibleQoSStatus_s::total_count() +{ + return m_total_count; +} + + +/*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ +void IncompatibleQoSStatus_s::last_policy_id( + uint32_t _last_policy_id) +{ + m_last_policy_id = _last_policy_id; +} + +/*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ +uint32_t IncompatibleQoSStatus_s::last_policy_id() const +{ + return m_last_policy_id; +} + +/*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ +uint32_t& IncompatibleQoSStatus_s::last_policy_id() +{ + return m_last_policy_id; +} + + +/*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ +void IncompatibleQoSStatus_s::policies( + const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies) +{ + m_policies = _policies; +} + +/*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ +void IncompatibleQoSStatus_s::policies( + eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies) +{ + m_policies = std::move(_policies); +} + +/*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ +const eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() const +{ + return m_policies; +} + +/*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ +eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() +{ + return m_policies; +} + + + + + +LivelinessChangedStatus_s::LivelinessChangedStatus_s() +{ + // unsigned long m_alive_count + m_alive_count = 0; + // unsigned long m_not_alive_count + m_not_alive_count = 0; + // octet m_last_publication_handle + memset(&m_last_publication_handle, 0, ((16)) * 1); + +} + +LivelinessChangedStatus_s::~LivelinessChangedStatus_s() +{ +} + +LivelinessChangedStatus_s::LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x) +{ + m_alive_count = x.m_alive_count; + + + m_not_alive_count = x.m_not_alive_count; + + + m_last_publication_handle = x.m_last_publication_handle; + +} + +LivelinessChangedStatus_s::LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept +{ + m_alive_count = x.m_alive_count; + + + m_not_alive_count = x.m_not_alive_count; + + + m_last_publication_handle = std::move(x.m_last_publication_handle); + +} + +LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( + const LivelinessChangedStatus_s& x) +{ + m_alive_count = x.m_alive_count; + + + m_not_alive_count = x.m_not_alive_count; + + + m_last_publication_handle = x.m_last_publication_handle; + + return *this; +} + +LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( + LivelinessChangedStatus_s&& x) noexcept +{ + m_alive_count = x.m_alive_count; + + + m_not_alive_count = x.m_not_alive_count; + + + m_last_publication_handle = std::move(x.m_last_publication_handle); + + return *this; +} + +bool LivelinessChangedStatus_s::operator ==( + const LivelinessChangedStatus_s& x) const +{ + return (m_alive_count == x.m_alive_count && + m_not_alive_count == x.m_not_alive_count && + m_last_publication_handle == x.m_last_publication_handle); +} + +bool LivelinessChangedStatus_s::operator !=( + const LivelinessChangedStatus_s& x) const +{ + return !(*this == x); +} + +size_t LivelinessChangedStatus_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize; +} + +size_t LivelinessChangedStatus_s::getCdrSerializedSize( + const LivelinessChangedStatus_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void LivelinessChangedStatus_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_alive_count; + + scdr << m_not_alive_count; + + scdr << m_last_publication_handle; + + +} + +void LivelinessChangedStatus_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_alive_count; + + + + dcdr >> m_not_alive_count; + + + + dcdr >> m_last_publication_handle; + + +} + + +bool LivelinessChangedStatus_s::isKeyDefined() +{ + return false; +} + +void LivelinessChangedStatus_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ +void LivelinessChangedStatus_s::alive_count( + uint32_t _alive_count) +{ + m_alive_count = _alive_count; +} + +/*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ +uint32_t LivelinessChangedStatus_s::alive_count() const +{ + return m_alive_count; +} + +/*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ +uint32_t& LivelinessChangedStatus_s::alive_count() +{ + return m_alive_count; +} + + +/*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ +void LivelinessChangedStatus_s::not_alive_count( + uint32_t _not_alive_count) +{ + m_not_alive_count = _not_alive_count; +} + +/*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ +uint32_t LivelinessChangedStatus_s::not_alive_count() const +{ + return m_not_alive_count; +} + +/*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ +uint32_t& LivelinessChangedStatus_s::not_alive_count() +{ + return m_not_alive_count; +} + + +/*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ +void LivelinessChangedStatus_s::last_publication_handle( + const std::array& _last_publication_handle) +{ + m_last_publication_handle = _last_publication_handle; +} + +/*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ +void LivelinessChangedStatus_s::last_publication_handle( + std::array&& _last_publication_handle) +{ + m_last_publication_handle = std::move(_last_publication_handle); +} + +/*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ +const std::array& LivelinessChangedStatus_s::last_publication_handle() const +{ + return m_last_publication_handle; +} + +/*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ +std::array& LivelinessChangedStatus_s::last_publication_handle() +{ + return m_last_publication_handle; +} + + + + + +DeadlineMissedStatus_s::DeadlineMissedStatus_s() +{ + // unsigned long m_total_count + m_total_count = 0; + // octet m_last_instance_handle + memset(&m_last_instance_handle, 0, ((16)) * 1); + +} + +DeadlineMissedStatus_s::~DeadlineMissedStatus_s() +{ +} + +DeadlineMissedStatus_s::DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x) +{ + m_total_count = x.m_total_count; + + + m_last_instance_handle = x.m_last_instance_handle; + +} + +DeadlineMissedStatus_s::DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + + + m_last_instance_handle = std::move(x.m_last_instance_handle); + +} + +DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( + const DeadlineMissedStatus_s& x) +{ + m_total_count = x.m_total_count; + + + m_last_instance_handle = x.m_last_instance_handle; + + return *this; +} + +DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( + DeadlineMissedStatus_s&& x) noexcept +{ + m_total_count = x.m_total_count; + + + m_last_instance_handle = std::move(x.m_last_instance_handle); + + return *this; +} + +bool DeadlineMissedStatus_s::operator ==( + const DeadlineMissedStatus_s& x) const +{ + return (m_total_count == x.m_total_count && + m_last_instance_handle == x.m_last_instance_handle); +} + +bool DeadlineMissedStatus_s::operator !=( + const DeadlineMissedStatus_s& x) const +{ + return !(*this == x); +} + +size_t DeadlineMissedStatus_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize; +} + +size_t DeadlineMissedStatus_s::getCdrSerializedSize( + const DeadlineMissedStatus_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void DeadlineMissedStatus_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_total_count; + + scdr << m_last_instance_handle; + + +} + +void DeadlineMissedStatus_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_total_count; + + + + dcdr >> m_last_instance_handle; + + +} + + +bool DeadlineMissedStatus_s::isKeyDefined() +{ + return false; +} + +void DeadlineMissedStatus_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ +void DeadlineMissedStatus_s::total_count( + uint32_t _total_count) +{ + m_total_count = _total_count; +} + +/*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ +uint32_t DeadlineMissedStatus_s::total_count() const +{ + return m_total_count; +} + +/*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ +uint32_t& DeadlineMissedStatus_s::total_count() +{ + return m_total_count; +} + + +/*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ +void DeadlineMissedStatus_s::last_instance_handle( + const std::array& _last_instance_handle) +{ + m_last_instance_handle = _last_instance_handle; +} + +/*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ +void DeadlineMissedStatus_s::last_instance_handle( + std::array&& _last_instance_handle) +{ + m_last_instance_handle = std::move(_last_instance_handle); +} + +/*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ +const std::array& DeadlineMissedStatus_s::last_instance_handle() const +{ + return m_last_instance_handle; +} + +/*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ +std::array& DeadlineMissedStatus_s::last_instance_handle() +{ + return m_last_instance_handle; +} + + + + + + + + + +MonitorServiceData::MonitorServiceData() +{ + m__d = eprosima::fastdds::statistics::PROXY; + // sequence m_entity_proxy + + // sequence m_connection_list + + // eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status + + // eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status + + // eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status + + // eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status + + // eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status + + // eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status + + // octet m_statuses_size + m_statuses_size = 0; +} + +MonitorServiceData::~MonitorServiceData() +{ +} + +MonitorServiceData::MonitorServiceData( + const MonitorServiceData& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = x.m_entity_proxy; + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = x.m_connection_list; + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = x.m_incompatible_qos_status; + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = x.m_inconsistent_topic_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = x.m_liveliness_lost_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = x.m_liveliness_changed_status; + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = x.m_deadline_missed_status; + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = x.m_sample_lost_status; + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } +} + +MonitorServiceData::MonitorServiceData( + MonitorServiceData&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = std::move(x.m_entity_proxy); + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = std::move(x.m_connection_list); + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = std::move(x.m_deadline_missed_status); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = std::move(x.m_sample_lost_status); + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } +} + +MonitorServiceData& MonitorServiceData::operator =( + const MonitorServiceData& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = x.m_entity_proxy; + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = x.m_connection_list; + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = x.m_incompatible_qos_status; + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = x.m_inconsistent_topic_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = x.m_liveliness_lost_status; + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = x.m_liveliness_changed_status; + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = x.m_deadline_missed_status; + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = x.m_sample_lost_status; + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } + + return *this; +} + +MonitorServiceData& MonitorServiceData::operator =( + MonitorServiceData&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + m_entity_proxy = std::move(x.m_entity_proxy); + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + m_connection_list = std::move(x.m_connection_list); + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + m_deadline_missed_status = std::move(x.m_deadline_missed_status); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + m_sample_lost_status = std::move(x.m_sample_lost_status); + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + m_statuses_size = x.m_statuses_size; + break; + + default: + break; + } + + return *this; +} + +bool MonitorServiceData::operator ==( + const MonitorServiceData& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + return (m_entity_proxy == x.m_entity_proxy); + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + return (m_connection_list == x.m_connection_list); + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + return (m_incompatible_qos_status == x.m_incompatible_qos_status); + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + return (m_inconsistent_topic_status == x.m_inconsistent_topic_status); + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + return (m_liveliness_lost_status == x.m_liveliness_lost_status); + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + return (m_liveliness_changed_status == x.m_liveliness_changed_status); + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + return (m_deadline_missed_status == x.m_deadline_missed_status); + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + return (m_sample_lost_status == x.m_sample_lost_status); + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + return (m_statuses_size == x.m_statuses_size); + break; + + default: + break; + } + return false; +} + +bool MonitorServiceData::operator !=( + const MonitorServiceData& x) const +{ + return !(*this == x); +} + +void MonitorServiceData::_d( + eprosima::fastdds::statistics::StatusKind __d) +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + switch(__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + switch(__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + switch(__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + switch(__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + switch(__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + switch(__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + switch(__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + switch(__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + switch(__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +eprosima::fastdds::statistics::StatusKind MonitorServiceData::_d() const +{ + return m__d; +} + +eprosima::fastdds::statistics::StatusKind& MonitorServiceData::_d() +{ + return m__d; +} + +void MonitorServiceData::entity_proxy( + const std::vector& _entity_proxy) +{ + m_entity_proxy = _entity_proxy; + m__d = eprosima::fastdds::statistics::PROXY; + +} + +void MonitorServiceData::entity_proxy( + std::vector&& _entity_proxy) +{ + m_entity_proxy = std::move(_entity_proxy); + m__d = eprosima::fastdds::statistics::PROXY; + +} + +const std::vector& MonitorServiceData::entity_proxy() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_proxy; +} + +std::vector& MonitorServiceData::entity_proxy() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_proxy; +} + + +void MonitorServiceData::connection_list( + const std::vector& _connection_list) +{ + m_connection_list = _connection_list; + m__d = eprosima::fastdds::statistics::CONNECTION_LIST; + +} + +void MonitorServiceData::connection_list( + std::vector&& _connection_list) +{ + m_connection_list = std::move(_connection_list); + m__d = eprosima::fastdds::statistics::CONNECTION_LIST; + +} + +const std::vector& MonitorServiceData::connection_list() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_connection_list; +} + +std::vector& MonitorServiceData::connection_list() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::CONNECTION_LIST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_connection_list; +} + + +void MonitorServiceData::incompatible_qos_status( + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status) +{ + m_incompatible_qos_status = _incompatible_qos_status; + m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; + +} + +void MonitorServiceData::incompatible_qos_status( + eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status) +{ + m_incompatible_qos_status = std::move(_incompatible_qos_status); + m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; + +} + +const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; +} + +eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; +} + + +void MonitorServiceData::inconsistent_topic_status( + const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status) +{ + m_inconsistent_topic_status = _inconsistent_topic_status; + m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; + +} + +void MonitorServiceData::inconsistent_topic_status( + eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status) +{ + m_inconsistent_topic_status = std::move(_inconsistent_topic_status); + m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; + +} + +const eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; +} + +eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; +} + + +void MonitorServiceData::liveliness_lost_status( + const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status) +{ + m_liveliness_lost_status = _liveliness_lost_status; + m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; + +} + +void MonitorServiceData::liveliness_lost_status( + eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status) +{ + m_liveliness_lost_status = std::move(_liveliness_lost_status); + m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; + +} + +const eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; +} + +eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; +} + + +void MonitorServiceData::liveliness_changed_status( + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status) +{ + m_liveliness_changed_status = _liveliness_changed_status; + m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; + +} + +void MonitorServiceData::liveliness_changed_status( + eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status) +{ + m_liveliness_changed_status = std::move(_liveliness_changed_status); + m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; + +} + +const eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; +} + +eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; +} + + +void MonitorServiceData::deadline_missed_status( + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status) +{ + m_deadline_missed_status = _deadline_missed_status; + m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; + +} + +void MonitorServiceData::deadline_missed_status( + eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status) +{ + m_deadline_missed_status = std::move(_deadline_missed_status); + m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; + +} + +const eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; +} + +eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DEADLINE_MISSED: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; +} + + +void MonitorServiceData::sample_lost_status( + const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status) +{ + m_sample_lost_status = _sample_lost_status; + m__d = eprosima::fastdds::statistics::SAMPLE_LOST; + +} + +void MonitorServiceData::sample_lost_status( + eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status) +{ + m_sample_lost_status = std::move(_sample_lost_status); + m__d = eprosima::fastdds::statistics::SAMPLE_LOST; + +} + +const eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; +} + +eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; +} + + +void MonitorServiceData::statuses_size( + uint8_t _statuses_size) +{ + m_statuses_size = _statuses_size; + m__d = eprosima::fastdds::statistics::STATUSES_SIZE; + +} + +uint8_t MonitorServiceData::statuses_size() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_statuses_size; +} + +uint8_t& MonitorServiceData::statuses_size() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::STATUSES_SIZE: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_statuses_size; +} + + +// TODO(Ricardo) Review +size_t MonitorServiceData::getCdrSerializedSize( + const MonitorServiceData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case eprosima::fastdds::statistics::PROXY: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.entity_proxy().size() > 0) + { + current_alignment += (data.entity_proxy().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.connection_list().size(); ++a) + { + current_alignment += eprosima::fastdds::statistics::Connection::getCdrSerializedSize(data.connection_list().at(a), current_alignment); + } + + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + current_alignment += eprosima::fastdds::statistics::IncompatibleQoSStatus_s::getCdrSerializedSize(data.incompatible_qos_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + current_alignment += eprosima::fastdds::statistics::InconsistentTopicStatus_s::getCdrSerializedSize(data.inconsistent_topic_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + current_alignment += eprosima::fastdds::statistics::LivelinessLostStatus_s::getCdrSerializedSize(data.liveliness_lost_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + current_alignment += eprosima::fastdds::statistics::LivelinessChangedStatus_s::getCdrSerializedSize(data.liveliness_changed_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + current_alignment += eprosima::fastdds::statistics::DeadlineMissedStatus_s::getCdrSerializedSize(data.deadline_missed_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + current_alignment += eprosima::fastdds::statistics::SampleLostStatus_s::getCdrSerializedSize(data.sample_lost_status(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void MonitorServiceData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + scdr << m_entity_proxy; + + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + scdr << m_connection_list; + + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + scdr << m_incompatible_qos_status; + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + scdr << m_inconsistent_topic_status; + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + scdr << m_liveliness_lost_status; + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + scdr << m_liveliness_changed_status; + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + scdr << m_deadline_missed_status; + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + scdr << m_sample_lost_status; + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + scdr << m_statuses_size; + + break; + + default: + break; + } +} + +void MonitorServiceData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m__d = (eprosima::fastdds::statistics::StatusKind)enum_value; + } + + + switch(m__d) + { + case eprosima::fastdds::statistics::PROXY: + dcdr >> m_entity_proxy; + + + break; + + + case eprosima::fastdds::statistics::CONNECTION_LIST: + dcdr >> m_connection_list; + + + break; + + + case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + dcdr >> m_incompatible_qos_status; + + + break; + + + case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + dcdr >> m_inconsistent_topic_status; + + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_LOST: + dcdr >> m_liveliness_lost_status; + + + break; + + + case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + dcdr >> m_liveliness_changed_status; + + + break; + + + case eprosima::fastdds::statistics::DEADLINE_MISSED: + dcdr >> m_deadline_missed_status; + + + break; + + + case eprosima::fastdds::statistics::SAMPLE_LOST: + dcdr >> m_sample_lost_status; + + + break; + + + case eprosima::fastdds::statistics::STATUSES_SIZE: + dcdr >> m_statuses_size; + + + break; + + default: + break; + } +} + + + + + +MonitorServiceStatusData::MonitorServiceStatusData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_local_entity + + // eprosima::fastdds::statistics::StatusKind m_status_kind + m_status_kind = eprosima::fastdds::statistics::PROXY; + // eprosima::fastdds::statistics::MonitorServiceData m_value + + +} + +MonitorServiceStatusData::~MonitorServiceStatusData() +{ +} + +MonitorServiceStatusData::MonitorServiceStatusData( + const MonitorServiceStatusData& x) +{ + m_local_entity = x.m_local_entity; + + + m_status_kind = x.m_status_kind; + + + m_value = x.m_value; + +} + +MonitorServiceStatusData::MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept +{ + m_local_entity = std::move(x.m_local_entity); + + + m_status_kind = x.m_status_kind; + + + m_value = std::move(x.m_value); + +} + +MonitorServiceStatusData& MonitorServiceStatusData::operator =( + const MonitorServiceStatusData& x) +{ + m_local_entity = x.m_local_entity; + + + m_status_kind = x.m_status_kind; + + + m_value = x.m_value; + + return *this; +} + +MonitorServiceStatusData& MonitorServiceStatusData::operator =( + MonitorServiceStatusData&& x) noexcept +{ + m_local_entity = std::move(x.m_local_entity); + + + m_status_kind = x.m_status_kind; + + + m_value = std::move(x.m_value); + + return *this; +} + +bool MonitorServiceStatusData::operator ==( + const MonitorServiceStatusData& x) const +{ + return (m_local_entity == x.m_local_entity && + m_status_kind == x.m_status_kind && + m_value == x.m_value); +} + +bool MonitorServiceStatusData::operator !=( + const MonitorServiceStatusData& x) const +{ + return !(*this == x); +} + +size_t MonitorServiceStatusData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize; +} + +size_t MonitorServiceStatusData::getCdrSerializedSize( + const MonitorServiceStatusData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_entity(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += eprosima::fastdds::statistics::MonitorServiceData::getCdrSerializedSize(data.value(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void MonitorServiceStatusData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_local_entity; + + scdr << (uint32_t)m_status_kind; + + scdr << m_value; + +} + +void MonitorServiceStatusData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_local_entity; + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_status_kind = (eprosima::fastdds::statistics::StatusKind)enum_value; + } + + + + dcdr >> m_value; + + +} + + +bool MonitorServiceStatusData::isKeyDefined() +{ + return true; +} + +void MonitorServiceStatusData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_local_entity.serialize(scdr); + + scdr << (uint32_t)m_status_kind; + + +} + +/*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ +void MonitorServiceStatusData::local_entity( + const eprosima::fastdds::statistics::detail::GUID_s& _local_entity) +{ + m_local_entity = _local_entity; +} + +/*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ +void MonitorServiceStatusData::local_entity( + eprosima::fastdds::statistics::detail::GUID_s&& _local_entity) +{ + m_local_entity = std::move(_local_entity); +} + +/*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ +const eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() const +{ + return m_local_entity; +} + +/*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ +eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() +{ + return m_local_entity; +} + + +/*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ +void MonitorServiceStatusData::status_kind( + eprosima::fastdds::statistics::StatusKind _status_kind) +{ + m_status_kind = _status_kind; +} + +/*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ +eprosima::fastdds::statistics::StatusKind MonitorServiceStatusData::status_kind() const +{ + return m_status_kind; +} + +/*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ +eprosima::fastdds::statistics::StatusKind& MonitorServiceStatusData::status_kind() +{ + return m_status_kind; +} + + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void MonitorServiceStatusData::value( + const eprosima::fastdds::statistics::MonitorServiceData& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void MonitorServiceStatusData::value( + eprosima::fastdds::statistics::MonitorServiceData&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() +{ + return m_value; +} + + + + + +} // namespace statistics + + +} // namespace fastdds + + +} // namespace eprosima + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/statistics/monitorservice_typesv1.h b/test/blackbox/types/statistics/monitorservice_typesv1.h new file mode 100644 index 00000000000..fde180bb00b --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesv1.h @@ -0,0 +1,1762 @@ +// 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 monitorservice_types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ + +#include "types.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(MONITORSERVICE_TYPES_SOURCE) +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) +#else +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) +#endif // MONITORSERVICE_TYPES_SOURCE +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace eprosima { + namespace fastdds { + namespace statistics { + /*! + * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + enum ConnectionMode : uint32_t + { + DATA_SHARING, + INTRAPROCESS, + TRANSPORT + }; + + + + + /*! + * @brief This class represents the structure Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class Connection + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Connection(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Connection(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection( + const Connection& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection( + Connection&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + const Connection& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + Connection&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Connection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Connection& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Connection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Connection& x) const; + + /*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ + eProsima_user_DllExport void mode( + eprosima::fastdds::statistics::ConnectionMode _mode); + + /*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ + eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode mode() const; + + /*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ + eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode& mode(); + + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + const std::vector& _announced_locators); + + /*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + std::vector&& _announced_locators); + + /*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ + eProsima_user_DllExport const std::vector& announced_locators() const; + + /*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ + eProsima_user_DllExport std::vector& announced_locators(); + + + /*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ + eProsima_user_DllExport void used_locators( + const std::vector& _used_locators); + + /*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ + eProsima_user_DllExport void used_locators( + std::vector&& _used_locators); + + /*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ + eProsima_user_DllExport const std::vector& used_locators() const; + + /*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ + eProsima_user_DllExport std::vector& used_locators(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Connection& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::ConnectionMode m_mode; + eprosima::fastdds::statistics::detail::GUID_s m_guid; + std::vector m_announced_locators; + std::vector m_used_locators; + + }; + + + + /*! + * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class QosPolicyCount_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport QosPolicyCount_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~QosPolicyCount_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + const QosPolicyCount_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + const QosPolicyCount_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + QosPolicyCount_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const QosPolicyCount_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const QosPolicyCount_s& x) const; + + /*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ + eProsima_user_DllExport void policy_id( + uint32_t _policy_id); + + /*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ + eProsima_user_DllExport uint32_t policy_id() const; + + /*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ + eProsima_user_DllExport uint32_t& policy_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint32_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::QosPolicyCount_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + uint32_t m_policy_id; + uint32_t m_count; + + }; + + + + /*! + * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class BaseStatus_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BaseStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BaseStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + const BaseStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + BaseStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + const BaseStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + BaseStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BaseStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BaseStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::BaseStatus_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + uint32_t m_total_count; + + }; + + + + typedef std::vector QosPolicyCountSeq_s; + + + + /*! + * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class IncompatibleQoSStatus_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~IncompatibleQoSStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + const IncompatibleQoSStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + IncompatibleQoSStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const IncompatibleQoSStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const IncompatibleQoSStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + + + /*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ + eProsima_user_DllExport void last_policy_id( + uint32_t _last_policy_id); + + /*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ + eProsima_user_DllExport uint32_t last_policy_id() const; + + /*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ + eProsima_user_DllExport uint32_t& last_policy_id(); + + + /*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ + eProsima_user_DllExport void policies( + const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies); + + /*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ + eProsima_user_DllExport void policies( + eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies); + + /*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies() const; + + /*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ + eProsima_user_DllExport eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + uint32_t m_total_count; + uint32_t m_last_policy_id; + eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies; + + }; + + + + /*! + * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class LivelinessChangedStatus_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LivelinessChangedStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LivelinessChangedStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + const LivelinessChangedStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + LivelinessChangedStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LivelinessChangedStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LivelinessChangedStatus_s& x) const; + + /*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ + eProsima_user_DllExport void alive_count( + uint32_t _alive_count); + + /*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ + eProsima_user_DllExport uint32_t alive_count() const; + + /*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ + eProsima_user_DllExport uint32_t& alive_count(); + + + /*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ + eProsima_user_DllExport void not_alive_count( + uint32_t _not_alive_count); + + /*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ + eProsima_user_DllExport uint32_t not_alive_count() const; + + /*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ + eProsima_user_DllExport uint32_t& not_alive_count(); + + + /*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + const std::array& _last_publication_handle); + + /*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + std::array&& _last_publication_handle); + + /*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ + eProsima_user_DllExport const std::array& last_publication_handle() const; + + /*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ + eProsima_user_DllExport std::array& last_publication_handle(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + uint32_t m_alive_count; + uint32_t m_not_alive_count; + std::array m_last_publication_handle; + + }; + + + + /*! + * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class DeadlineMissedStatus_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeadlineMissedStatus_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeadlineMissedStatus_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + const DeadlineMissedStatus_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + DeadlineMissedStatus_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeadlineMissedStatus_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeadlineMissedStatus_s& x) const; + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count); + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const; + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count(); + + + /*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + const std::array& _last_instance_handle); + + /*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + std::array&& _last_instance_handle); + + /*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ + eProsima_user_DllExport const std::array& last_instance_handle() const; + + /*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ + eProsima_user_DllExport std::array& last_instance_handle(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + uint32_t m_total_count; + std::array m_last_instance_handle; + + }; + + typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; + + typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; + + typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; + + /*! + * @brief This class represents the enumeration StatusKind defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + enum StatusKind : uint32_t + { + PROXY, + CONNECTION_LIST, + INCOMPATIBLE_QOS, + INCONSISTENT_TOPIC, + LIVELINESS_LOST, + LIVELINESS_CHANGED, + DEADLINE_MISSED, + SAMPLE_LOST, + STATUSES_SIZE + }; + + + /*! + * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class MonitorServiceData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + const MonitorServiceData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + MonitorServiceData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + const MonitorServiceData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + MonitorServiceData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceData& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::StatusKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& _d(); + + /*! + * @brief This function copies the value in member entity_proxy + * @param _entity_proxy New value to be copied in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + const std::vector& _entity_proxy); + + /*! + * @brief This function moves the value in member entity_proxy + * @param _entity_proxy New value to be moved in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + std::vector&& _entity_proxy); + + /*! + * @brief This function returns a constant reference to member entity_proxy + * @return Constant reference to member entity_proxy + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& entity_proxy() const; + + /*! + * @brief This function returns a reference to member entity_proxy + * @return Reference to member entity_proxy + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& entity_proxy(); + + + /*! + * @brief This function copies the value in member connection_list + * @param _connection_list New value to be copied in member connection_list + */ + eProsima_user_DllExport void connection_list( + const std::vector& _connection_list); + + /*! + * @brief This function moves the value in member connection_list + * @param _connection_list New value to be moved in member connection_list + */ + eProsima_user_DllExport void connection_list( + std::vector&& _connection_list); + + /*! + * @brief This function returns a constant reference to member connection_list + * @return Constant reference to member connection_list + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& connection_list() const; + + /*! + * @brief This function returns a reference to member connection_list + * @return Reference to member connection_list + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& connection_list(); + + + /*! + * @brief This function copies the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status); + + /*! + * @brief This function moves the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status); + + /*! + * @brief This function returns a constant reference to member incompatible_qos_status + * @return Constant reference to member incompatible_qos_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status() const; + + /*! + * @brief This function returns a reference to member incompatible_qos_status + * @return Reference to member incompatible_qos_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status(); + + + /*! + * @brief This function copies the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status); + + /*! + * @brief This function moves the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status); + + /*! + * @brief This function returns a constant reference to member inconsistent_topic_status + * @return Constant reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status() const; + + /*! + * @brief This function returns a reference to member inconsistent_topic_status + * @return Reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status(); + + + /*! + * @brief This function copies the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status); + + /*! + * @brief This function moves the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status); + + /*! + * @brief This function returns a constant reference to member liveliness_lost_status + * @return Constant reference to member liveliness_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status() const; + + /*! + * @brief This function returns a reference to member liveliness_lost_status + * @return Reference to member liveliness_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status(); + + + /*! + * @brief This function copies the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status); + + /*! + * @brief This function moves the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status); + + /*! + * @brief This function returns a constant reference to member liveliness_changed_status + * @return Constant reference to member liveliness_changed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status() const; + + /*! + * @brief This function returns a reference to member liveliness_changed_status + * @return Reference to member liveliness_changed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status(); + + + /*! + * @brief This function copies the value in member deadline_missed_status + * @param _deadline_missed_status New value to be copied in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status); + + /*! + * @brief This function moves the value in member deadline_missed_status + * @param _deadline_missed_status New value to be moved in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status); + + /*! + * @brief This function returns a constant reference to member deadline_missed_status + * @return Constant reference to member deadline_missed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status() const; + + /*! + * @brief This function returns a reference to member deadline_missed_status + * @return Reference to member deadline_missed_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status(); + + + /*! + * @brief This function copies the value in member sample_lost_status + * @param _sample_lost_status New value to be copied in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status); + + /*! + * @brief This function moves the value in member sample_lost_status + * @param _sample_lost_status New value to be moved in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status); + + /*! + * @brief This function returns a constant reference to member sample_lost_status + * @return Constant reference to member sample_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status() const; + + /*! + * @brief This function returns a reference to member sample_lost_status + * @return Reference to member sample_lost_status + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status(); + + + /*! + * @brief This function sets a value in member statuses_size + * @param _statuses_size New value for member statuses_size + */ + eProsima_user_DllExport void statuses_size( + uint8_t _statuses_size); + + /*! + * @brief This function returns the value of member statuses_size + * @return Value of member statuses_size + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t statuses_size() const; + + /*! + * @brief This function returns a reference to member statuses_size + * @return Reference to member statuses_size + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& statuses_size(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::MonitorServiceData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + + private: + + eprosima::fastdds::statistics::StatusKind m__d; + + std::vector m_entity_proxy; + std::vector m_connection_list; + eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status; + eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status; + eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status; + eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status; + eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status; + eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status; + uint8_t m_statuses_size; + }; + + + + /*! + * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class MonitorServiceStatusData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceStatusData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceStatusData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + const MonitorServiceStatusData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + const MonitorServiceStatusData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + MonitorServiceStatusData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceStatusData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceStatusData& x) const; + + /*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ + eProsima_user_DllExport void local_entity( + const eprosima::fastdds::statistics::detail::GUID_s& _local_entity); + + /*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ + eProsima_user_DllExport void local_entity( + eprosima::fastdds::statistics::detail::GUID_s&& _local_entity); + + /*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_entity() const; + + /*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_entity(); + + + /*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ + eProsima_user_DllExport void status_kind( + eprosima::fastdds::statistics::StatusKind _status_kind); + + /*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind status_kind() const; + + /*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ + eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& status_kind(); + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const eprosima::fastdds::statistics::MonitorServiceData& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + eprosima::fastdds::statistics::MonitorServiceData&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::MonitorServiceData& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport eprosima::fastdds::statistics::MonitorServiceData& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::MonitorServiceStatusData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_entity; + eprosima::fastdds::statistics::StatusKind m_status_kind; + eprosima::fastdds::statistics::MonitorServiceData m_value; + + }; + + } // namespace statistics + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/dds/communication/PublisherDynamic.cpp b/test/dds/communication/PublisherDynamic.cpp index ff0ee54b862..651f025a53d 100644 --- a/test/dds/communication/PublisherDynamic.cpp +++ b/test/dds/communication/PublisherDynamic.cpp @@ -33,7 +33,6 @@ #include #include #include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps; @@ -164,7 +163,6 @@ int main( int arg_count = 1; bool exit_on_lost_liveliness = false; uint32_t seed = 7800, wait = 0; - //char* xml_file = nullptr; uint32_t samples = 4; std::string magic; @@ -223,20 +221,12 @@ int main( return -1; } - //xml_file = argv[arg_count]; } ++arg_count; } - /* TODO - XMLProfileManager doesn't support DDS yet - if (xml_file) - { - DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_file); - } - */ - - xmlparser::XMLProfileManager::loadXMLFile("example_type_profile.xml"); + DomainParticipantFactory::get_instance()->load_XML_profiles_file("example_type_profile.xml"); DomainParticipantQos participant_qos; participant_qos.wire_protocol().builtin.typelookup_config.use_server = true; @@ -251,7 +241,16 @@ int main( return 1; } - types::DynamicType_ptr dyn_type = xmlparser::XMLProfileManager::getDynamicTypeByName("TypeLookup")->build(); + types::DynamicTypeBuilder* dyn_type_builder = nullptr; + if (ReturnCode_t::RETCODE_OK != + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("TypeLookup", + dyn_type_builder)) + { + std::cout << "Error getting dynamic type from XML file" << std::endl; + return 1; + } + + types::DynamicType_ptr dyn_type = dyn_type_builder->build(); TypeSupport type(new types::DynamicPubSubType(dyn_type)); type.register_type(participant); diff --git a/test/dds/communication/SubscriberDynamic.cpp b/test/dds/communication/SubscriberDynamic.cpp index aa7607f96c9..277f808d11d 100644 --- a/test/dds/communication/SubscriberDynamic.cpp +++ b/test/dds/communication/SubscriberDynamic.cpp @@ -248,19 +248,11 @@ int main( return -1; } - //xml_file = argv[arg_count]; } ++arg_count; } - /* TODO - XMLProfileManager doesn't support DDS yet - if(xml_file) - { - DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_file); - } - */ - ParListener participant_listener; DomainParticipant* participant = nullptr; diff --git a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp index 65bab00e4d2..bea0040319b 100644 --- a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp +++ b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp @@ -16,13 +16,11 @@ #define _FASTDDS_PARTICIPANTIMPL_HPP_ #include -#include #include #include #include #include -#include #include #include #include @@ -34,19 +32,21 @@ #include #include #include +#include #include -#include #include #include #include +#include #include #include -#include +#include #include #include #include #include +#include using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; diff --git a/test/mock/rtps/ExternalLocatorsProcessor/rtps/network/ExternalLocatorsProcessor.hpp b/test/mock/rtps/ExternalLocatorsProcessor/rtps/network/ExternalLocatorsProcessor.hpp index 4c90757691c..7ea976f4c21 100644 --- a/test/mock/rtps/ExternalLocatorsProcessor/rtps/network/ExternalLocatorsProcessor.hpp +++ b/test/mock/rtps/ExternalLocatorsProcessor/rtps/network/ExternalLocatorsProcessor.hpp @@ -88,6 +88,12 @@ void add_external_locators( { } +void add_external_locators( + LocatorList&, + const ExternalLocators&) +{ +} + /** * Filter the locators of a remote participant according to the matching algorithm. * diff --git a/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp b/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp index 3569092bd8b..af1cebca85b 100644 --- a/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp +++ b/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp @@ -17,6 +17,7 @@ #include +#include #include namespace eprosima { @@ -104,6 +105,18 @@ class RTPSDomainImpl return RTPSDomain::createParticipant(domain_id, enabled, att, listen); } + static bool get_library_settings( + fastdds::LibrarySettings&) + { + return true; + } + + static bool set_library_settings( + const fastdds::LibrarySettings&) + { + return true; + } + }; } // namespace rtps diff --git a/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h b/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h index c7519e902d7..cfa790847ad 100644 --- a/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h +++ b/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -245,6 +246,7 @@ class RTPS_DllAPI RTPSParticipant const GUID_t m_guid; mutable ResourceEvent mp_event_thr; RTPSParticipantAttributes attributes_; + RTPSParticipantImpl* mp_impl; }; } /* namespace rtps */ diff --git a/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h b/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h index cbe874cdeae..f9ec06ee23a 100644 --- a/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h +++ b/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h @@ -28,6 +28,7 @@ // Include first possible mocks (depending on include on CMakeLists.txt) #include #include +#include #include #include #include @@ -107,6 +108,27 @@ class RTPSParticipantImpl events_.init_thread(); } + RTPSParticipantImpl( + uint32_t, + const RTPSParticipantAttributes&, + const GuidPrefix_t&, + RTPSParticipant*, + RTPSParticipantListener*) + { + events_.init_thread(); + } + + RTPSParticipantImpl( + uint32_t, + const RTPSParticipantAttributes&, + const GuidPrefix_t&, + const GuidPrefix_t&, + RTPSParticipant*, + RTPSParticipantListener*) + { + events_.init_thread(); + } + MOCK_CONST_METHOD0(get_domain_id, uint32_t()); MOCK_CONST_METHOD0(getGuid, const GUID_t& ()); @@ -335,6 +357,72 @@ class RTPSParticipantImpl MOCK_METHOD(bool, update_removed_participant, (rtps::LocatorList_t&)); + uint32_t getRTPSParticipantID() const + { + return 0; + } + + bool is_initialized() const + { + return true; + } + + bool did_mutation_took_place_on_meta( + const LocatorList_t&, + const LocatorList_t&) const + { + return false; + } + + bool networkFactoryHasRegisteredTransports() const + { + return true; + } + + void environment_file_has_changed() + { + } + + void enable() + { + } + + void disable() + { + } + + bool create_writer( + RTPSWriter**, + WriterAttributes&, + const std::shared_ptr&, + const std::shared_ptr&, + WriterHistory*, + WriterListener*, + const EntityId_t& entityId = c_EntityId_Unknown, + bool isBuiltin = false) + { + static_cast(entityId); + static_cast(isBuiltin); + return true; + } + + void client_override( + bool) + { + } + + RTPSReader* find_local_reader( + const GUID_t&) + { + return nullptr; + } + + RTPSWriter* find_local_writer( + const GUID_t&) + { + return nullptr; + } + private: MockParticipantListener listener_; diff --git a/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h new file mode 100644 index 00000000000..0fdcf8598f7 --- /dev/null +++ b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h @@ -0,0 +1,91 @@ +// Copyright 2024 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 ServerAttributes.h + * + */ + +#ifndef _FASTDDS_SERVERATTRIBUTES_H_ +#define _FASTDDS_SERVERATTRIBUTES_H_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +class RemoteServerAttributes +{ +public: + + bool operator ==( + const RemoteServerAttributes&) const + { + return true; + } + + template bool requires_transport() const + { + return true; + } + + bool ReadguidPrefix( + const char*) + { + return true; + } + + LocatorList metatrafficMulticastLocatorList; + LocatorList metatrafficUnicastLocatorList; + +}; + +typedef std::list RemoteServerList_t; + +static inline bool load_environment_server_info( + RemoteServerList_t&) +{ + return true; +} + +static inline bool ros_super_client_env() +{ + return false; +} + +template +std::basic_ostream& operator <<( + std::basic_ostream& output, + const RemoteServerList_t& /*list*/) +{ + return output; +} + +} // namespace rtps +} // namespace fastdds + +namespace fastrtps { +namespace rtps { + +using fastdds::rtps::RemoteServerList_t; +using fastdds::rtps::ros_super_client_env; + +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima + +#endif /* _FASTDDS_SERVERATTRIBUTES_H_ */ diff --git a/test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h b/test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h similarity index 96% rename from test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h rename to test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h index b2167de2ef0..f3e698e932b 100644 --- a/test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h +++ b/test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h @@ -21,7 +21,7 @@ #define XMLENDPOINTPARSER_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h b/test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h similarity index 96% rename from test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h rename to test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h index e6f495de49f..d74348f2dfc 100644 --- a/test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h +++ b/test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h @@ -15,7 +15,7 @@ #ifndef XML_PROFILE_MANAGER_H_ #define XML_PROFILE_MANAGER_H_ -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index a4702334dc7..e6d3233a4e7 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -19,9 +19,8 @@ #include "LatencyTestPublisher.hpp" -#include - #include +#include #include #include #include @@ -36,8 +35,6 @@ #include #include #include -#include - #define TIME_LIMIT_US 10000 diff --git a/test/performance/latency/LatencyTestSubscriber.cpp b/test/performance/latency/LatencyTestSubscriber.cpp index 04dec847aed..1506d45b0be 100644 --- a/test/performance/latency/LatencyTestSubscriber.cpp +++ b/test/performance/latency/LatencyTestSubscriber.cpp @@ -31,7 +31,6 @@ #include #include #include -#include using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::types; diff --git a/test/performance/latency/main_LatencyTest.cpp b/test/performance/latency/main_LatencyTest.cpp index a1aa3f298ba..39693cc19e1 100644 --- a/test/performance/latency/main_LatencyTest.cpp +++ b/test/performance/latency/main_LatencyTest.cpp @@ -20,10 +20,9 @@ #include #include +#include #include #include -#include -#include #include "../optionarg.hpp" #include "LatencyTestPublisher.hpp" @@ -481,7 +480,7 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (xml_config_file.length() > 0) { - xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_config_file); } LatencyDataSizes data_sizes; diff --git a/test/performance/throughput/ThroughputPublisher.cpp b/test/performance/throughput/ThroughputPublisher.cpp index c0c8cda313e..b517cd53b7a 100644 --- a/test/performance/throughput/ThroughputPublisher.cpp +++ b/test/performance/throughput/ThroughputPublisher.cpp @@ -35,7 +35,6 @@ #include #include #include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; diff --git a/test/performance/throughput/ThroughputSubscriber.cpp b/test/performance/throughput/ThroughputSubscriber.cpp index 54554fb56bf..67112e56f83 100644 --- a/test/performance/throughput/ThroughputSubscriber.cpp +++ b/test/performance/throughput/ThroughputSubscriber.cpp @@ -33,7 +33,6 @@ #include #include #include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; diff --git a/test/performance/throughput/main_ThroughputTest.cpp b/test/performance/throughput/main_ThroughputTest.cpp index a5e6871c6d8..13713991514 100644 --- a/test/performance/throughput/main_ThroughputTest.cpp +++ b/test/performance/throughput/main_ThroughputTest.cpp @@ -18,8 +18,8 @@ #include #include +#include #include -#include #include "../optionarg.hpp" #include "ThroughputPublisher.hpp" @@ -455,7 +455,7 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (xml_config_file.length() > 0) { - xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_config_file); } uint8_t return_code = 0; diff --git a/test/performance/video/VideoTestPublisher.cpp b/test/performance/video/VideoTestPublisher.cpp index cc90cf43cab..67f47d1d7f6 100644 --- a/test/performance/video/VideoTestPublisher.cpp +++ b/test/performance/video/VideoTestPublisher.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #define TIME_LIMIT_US 10000 @@ -215,22 +214,6 @@ void VideoTestPublisher::init( // Create Data Publisher std::string profile_name = "publisher_profile"; -<<<<<<< HEAD -======= - PublisherAttributes PubDataparam; - - if (!reliable) - { - PubDataparam.qos.m_reliability.kind = BEST_EFFORT_RELIABILITY_QOS; - } - PubDataparam.properties = property_policy; - if (large_data) - { - PubDataparam.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - PubDataparam.qos.m_publishMode.kind = - eprosima::fastdds::dds::PublishModeQosPolicyKind::ASYNCHRONOUS_PUBLISH_MODE; - } ->>>>>>> 021566dac (Branch-out v3.0.0 (#4251)) if (m_sXMLConfigFile.length() > 0) { @@ -292,17 +275,7 @@ void VideoTestPublisher::init( { command_topic_name << asio::ip::host_name() << "_"; } -<<<<<<< HEAD command_topic_name << pid << "_PUB2SUB"; -======= - pct << pid << "_PUB2SUB"; - PubCommandParam.topic.topicName = pct.str(); - PubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - PubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - PubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; - PubCommandParam.qos.m_publishMode.kind = eprosima::fastdds::dds::PublishModeQosPolicyKind::SYNCHRONOUS_PUBLISH_MODE; - mp_commandpub = Domain::createPublisher(mp_participant, PubCommandParam, &this->m_commandpublistener); ->>>>>>> 021566dac (Branch-out v3.0.0 (#4251)) mp_command_pub_topic = mp_participant->create_topic(command_topic_name.str(), "TestCommandType", TOPIC_QOS_DEFAULT); diff --git a/test/performance/video/VideoTestSubscriber.cpp b/test/performance/video/VideoTestSubscriber.cpp index 744a53ae3b5..1217abf08f8 100644 --- a/test/performance/video/VideoTestSubscriber.cpp +++ b/test/performance/video/VideoTestSubscriber.cpp @@ -18,6 +18,8 @@ */ #include "VideoTestSubscriber.hpp" +#include "VideoTestSubscriber.hpp" + #include #include #include @@ -25,7 +27,6 @@ #include #include -#include #include using namespace eprosima; diff --git a/test/performance/video/main_VideoTest.cpp b/test/performance/video/main_VideoTest.cpp index 0cc360b7346..cf58c754886 100644 --- a/test/performance/video/main_VideoTest.cpp +++ b/test/performance/video/main_VideoTest.cpp @@ -20,9 +20,8 @@ #include #include +#include #include -#include -#include #include #include @@ -451,7 +450,6 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (sXMLConfigFile.length() > 0) { - // xmlparser::XMLProfileManager::loadXMLFile(sXMLConfigFile); DomainParticipantFactory::get_instance()->load_XML_profiles_file(sXMLConfigFile); } diff --git a/test/profiling/allocations/AllocTestPublisher.cpp b/test/profiling/allocations/AllocTestPublisher.cpp index 21658794645..c681f02e2b0 100644 --- a/test/profiling/allocations/AllocTestPublisher.cpp +++ b/test/profiling/allocations/AllocTestPublisher.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "AllocTestCommon.h" @@ -53,6 +52,7 @@ bool AllocTestPublisher::init( Domain::loadXMLProfilesFile("test_xml_profile.xml"); ParticipantAttributes participant_att; + // TODO(jlbueno): migrate to DomainParticipantFactory::get_participant_qos_from_profile if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK == eprosima::fastrtps::xmlparser::XMLProfileManager::fillParticipantAttributes("test_participant_profile", participant_att)) diff --git a/test/profiling/allocations/AllocTestSubscriber.cpp b/test/profiling/allocations/AllocTestSubscriber.cpp index f535dab9dc6..e1ab3198678 100644 --- a/test/profiling/allocations/AllocTestSubscriber.cpp +++ b/test/profiling/allocations/AllocTestSubscriber.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "AllocTestCommon.h" @@ -49,6 +48,7 @@ bool AllocTestSubscriber::init( Domain::loadXMLProfilesFile("test_xml_profile.xml"); ParticipantAttributes participant_att; + // TODO(jlbueno): migrate to DomainParticipantFactory::get_participant_qos_from_profile if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK == eprosima::fastrtps::xmlparser::XMLProfileManager::fillParticipantAttributes("test_participant_profile", participant_att)) diff --git a/test/profiling/main_MemoryTest.cpp b/test/profiling/main_MemoryTest.cpp index ebd1b64a67a..91431e3a752 100644 --- a/test/profiling/main_MemoryTest.cpp +++ b/test/profiling/main_MemoryTest.cpp @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include "MemoryTestPublisher.h" @@ -437,6 +435,7 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (sXMLConfigFile.length() > 0) { + // TODO(jlbueno): Migrate DomainParticipantFactory::load_XML_profiles_file xmlparser::XMLProfileManager::loadXMLFile(sXMLConfigFile); } diff --git a/test/realtime/UserThreadNonBlockedTest.cpp b/test/realtime/UserThreadNonBlockedTest.cpp index ca11e33aa04..f03716ade8a 100644 --- a/test/realtime/UserThreadNonBlockedTest.cpp +++ b/test/realtime/UserThreadNonBlockedTest.cpp @@ -12,10 +12,10 @@ #include #include #include +#include #include #include #include -#include #include #include "mutex_testing_tool/TMutex.hpp" @@ -133,9 +133,9 @@ class UserThreadNonBlockedTest : public ::testing::Test participant_qos_.transport().use_builtin_transports = false; datawriter_qos_.data_sharing().off(); datareader_qos_.data_sharing().off(); - eprosima::fastrtps::LibrarySettingsAttributes library_attributes; - library_attributes.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(library_attributes); + eprosima::fastdds::LibrarySettings library_attributes; + library_attributes.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_attributes); datareader_qos_.reliable_reader_qos().times.initialAcknackDelay.seconds = 10; datareader_qos_.reliable_reader_qos().times.heartbeatResponseDelay.seconds = 10; diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index ed3d395edd1..0ee79a22ad0 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -14,36 +14,37 @@ add_compile_definitions(FASTDDS_NO_LIB) -add_subdirectory(rtps/attributes) -add_subdirectory(rtps/common) -add_subdirectory(rtps/DataSharing) -add_subdirectory(rtps/builtin) -add_subdirectory(rtps/reader) -add_subdirectory(rtps/writer) -add_subdirectory(rtps/history) -add_subdirectory(rtps/resources/timedevent) -add_subdirectory(rtps/network) -if(NOT QNX) - add_subdirectory(rtps/flowcontrol) -endif() -add_subdirectory(rtps/persistence) -add_subdirectory(rtps/discovery) +add_subdirectory(cmake) add_subdirectory(dds/collections) add_subdirectory(dds/core) add_subdirectory(dds/participant) add_subdirectory(dds/publisher) +add_subdirectory(dds/status) add_subdirectory(dds/subscriber) add_subdirectory(dds/topic) add_subdirectory(dds/topic/DDSSQLFilter) -add_subdirectory(dds/status) add_subdirectory(dynamic_types) -add_subdirectory(transport) add_subdirectory(logging) +add_subdirectory(rtps/attributes) +add_subdirectory(rtps/builtin) +add_subdirectory(rtps/common) +add_subdirectory(rtps/DataSharing) +add_subdirectory(rtps/discovery) +add_subdirectory(rtps/domain) +if(NOT QNX) + add_subdirectory(rtps/flowcontrol) +endif() +add_subdirectory(rtps/history) +add_subdirectory(rtps/network) +add_subdirectory(rtps/persistence) +add_subdirectory(rtps/reader) +add_subdirectory(rtps/resources/timedevent) +add_subdirectory(rtps/writer) +add_subdirectory(statistics/dds) +add_subdirectory(transport) add_subdirectory(utils) add_subdirectory(xmlparser) add_subdirectory(xtypes) -add_subdirectory(statistics/dds) -add_subdirectory(cmake) if(SECURITY) add_subdirectory(security/authentication) diff --git a/test/unittest/dds/participant/ParticipantTests.cpp b/test/unittest/dds/participant/ParticipantTests.cpp index 5ddb37d6aa9..ac40edfbfc3 100644 --- a/test/unittest/dds/participant/ParticipantTests.cpp +++ b/test/unittest/dds/participant/ParticipantTests.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -50,12 +51,13 @@ #include #include #include +#include +#include #include #include #include #include #include -#include #include #include @@ -85,8 +87,6 @@ using fastrtps::types::DynamicType_ptr; using fastrtps::types::DynamicTypeBuilder_ptr; using fastrtps::types::DynamicTypeBuilderFactory; using fastrtps::types::TypeDescriptor; -using fastrtps::xmlparser::XMLP_ret; -using fastrtps::xmlparser::XMLProfileManager; // Mocked TopicDataType for Topic creation tests class TopicDataTypeMock : public TopicDataType @@ -365,6 +365,91 @@ TEST(ParticipantTests, ChangeDomainParticipantFactoryQos) ASSERT_EQ(fqos.entity_factory().autoenable_created_entities, true); } +TEST(ParticipantTests, DomainParticipantFactoryLibrarySettings) +{ + // Disable entities autoenabling + DomainParticipantFactoryQos qos; + qos.entity_factory().autoenable_created_entities = false; + ASSERT_EQ(DomainParticipantFactory::get_instance()->set_qos(qos), ReturnCode_t::RETCODE_OK); + + eprosima::fastdds::LibrarySettings library_settings; + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + // Get LibrarySettings default values +#if HAVE_STRICT_REALTIME + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); +#else + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +#endif // if HAVE_STRICT_REALTIME + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY; + // Setting the library settings within an empty DomainParticipantFactory shall return true + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Create DomainParticipant + DomainParticipant* participant = + DomainParticipantFactory::get_instance()->create_participant(0, PARTICIPANT_QOS_DEFAULT); + ASSERT_NE(nullptr, participant); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with any disabled DomainParticipant shall succeed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + // Operation shall fail if there is any enabled DomainParticipant + EXPECT_EQ(participant->enable(), ReturnCode_t::RETCODE_OK); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + // Setting LibrarySettings with any disabled DomainParticipant shall succeed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + // Remove DomainParticipant + EXPECT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), + ReturnCode_t::RETCODE_OK); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + // Setting LibrarySettings with no participants shall suceed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +} + +TEST(ParticipantTests, DomainParticipantFactoryGetDynamicTypeBuilder) +{ + fastrtps::types::DynamicTypeBuilder* type = nullptr; + std::string type_name("MyAloneEnumType"); + // Trying to get a Dynamic Type with empty name returns RETCODE_BAD_PARAMETER + EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(std::string(), type)); + // Trying to get an unknown Dynamic Type return RETCODE_NO_DATA + EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(type_name, type)); + EXPECT_EQ(nullptr, type); + // Load XML file + std::string xml = + "\ + \ + \ + \ + \ + \ + \ + \ + \ + "; + DomainParticipantFactory::get_instance()->load_XML_profiles_string(xml.c_str(), xml.length()); + // Getting a known dynamic type returns RETCODE_OK + EXPECT_EQ(ReturnCode_t::RETCODE_OK, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(type_name, type)); + EXPECT_NE(nullptr, type); +} + TEST(ParticipantTests, CreateDomainParticipant) { DomainParticipant* participant = @@ -414,35 +499,10 @@ void check_participant_with_profile ( DomainParticipantQos qos; participant->get_qos(qos); - ParticipantAttributes participant_atts; - XMLProfileManager::fillParticipantAttributes(profile_name, participant_atts); - - /* Values taken from profile */ - ASSERT_TRUE(qos.allocation() == participant_atts.rtps.allocation); - // Check that all the non-binary properties in participant_atts are present (by name) in qos - for (auto property : participant_atts.rtps.properties.properties()) - { - ASSERT_NE(nullptr, fastrtps::rtps::PropertyPolicyHelper::find_property(qos.properties(), property.name())); - } - ASSERT_TRUE(qos.properties().binary_properties() == participant_atts.rtps.properties.binary_properties()); - ASSERT_TRUE(qos.name().to_string() == participant_atts.rtps.getName()); - ASSERT_TRUE(qos.wire_protocol().prefix == participant_atts.rtps.prefix); - ASSERT_TRUE(qos.wire_protocol().participant_id == participant_atts.rtps.participantID); - ASSERT_TRUE(qos.wire_protocol().builtin == participant_atts.rtps.builtin); - ASSERT_TRUE(qos.wire_protocol().port == participant_atts.rtps.port); - ASSERT_TRUE(qos.wire_protocol().throughput_controller == participant_atts.rtps.throughputController); - ASSERT_TRUE(qos.wire_protocol().default_unicast_locator_list == - participant_atts.rtps.defaultUnicastLocatorList); - ASSERT_TRUE(qos.wire_protocol().default_multicast_locator_list == - participant_atts.rtps.defaultMulticastLocatorList); - ASSERT_TRUE(qos.transport().user_transports == participant_atts.rtps.userTransports); - ASSERT_TRUE(qos.transport().use_builtin_transports == participant_atts.rtps.useBuiltinTransports); - ASSERT_TRUE(qos.transport().send_socket_buffer_size == participant_atts.rtps.sendSocketBufferSize); - ASSERT_TRUE(qos.transport().listen_socket_buffer_size == participant_atts.rtps.listenSocketBufferSize); - ASSERT_TRUE(qos.user_data().data_vec() == participant_atts.rtps.userData); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == PARTICIPANT_QOS_DEFAULT.entity_factory()); + DomainParticipantQos profile_qos; + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + check_equivalent_qos(qos, profile_qos); } /** @@ -1727,16 +1787,10 @@ void check_publisher_with_profile ( PublisherQos qos; publisher->get_qos(qos); - PublisherAttributes publisher_atts; - XMLProfileManager::fillPublisherAttributes(profile_name, publisher_atts); - - //Values taken from profile - ASSERT_TRUE(qos.group_data().dataVec() == publisher_atts.qos.m_groupData.dataVec()); - ASSERT_TRUE(qos.partition() == publisher_atts.qos.m_partition); - ASSERT_TRUE(qos.presentation() == publisher_atts.qos.m_presentation); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == PUBLISHER_QOS_DEFAULT.entity_factory()); + PublisherQos profile_qos; + EXPECT_EQ(publisher->get_participant()->get_publisher_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, CreatePublisherWithProfile) @@ -1807,16 +1861,10 @@ void check_subscriber_with_profile ( SubscriberQos qos; subscriber->get_qos(qos); - SubscriberAttributes subscriber_atts; - XMLProfileManager::fillSubscriberAttributes(profile_name, subscriber_atts); - - //Values taken from profile - ASSERT_TRUE(qos.group_data().dataVec() == subscriber_atts.qos.m_groupData.dataVec()); - ASSERT_TRUE(qos.partition() == subscriber_atts.qos.m_partition); - ASSERT_TRUE(qos.presentation() == subscriber_atts.qos.m_presentation); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == SUBSCRIBER_QOS_DEFAULT.entity_factory()); + SubscriberQos profile_qos; + EXPECT_EQ(subscriber->get_participant()->get_subscriber_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, GetSubscriberProfileQos) @@ -1988,12 +2036,10 @@ void check_topic_with_profile ( TopicQos qos; topic->get_qos(qos); - TopicAttributesQos topic_atts; - XMLProfileManager::fillTopicAttributes(profile_name, topic_atts); - - //Values taken from profile - ASSERT_TRUE(qos.history() == topic_atts.historyQos); - ASSERT_TRUE(qos.resource_limits() == topic_atts.resourceLimitsQos); + TopicQos profile_qos; + EXPECT_EQ(topic->get_participant()->get_topic_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, GetTopicProfileQos) diff --git a/test/unittest/dds/publisher/CMakeLists.txt b/test/unittest/dds/publisher/CMakeLists.txt index 4ef1f57c769..f6db3c424fc 100644 --- a/test/unittest/dds/publisher/CMakeLists.txt +++ b/test/unittest/dds/publisher/CMakeLists.txt @@ -192,12 +192,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -206,6 +200,12 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) if(SQLITE3_SUPPORT) diff --git a/test/unittest/dds/publisher/PublisherTests.cpp b/test/unittest/dds/publisher/PublisherTests.cpp index ea31b20358b..7d172e9dd21 100644 --- a/test/unittest/dds/publisher/PublisherTests.cpp +++ b/test/unittest/dds/publisher/PublisherTests.cpp @@ -24,17 +24,12 @@ #include #include #include -#include -#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::PublisherAttributes; using fastrtps::rtps::PropertyPolicyHelper; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; class TopicDataTypeMock : public TopicDataType { @@ -479,54 +474,10 @@ void check_datawriter_with_profile ( DataWriterQos qos; datawriter->get_qos(qos); - PublisherAttributes publisher_atts; - XMLProfileManager::fillPublisherAttributes(profile_name, publisher_atts); - - //Values taken from profile - ASSERT_TRUE( - qos.writer_resource_limits().matched_subscriber_allocation == - publisher_atts.matched_subscriber_allocation); - if (publisher_atts.qos.m_partition.names().empty()) - { - ASSERT_TRUE(qos.properties() == publisher_atts.properties); - } - else - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions"), nullptr); - for (auto partition: publisher_atts.qos.m_partition.names()) - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions")->find( - partition), std::string::npos); - } - } - ASSERT_TRUE(qos.throughput_controller() == publisher_atts.throughputController); - ASSERT_TRUE(qos.endpoint().unicast_locator_list == publisher_atts.unicastLocatorList); - ASSERT_TRUE(qos.endpoint().multicast_locator_list == publisher_atts.multicastLocatorList); - ASSERT_TRUE(qos.endpoint().remote_locator_list == publisher_atts.remoteLocatorList); - ASSERT_TRUE(qos.endpoint().history_memory_policy == publisher_atts.historyMemoryPolicy); - ASSERT_TRUE(qos.endpoint().user_defined_id == publisher_atts.getUserDefinedID()); - ASSERT_TRUE(qos.endpoint().entity_id == publisher_atts.getEntityID()); - ASSERT_TRUE(qos.reliable_writer_qos().times == publisher_atts.times); - ASSERT_TRUE(qos.reliable_writer_qos().disable_positive_acks == publisher_atts.qos.m_disablePositiveACKs); - ASSERT_TRUE(qos.durability() == publisher_atts.qos.m_durability); - ASSERT_TRUE(qos.durability_service() == publisher_atts.qos.m_durabilityService); - ASSERT_TRUE(qos.deadline() == publisher_atts.qos.m_deadline); - ASSERT_TRUE(qos.latency_budget() == publisher_atts.qos.m_latencyBudget); - ASSERT_TRUE(qos.liveliness() == publisher_atts.qos.m_liveliness); - ASSERT_TRUE(qos.reliability() == publisher_atts.qos.m_reliability); - ASSERT_TRUE(qos.lifespan() == publisher_atts.qos.m_lifespan); - ASSERT_TRUE(qos.user_data().data_vec() == publisher_atts.qos.m_userData.data_vec()); - ASSERT_TRUE(qos.ownership() == publisher_atts.qos.m_ownership); - ASSERT_TRUE(qos.ownership_strength() == publisher_atts.qos.m_ownershipStrength); - ASSERT_TRUE(qos.destination_order() == publisher_atts.qos.m_destinationOrder); - ASSERT_TRUE(qos.representation() == publisher_atts.qos.representation); - ASSERT_TRUE(qos.publish_mode() == publisher_atts.qos.m_publishMode); - ASSERT_TRUE(qos.history() == publisher_atts.topic.historyQos); - ASSERT_TRUE(qos.resource_limits() == publisher_atts.topic.resourceLimitsQos); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.transport_priority() == DATAWRITER_QOS_DEFAULT.transport_priority()); - ASSERT_TRUE(qos.writer_data_lifecycle() == DATAWRITER_QOS_DEFAULT.writer_data_lifecycle()); + DataWriterQos profile_qos; + EXPECT_EQ(datawriter->get_publisher()->get_datawriter_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(PublisherTests, CreateDataWriterWithProfile) diff --git a/test/unittest/dds/status/CMakeLists.txt b/test/unittest/dds/status/CMakeLists.txt index 00f64c70ebc..9957719d171 100644 --- a/test/unittest/dds/status/CMakeLists.txt +++ b/test/unittest/dds/status/CMakeLists.txt @@ -93,11 +93,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp @@ -107,6 +102,11 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) if (FASTDDS_STATISTICS) diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index 9bc929a9fa0..3cc5db6f917 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -24,12 +24,11 @@ #include #include - #include #include -#include - +#include "fastdds/dds/common/InstanceHandle.hpp" +#include "fastdds/dds/core/policy/QosPolicies.hpp" #include #include #include @@ -54,15 +53,13 @@ #include #include #include +#include #include #include #include -#include #include "../../common/CustomPayloadPool.hpp" #include "../../logging/mock/MockConsumer.h" -#include "fastdds/dds/common/InstanceHandle.hpp" -#include "fastdds/dds/core/policy/QosPolicies.hpp" #include "FooBoundedType.hpp" #include "FooBoundedTypeSupport.hpp" #include "FooType.hpp" @@ -2660,9 +2657,9 @@ TEST_F(DataReaderUnsupportedTests, UnsupportedDataReaderMethods) // Regression test for #12133. TEST_F(DataReaderTests, read_samples_with_future_changes) { - eprosima::fastrtps::LibrarySettingsAttributes att; - att.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + DomainParticipantFactory::get_instance()->set_library_settings(att); static constexpr int32_t num_samples = 8; static constexpr int32_t expected_samples = 4; const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; diff --git a/test/unittest/dds/subscriber/SubscriberTests.cpp b/test/unittest/dds/subscriber/SubscriberTests.cpp index 622cac24584..542a0df7c0d 100644 --- a/test/unittest/dds/subscriber/SubscriberTests.cpp +++ b/test/unittest/dds/subscriber/SubscriberTests.cpp @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include #include -#include - #include #include #include @@ -29,18 +28,12 @@ #include #include #include -#include -#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::SubscriberAttributes; using fastrtps::rtps::PropertyPolicyHelper; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; - class FooType { @@ -535,53 +528,10 @@ void check_datareader_with_profile ( DataReaderQos qos; datareader->get_qos(qos); - SubscriberAttributes subscriber_atts; - XMLProfileManager::fillSubscriberAttributes(profile_name, subscriber_atts); - - //Values taken from profile - ASSERT_TRUE( - qos.reader_resource_limits().matched_publisher_allocation == - subscriber_atts.matched_publisher_allocation); - if (subscriber_atts.qos.m_partition.names().empty()) - { - ASSERT_TRUE(qos.properties() == subscriber_atts.properties); - } - else - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions"), nullptr); - for (auto partition: subscriber_atts.qos.m_partition.names()) - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions")->find( - partition), std::string::npos); - } - } - ASSERT_TRUE(qos.expects_inline_qos() == subscriber_atts.expectsInlineQos); - ASSERT_TRUE(qos.endpoint().unicast_locator_list == subscriber_atts.unicastLocatorList); - ASSERT_TRUE(qos.endpoint().multicast_locator_list == subscriber_atts.multicastLocatorList); - ASSERT_TRUE(qos.endpoint().remote_locator_list == subscriber_atts.remoteLocatorList); - ASSERT_TRUE(qos.endpoint().history_memory_policy == subscriber_atts.historyMemoryPolicy); - ASSERT_TRUE(qos.endpoint().user_defined_id == subscriber_atts.getUserDefinedID()); - ASSERT_TRUE(qos.endpoint().entity_id == subscriber_atts.getEntityID()); - ASSERT_TRUE(qos.reliable_reader_qos().times == subscriber_atts.times); - ASSERT_TRUE(qos.reliable_reader_qos().disable_positive_ACKs == subscriber_atts.qos.m_disablePositiveACKs); - ASSERT_TRUE(qos.durability() == subscriber_atts.qos.m_durability); - ASSERT_TRUE(qos.durability_service() == subscriber_atts.qos.m_durabilityService); - ASSERT_TRUE(qos.deadline() == subscriber_atts.qos.m_deadline); - ASSERT_TRUE(qos.latency_budget() == subscriber_atts.qos.m_latencyBudget); - ASSERT_TRUE(qos.liveliness() == subscriber_atts.qos.m_liveliness); - ASSERT_TRUE(qos.reliability() == subscriber_atts.qos.m_reliability); - ASSERT_TRUE(qos.lifespan() == subscriber_atts.qos.m_lifespan); - ASSERT_TRUE(qos.user_data().data_vec() == subscriber_atts.qos.m_userData.data_vec()); - ASSERT_TRUE(qos.ownership() == subscriber_atts.qos.m_ownership); - ASSERT_TRUE(qos.destination_order() == subscriber_atts.qos.m_destinationOrder); - ASSERT_TRUE(qos.type_consistency().type_consistency == subscriber_atts.qos.type_consistency); - ASSERT_TRUE(qos.type_consistency().representation == subscriber_atts.qos.representation); - ASSERT_TRUE(qos.time_based_filter() == subscriber_atts.qos.m_timeBasedFilter); - ASSERT_TRUE(qos.history() == subscriber_atts.topic.historyQos); - ASSERT_TRUE(qos.resource_limits() == subscriber_atts.topic.resourceLimitsQos); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.reader_data_lifecycle() == DATAREADER_QOS_DEFAULT.reader_data_lifecycle()); + DataReaderQos profile_qos; + EXPECT_EQ(datareader->get_subscriber()->get_datareader_qos_from_profile(profile_name, profile_qos), + ReturnCode_t::RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(SubscriberTests, CreateDataReaderWithProfile) diff --git a/test/unittest/dds/topic/TopicTests.cpp b/test/unittest/dds/topic/TopicTests.cpp index c72b3f19703..36cf8501b48 100644 --- a/test/unittest/dds/topic/TopicTests.cpp +++ b/test/unittest/dds/topic/TopicTests.cpp @@ -22,18 +22,11 @@ #include #include #include -#include -#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::TopicAttributes; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; - - class FooType { public: diff --git a/test/unittest/dynamic_types/CMakeLists.txt b/test/unittest/dynamic_types/CMakeLists.txt index 9db6cde841a..7245be60d50 100644 --- a/test/unittest/dynamic_types/CMakeLists.txt +++ b/test/unittest/dynamic_types/CMakeLists.txt @@ -84,12 +84,12 @@ set(DYNAMIC_TYPES_TEST_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE diff --git a/test/unittest/dynamic_types/DynamicTypesTests.cpp b/test/unittest/dynamic_types/DynamicTypesTests.cpp index 41729254ecd..8ed45742679 100644 --- a/test/unittest/dynamic_types/DynamicTypesTests.cpp +++ b/test/unittest/dynamic_types/DynamicTypesTests.cpp @@ -12,25 +12,28 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include -#include -#include -#include +#include + +#include +#include #include -#include -#include -#include +#include #include +#include +#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include +#include + +#include + #include "idl/BasicPubSubTypes.h" #include "idl/BasicTypeObject.h" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/test/unittest/rtps/domain/CMakeLists.txt b/test/unittest/rtps/domain/CMakeLists.txt new file mode 100644 index 00000000000..c6253245c05 --- /dev/null +++ b/test/unittest/rtps/domain/CMakeLists.txt @@ -0,0 +1,67 @@ +# Copyright 2024 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. + +set(RTPS_DOMAIN_TESTS_EXEC RTPSDomainTests) + +file(GLOB RTPS_DOMAIN_TESTS_SOURCE + RTPSDomainTests.cpp + ) + +# External sources +if(TINYXML2_SOURCE_DIR) + list(APPEND RTPS_DOMAIN_TESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ) +endif() + +if(TINYXML2_INCLUDE_DIR) + include_directories(${TINYXML2_INCLUDE_DIR}) +endif(TINYXML2_INCLUDE_DIR) + +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) +endif() + +add_executable( + ${RTPS_DOMAIN_TESTS_EXEC} + ${RTPS_DOMAIN_TESTS_SOURCE} + ) + +target_compile_definitions(${RTPS_DOMAIN_TESTS_EXEC} PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + +target_include_directories( + ${RTPS_DOMAIN_TESTS_EXEC} + PRIVATE + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ${Asio_INCLUDE_DIR} + ) + +target_link_libraries( + ${RTPS_DOMAIN_TESTS_EXEC} + GTest::gmock + ${CMAKE_DL_LIBS} + fastcdr + fastdds + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ${TINYXML2_LIBRARY} + ) + +gtest_discover_tests(${RTPS_DOMAIN_TESTS_EXEC}) diff --git a/test/unittest/rtps/domain/RTPSDomainTests.cpp b/test/unittest/rtps/domain/RTPSDomainTests.cpp new file mode 100644 index 00000000000..806617f5275 --- /dev/null +++ b/test/unittest/rtps/domain/RTPSDomainTests.cpp @@ -0,0 +1,107 @@ +// Copyright 2024 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. + +#include + +#include +#include +#include + +/** + * This test checks the getter and setter for the library settings in the RTPS layer. + */ +TEST(RTPSDomainTests, library_settings_test) +{ + eprosima::fastdds::LibrarySettings library_settings; + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + // Get LibrarySettings default values +#if HAVE_STRICT_REALTIME + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); +#else + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +#endif // if HAVE_STRICT_REALTIME + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY; + // Setting the library settings within an empty RTPSDomain shall return true + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Create RTPSParticipant + eprosima::fastrtps::rtps::RTPSParticipantAttributes part_attr; + eprosima::fastrtps::rtps::RTPSParticipant* participant = + eprosima::fastrtps::rtps::RTPSDomain::createParticipant(0, part_attr); + ASSERT_NE(nullptr, participant); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with any RTPSParticipant shall fail + EXPECT_FALSE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Remove RTPSParticipant + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::removeRTPSParticipant(participant)); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with no participants shall suceed + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + eprosima::fastrtps::rtps::RTPSDomain::stopAll(); +} + +/** + * This test checks get_topic_attributes_from_profile API. + */ +TEST(RTPSDomainTests, get_topic_attributes_from_profile_test) +{ + std::string profile_name = "test_profile_name"; + eprosima::fastrtps::TopicAttributes topic_att; + EXPECT_FALSE(eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(profile_name, topic_att)); + + const std::string xml = + R"( + + Test + DataTest + + KEEP_LAST + 20 + + + 5 + 2 + 1 + 20 + 10 + + +)"; + + EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_string(xml.c_str(), + xml.length()), ReturnCode_t::RETCODE_OK); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(profile_name, topic_att)); + EXPECT_EQ(topic_att.topicName, "Test"); + EXPECT_EQ(topic_att.topicDataType, "DataTest"); + EXPECT_EQ(topic_att.historyQos.kind, eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS); + EXPECT_EQ(topic_att.historyQos.depth, 20); + EXPECT_EQ(topic_att.resourceLimitsQos.max_samples, 5); + EXPECT_EQ(topic_att.resourceLimitsQos.max_instances, 2); + EXPECT_EQ(topic_att.resourceLimitsQos.max_samples_per_instance, 1); + EXPECT_EQ(topic_att.resourceLimitsQos.allocated_samples, 20); + EXPECT_EQ(topic_att.resourceLimitsQos.extra_samples, 10); +} + +int main( + int argc, + char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/unittest/statistics/dds/CMakeLists.txt b/test/unittest/statistics/dds/CMakeLists.txt index e9141e31a07..291170331d0 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -267,27 +267,21 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -296,6 +290,12 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) set(STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE @@ -460,28 +460,21 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -490,6 +483,12 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # SHM Transport diff --git a/test/unittest/statistics/dds/StatisticsQosTests.cpp b/test/unittest/statistics/dds/StatisticsQosTests.cpp index 93d930ebe77..f10abe591a6 100644 --- a/test/unittest/statistics/dds/StatisticsQosTests.cpp +++ b/test/unittest/statistics/dds/StatisticsQosTests.cpp @@ -15,7 +15,6 @@ #include #include - #include #include @@ -29,7 +28,6 @@ #include #include #include -#include #ifdef FASTDDS_STATISTICS #include diff --git a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp index 111f5a6d41c..126cf587f3a 100644 --- a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp +++ b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -41,9 +42,7 @@ #include #include #include -#include #include -#include #include #include @@ -51,6 +50,7 @@ #include #include #include +#include namespace eprosima { namespace fastdds { @@ -466,9 +466,9 @@ class RTPSStatisticsTests using namespace fastrtps; // Intraprocess must be disable in order to receive DATA callbacks - LibrarySettingsAttributes att; + LibrarySettings att; att.intraprocess_delivery = INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(att); + fastrtps::rtps::RTPSDomain::set_library_settings(att); create_participant(); } diff --git a/test/unittest/transport/UDPv4Tests.cpp b/test/unittest/transport/UDPv4Tests.cpp index 5e88c26686c..5af38d684ed 100644 --- a/test/unittest/transport/UDPv4Tests.cpp +++ b/test/unittest/transport/UDPv4Tests.cpp @@ -467,9 +467,9 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast) if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -529,9 +529,9 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); diff --git a/test/unittest/transport/UDPv6Tests.cpp b/test/unittest/transport/UDPv6Tests.cpp index 7553b97e3cb..9a8eb1939e2 100644 --- a/test/unittest/transport/UDPv6Tests.cpp +++ b/test/unittest/transport/UDPv6Tests.cpp @@ -508,9 +508,9 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast) if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -570,9 +570,9 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); diff --git a/test/unittest/xmlparser/CMakeLists.txt b/test/unittest/xmlparser/CMakeLists.txt index 96166c56af2..3746223e74a 100644 --- a/test/unittest/xmlparser/CMakeLists.txt +++ b/test/unittest/xmlparser/CMakeLists.txt @@ -108,17 +108,17 @@ set(XMLPROFILEPARSER_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # External sources @@ -217,17 +217,17 @@ set(XMLPARSER_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # External sources @@ -302,6 +302,7 @@ target_compile_definitions(XMLTreeTests PRIVATE target_include_directories(XMLTreeTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) @@ -350,12 +351,12 @@ set(XMLENDPOINTPARSERTESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp # locators ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp diff --git a/test/unittest/xmlparser/XMLElementParserTests.cpp b/test/unittest/xmlparser/XMLElementParserTests.cpp index 3f9bf02e258..7524604a42f 100644 --- a/test/unittest/xmlparser/XMLElementParserTests.cpp +++ b/test/unittest/xmlparser/XMLElementParserTests.cpp @@ -25,15 +25,17 @@ #include #include +#include #include #include -#include -#include -#include + +#include +#include +#include #include "../common/env_var_utils.hpp" #include "../logging/mock/MockConsumer.h" -#include "rtps/xmlparser/XMLParserUtils.hpp" +#include "xmlparser/XMLParserUtils.hpp" #include "wrapper/XMLParserTest.hpp" using namespace eprosima::fastdds::dds; @@ -3374,7 +3376,7 @@ TEST_F(XMLParserTests, getXMLEnum_NegativeClauses) // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ \ @@ -3475,7 +3477,7 @@ TEST_F(XMLParserTests, getXMLEnum_positive) // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ OFF\ @@ -3485,12 +3487,12 @@ TEST_F(XMLParserTests, getXMLEnum_positive) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(enum_p)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLEnum_wrapper(titleElement, &e, ident)); - EXPECT_EQ(IntraprocessDeliveryType::INTRAPROCESS_OFF, e); + EXPECT_EQ(eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF, e); } // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ USER_DATA_ONLY\ @@ -3500,7 +3502,7 @@ TEST_F(XMLParserTests, getXMLEnum_positive) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(enum_p)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLEnum_wrapper(titleElement, &e, ident)); - EXPECT_EQ(IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, e); + EXPECT_EQ(eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, e); } // DiscoveryProtocol Enum diff --git a/test/unittest/xmlparser/XMLEndpointParserTests.cpp b/test/unittest/xmlparser/XMLEndpointParserTests.cpp index c031b92a9a5..c92dbed8d23 100644 --- a/test/unittest/xmlparser/XMLEndpointParserTests.cpp +++ b/test/unittest/xmlparser/XMLEndpointParserTests.cpp @@ -26,7 +26,8 @@ #include #include #include -#include + +#include #include "../logging/mock/MockConsumer.h" diff --git a/test/unittest/xmlparser/XMLParserTests.cpp b/test/unittest/xmlparser/XMLParserTests.cpp index a80e5839796..22f84e452cf 100644 --- a/test/unittest/xmlparser/XMLParserTests.cpp +++ b/test/unittest/xmlparser/XMLParserTests.cpp @@ -33,9 +33,10 @@ #include #include #include -#include -#include -#include + +#include +#include +#include #include "../logging/mock/MockConsumer.h" #include "wrapper/XMLParserTest.hpp" diff --git a/test/unittest/xmlparser/XMLParserTests.hpp b/test/unittest/xmlparser/XMLParserTests.hpp index 5791f15e288..7050bcf5f31 100644 --- a/test/unittest/xmlparser/XMLParserTests.hpp +++ b/test/unittest/xmlparser/XMLParserTests.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include -#include #include -#include +#include #include "../logging/mock/MockConsumer.h" - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::xmlparser; diff --git a/test/unittest/xmlparser/XMLProfileParserTests.cpp b/test/unittest/xmlparser/XMLProfileParserTests.cpp index 32326bace56..48ce7da1b03 100644 --- a/test/unittest/xmlparser/XMLProfileParserTests.cpp +++ b/test/unittest/xmlparser/XMLProfileParserTests.cpp @@ -28,11 +28,13 @@ #include #include #include +#include #include #include #include #include -#include + +#include #include "../common/env_var_utils.hpp" @@ -327,8 +329,9 @@ TEST_F(XMLProfileParserBasicTests, XMLParserRootLibrarySettings) ASSERT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::loadXMLFile("test_xml_root_library_settings_profile.xml")); - const LibrarySettingsAttributes& library_settings = xmlparser::XMLProfileManager::library_settings(); - EXPECT_EQ(library_settings.intraprocess_delivery, IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY); + const eprosima::fastdds::LibrarySettings& library_settings = xmlparser::XMLProfileManager::library_settings(); + EXPECT_EQ(library_settings.intraprocess_delivery, + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY); } TEST_F(XMLProfileParserBasicTests, XMLoadProfiles) @@ -453,8 +456,8 @@ TEST_P(XMLProfileParserTests, XMLParserLibrarySettings) ASSERT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::loadXMLFile(xml_filename_)); - const LibrarySettingsAttributes& library_settings = xmlparser::XMLProfileManager::library_settings(); - EXPECT_EQ(library_settings.intraprocess_delivery, IntraprocessDeliveryType::INTRAPROCESS_FULL); + const eprosima::fastdds::LibrarySettings& library_settings = xmlparser::XMLProfileManager::library_settings(); + EXPECT_EQ(library_settings.intraprocess_delivery, eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL); } /* diff --git a/test/unittest/xmlparser/XMLTreeTests.cpp b/test/unittest/xmlparser/XMLTreeTests.cpp index 035e7fa4e24..2bdcd23f13a 100644 --- a/test/unittest/xmlparser/XMLTreeTests.cpp +++ b/test/unittest/xmlparser/XMLTreeTests.cpp @@ -1,7 +1,21 @@ -#include +// Copyright 2020 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. + +#include -#include #include +#include #include diff --git a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp index 3372b20b638..de9f2259256 100644 --- a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp +++ b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp @@ -13,9 +13,11 @@ // limitations under the License. #include +#include #include #include -#include + +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -412,7 +414,7 @@ class XMLParserTest : public XMLParser static XMLP_ret getXMLEnum_wrapper( tinyxml2::XMLElement* elem, - IntraprocessDeliveryType* e, + eprosima::fastdds::IntraprocessDeliveryType* e, uint8_t ident) { return getXMLEnum(elem, e, ident); diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 580b9ce1737..dab314d8861 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -34,7 +34,6 @@ #include #include #include -#include volatile sig_atomic_t g_signal_status = 0; std::mutex g_signal_mutex; @@ -137,8 +136,8 @@ int fastdds_discovery_server( return 1; } #else - if (0 != unsetenv(fastrtps::xmlparser::DEFAULT_FASTDDS_ENV_VARIABLE) || - 0 != setenv(fastrtps::xmlparser::SKIP_DEFAULT_XML_FILE, "1", 1)) + if (0 != unsetenv("FASTDDS_DEFAULT_PROFILES_FILE") || + 0 != setenv("SKIP_DEFAULT_XML_FILE", "1", 1)) { std::cout << "Error setting environment variables: " << std::strerror(errno) << std::endl; return 1; diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh index 59752c93d00..f2d5f4c9974 100755 --- a/utils/scripts/update_generated_code_from_idl.sh +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -24,7 +24,7 @@ files_needing_case_sensitive=( files_needing_output_dir=( './include/fastdds/statistics/types.idl|../../../src/cpp/statistics/types|../../../test/blackbox/types/statistics' - './include/fastdds/statistics/monitorservice_types.idl|../../../src/cpp/statistics/types' + './include/fastdds/statistics/monitorservice_types.idl|../../../src/cpp/statistics/types|../../../test/blackbox/types/statistics' ) red='\E[1;31m' diff --git a/versions.md b/versions.md index 9e9f32669f5..16ad52424a6 100644 --- a/versions.md +++ b/versions.md @@ -9,6 +9,7 @@ Migrate communication tests in `dds/communication` folder * Remove API marked as deprecated. * Removed deprecated FastRTPS API tests. * Removed no longer supported `FASTRTPS_API_TESTS` CMake options. +* XML Parser API no longer public. Version 2.13.0 --------------