diff --git a/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h b/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h index f6ad9734988..930a5a9909e 100644 --- a/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h +++ b/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h @@ -29,7 +29,7 @@ class TransportInterface; /** * Shared memory transport configuration. - * The kind value for SharedMemTransportDescriptor is given by eprosima::fastdds::rtps::LOCATOR_KIND_SHM. + * The kind is given by eprosima::fastdds::rtps::LOCATOR_KIND_SHM. * * - segment_size_: size of the shared memory segment (in octets). * diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h b/include/fastdds/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h similarity index 100% rename from src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h rename to include/fastdds/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h diff --git a/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h b/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h index 4ed2fb993db..7402ec91f87 100644 --- a/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h +++ b/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h @@ -21,13 +21,12 @@ #include #include - - namespace eprosima { namespace fastdds { namespace rtps { struct CDRMessage_t; +struct TestUDPv4TransportOptions; /** * UDP v4 Test Transport configuration @@ -40,57 +39,87 @@ struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor //! Locator filtering function typedef std::function DestinationLocatorFilter; + //! Test transport options + std::shared_ptr test_transport_options = std::make_shared(); + //! Test shim parameters //! Percentage of data messages being dropped - mutable std::atomic dropDataMessagesPercentage; + mutable std::atomic dropDataMessagesPercentage{0}; //! Percentage of Data[P] messages being dropped - mutable std::atomic dropParticipantBuiltinDataMessagesPercentage; + mutable std::atomic dropParticipantBuiltinDataMessagesPercentage{0}; //! Percentage of Data[W] messages being dropped - mutable std::atomic dropPublicationBuiltinDataMessagesPercentage; + mutable std::atomic dropPublicationBuiltinDataMessagesPercentage{0}; //! Percentage of Data[R] messages being dropped - mutable std::atomic dropSubscriptionBuiltinDataMessagesPercentage; + mutable std::atomic dropSubscriptionBuiltinDataMessagesPercentage{0}; //! Filtering function for dropping data messages - filter drop_data_messages_filter_; + filter drop_data_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Filtering function for dropping builtin data messages - filter drop_builtin_data_messages_filter_; + filter drop_builtin_data_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Flag to enable dropping of discovery Participant DATA(P) messages - bool dropParticipantBuiltinTopicData; + bool dropParticipantBuiltinTopicData = false; //! Flag to enable dropping of discovery Writer DATA(W) messages - bool dropPublicationBuiltinTopicData; + bool dropPublicationBuiltinTopicData = false; //! Flag to enable dropping of discovery Reader DATA(R) messages - bool dropSubscriptionBuiltinTopicData; + bool dropSubscriptionBuiltinTopicData = false; //! Percentage of data fragments being dropped - mutable std::atomic dropDataFragMessagesPercentage; + mutable std::atomic dropDataFragMessagesPercentage{0}; //! Filtering function for dropping data fragments messages - filter drop_data_frag_messages_filter_; + filter drop_data_frag_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Percentage of heartbeats being dropped - mutable std::atomic dropHeartbeatMessagesPercentage; + mutable std::atomic dropHeartbeatMessagesPercentage{0}; //! Filtering function for dropping heartbeat messages - filter drop_heartbeat_messages_filter_; + filter drop_heartbeat_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Percentage of AckNacks being dropped - mutable std::atomic dropAckNackMessagesPercentage; + mutable std::atomic dropAckNackMessagesPercentage{0}; //! Filtering function for dropping AckNacks - filter drop_ack_nack_messages_filter_; + filter drop_ack_nack_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Percentage of gap messages being dropped - mutable std::atomic dropGapMessagesPercentage; + mutable std::atomic dropGapMessagesPercentage{0}; //! Filtering function for dropping gap messages - filter drop_gap_messages_filter_; + filter drop_gap_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; // General filtering function for all kind of sub-messages (indiscriminate) - filter sub_messages_filter_; + filter sub_messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; // General drop percentage (indiscriminate) - mutable std::atomic percentageOfMessagesToDrop; + mutable std::atomic percentageOfMessagesToDrop{0}; // General filtering function for all kind of messages (indiscriminate) - filter messages_filter_; + filter messages_filter_ = [](fastdds::rtps::CDRMessage_t&) + { + return false; + }; //! Filtering function for dropping messages to specific destinations - DestinationLocatorFilter locator_filter_; + DestinationLocatorFilter locator_filter_ = [](const Locator&) + { + return false; + }; //! Vector containing the message's sequence numbers being dropped - std::vector sequenceNumberDataMessagesToDrop; + std::vector sequenceNumberDataMessagesToDrop{}; //! Log dropped packets - uint32_t dropLogLength; + uint32_t dropLogLength = 0; //! Constructor FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor(); @@ -123,6 +152,23 @@ struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor const test_UDPv4TransportDescriptor& t) const; }; +struct TestUDPv4TransportOptions +{ + FASTDDS_EXPORTED_API TestUDPv4TransportOptions() = default; + ~TestUDPv4TransportOptions() = default; + + std::atomic test_UDPv4Transport_ShutdownAllNetwork{false}; + // Handle to a persistent log of dropped packets. Defaults to length 0 (no logging) to prevent wasted resources. + std::vector> test_UDPv4Transport_DropLog{}; + std::atomic test_UDPv4Transport_DropLogLength{0}; + std::atomic always_drop_participant_builtin_topic_data{false}; + std::atomic simulate_no_interfaces{false}; + test_UDPv4TransportDescriptor::DestinationLocatorFilter locator_filter = [](const Locator&) + { + return false; + }; +}; + } // namespace rtps } // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h index e054e288e3b..0a676caec18 100644 --- a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h +++ b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h @@ -15,8 +15,9 @@ #ifndef _FASTDDS_TEST_SHAREDMEM_TRANSPORT_H_ #define _FASTDDS_TEST_SHAREDMEM_TRANSPORT_H_ +#include + #include -#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/transport/test_UDPv4Transport.cpp b/src/cpp/rtps/transport/test_UDPv4Transport.cpp index 12f71418cf5..c6d44f87689 100644 --- a/src/cpp/rtps/transport/test_UDPv4Transport.cpp +++ b/src/cpp/rtps/transport/test_UDPv4Transport.cpp @@ -26,19 +26,10 @@ namespace eprosima { namespace fastdds { namespace rtps { -std::vector> test_UDPv4Transport::test_UDPv4Transport_DropLog; -std::atomic test_UDPv4Transport::test_UDPv4Transport_DropLogLength(0); -std::atomic test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork(false); -std::atomic test_UDPv4Transport::always_drop_participant_builtin_topic_data(false); -std::atomic test_UDPv4Transport::simulate_no_interfaces(false); -test_UDPv4TransportDescriptor::DestinationLocatorFilter test_UDPv4Transport::locator_filter([](const Locator&) - { - return false; - }); - test_UDPv4Transport::test_UDPv4Transport( const test_UDPv4TransportDescriptor& descriptor) - : drop_data_messages_percentage_(descriptor.dropDataMessagesPercentage) + : test_transport_options(descriptor.test_transport_options) + , drop_data_messages_percentage_(descriptor.dropDataMessagesPercentage) , drop_participant_builtin_data_messages_percentage_(descriptor.dropParticipantBuiltinDataMessagesPercentage) , drop_publication_builtin_data_messages_percentage_(descriptor.dropPublicationBuiltinDataMessagesPercentage) , drop_subscription_builtin_data_messages_percentage_(descriptor.dropSubscriptionBuiltinDataMessagesPercentage) @@ -61,70 +52,25 @@ test_UDPv4Transport::test_UDPv4Transport( , sequence_number_data_messages_to_drop_(descriptor.sequenceNumberDataMessagesToDrop) , locator_filter_(descriptor.locator_filter_) { - test_UDPv4Transport_DropLogLength = 0; - test_UDPv4Transport_ShutdownAllNetwork = false; + if (nullptr == test_transport_options) + { + throw std::runtime_error("test_UDPv4Transport: test_transport_options is nullptr"); + } + + test_transport_options->test_UDPv4Transport_DropLogLength = 0; + test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; UDPv4Transport::mSendBufferSize = descriptor.sendBufferSize; UDPv4Transport::mReceiveBufferSize = descriptor.receiveBufferSize; for (auto interf : descriptor.interfaceWhiteList) { UDPv4Transport::interface_whitelist_.emplace_back(asio::ip::address_v4::from_string(interf)); } - test_UDPv4Transport_DropLog.clear(); - test_UDPv4Transport_DropLogLength = descriptor.dropLogLength; + test_transport_options->test_UDPv4Transport_DropLog.clear(); + test_transport_options->test_UDPv4Transport_DropLogLength = descriptor.dropLogLength; } test_UDPv4TransportDescriptor::test_UDPv4TransportDescriptor() : SocketTransportDescriptor(s_maximumMessageSize, s_maximumInitialPeersRange) - , dropDataMessagesPercentage(0) - , dropParticipantBuiltinDataMessagesPercentage(0) - , dropPublicationBuiltinDataMessagesPercentage(0) - , dropSubscriptionBuiltinDataMessagesPercentage(0) - , drop_data_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , drop_builtin_data_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , dropParticipantBuiltinTopicData(false) - , dropPublicationBuiltinTopicData(false) - , dropSubscriptionBuiltinTopicData(false) - , dropDataFragMessagesPercentage(0) - , drop_data_frag_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , dropHeartbeatMessagesPercentage(0) - , drop_heartbeat_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , dropAckNackMessagesPercentage(0) - , drop_ack_nack_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , dropGapMessagesPercentage(0) - , drop_gap_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , sub_messages_filter_([](CDRMessage_t&) - { - return false; - }) - , percentageOfMessagesToDrop(0) - , messages_filter_([](CDRMessage_t&) - { - return false; - }) - , locator_filter_([](const Locator&) - { - return false; - }) - , sequenceNumberDataMessagesToDrop() - , dropLogLength(0) { } @@ -155,7 +101,7 @@ bool test_UDPv4Transport::get_ips( bool return_loopback, bool force_lookup) const { - if (!simulate_no_interfaces) + if (!test_transport_options->simulate_no_interfaces) { return UDPv4Transport::get_ips(locNames, return_loopback, force_lookup); } @@ -178,7 +124,7 @@ bool test_UDPv4Transport::get_ips( LocatorList test_UDPv4Transport::NormalizeLocator( const Locator& locator) { - if (!simulate_no_interfaces) + if (!test_transport_options->simulate_no_interfaces) { return UDPv4Transport::NormalizeLocator(locator); } @@ -308,10 +254,10 @@ static bool ReadSubmessageHeader( bool test_UDPv4Transport::should_drop_locator( const Locator& remote_locator) { - return locator_filter(remote_locator) || + return test_transport_options->locator_filter(remote_locator) || locator_filter_(remote_locator) || // If there are no interfaces (simulate_no_interfaces), only multicast and localhost traffic is sent - (simulate_no_interfaces && + (test_transport_options->simulate_no_interfaces && !fastdds::rtps::IPLocator::isMulticast(remote_locator) && !fastdds::rtps::IPLocator::isLocal(remote_locator)); } @@ -320,7 +266,7 @@ bool test_UDPv4Transport::packet_should_drop( const std::vector& buffers, uint32_t total_bytes) { - if (test_UDPv4Transport_ShutdownAllNetwork) + if (test_transport_options->test_UDPv4Transport_ShutdownAllNetwork) { return true; } @@ -380,7 +326,7 @@ bool test_UDPv4Transport::packet_should_drop( if (writer_id == fastdds::rtps::c_EntityId_SPDPWriter) { - if (always_drop_participant_builtin_topic_data) + if (test_transport_options->always_drop_participant_builtin_topic_data) { return true; } @@ -526,7 +472,8 @@ bool test_UDPv4Transport::log_drop( uint32_t size) { static_cast(size); - if (test_UDPv4Transport_DropLog.size() < test_UDPv4Transport_DropLogLength) + if (test_transport_options->test_UDPv4Transport_DropLog.size() < + test_transport_options->test_UDPv4Transport_DropLogLength) { vector message; for (const auto& buf: buffers) @@ -535,7 +482,7 @@ bool test_UDPv4Transport::log_drop( message.insert(message.end(), byte_data, byte_data + buf.size); } assert(message.size() == size); - test_UDPv4Transport_DropLog.push_back(message); + test_transport_options->test_UDPv4Transport_DropLog.push_back(message); return true; } diff --git a/src/cpp/rtps/transport/test_UDPv4Transport.h b/src/cpp/rtps/transport/test_UDPv4Transport.h index 8811af59dad..83a5fb90a00 100644 --- a/src/cpp/rtps/transport/test_UDPv4Transport.h +++ b/src/cpp/rtps/transport/test_UDPv4Transport.h @@ -53,14 +53,7 @@ class test_UDPv4Transport : public UDPv4Transport virtual LocatorList NormalizeLocator( const Locator& locator) override; - FASTDDS_EXPORTED_API static std::atomic test_UDPv4Transport_ShutdownAllNetwork; - // Handle to a persistent log of dropped packets. Defaults to length 0 (no logging) to prevent wasted resources. - FASTDDS_EXPORTED_API static std::vector> test_UDPv4Transport_DropLog; - FASTDDS_EXPORTED_API static std::atomic test_UDPv4Transport_DropLogLength; - FASTDDS_EXPORTED_API static std::atomic always_drop_participant_builtin_topic_data; - FASTDDS_EXPORTED_API static std::atomic simulate_no_interfaces; - - FASTDDS_EXPORTED_API static test_UDPv4TransportDescriptor::DestinationLocatorFilter locator_filter; + std::shared_ptr test_transport_options; protected: diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index 7af9d550192..f9c3a7d1754 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -62,20 +62,22 @@ message(STATUS "BLACKBOX_HIGH_LEVEL_IGNORED_TESTS set to '${BLACKBOX_HIGH_LEVEL_ file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} + types/Data1mbPubSubTypes.cxx + types/Data1mbTypeObjectSupport.cxx + types/Data64kbPubSubTypes.cxx + types/Data64kbTypeObjectSupport.cxx + types/FixedSizedPubSubTypes.cxx + types/FixedSizedTypeObjectSupport.cxx types/HelloWorldPubSubTypes.cxx types/HelloWorldTypeObjectSupport.cxx + types/KeyedData1mbPubSubTypes.cxx + types/KeyedData1mbTypeObjectSupport.cxx types/KeyedHelloWorldPubSubTypes.cxx types/KeyedHelloWorldTypeObjectSupport.cxx + types/core/core_typesPubSubTypes.cxx + types/core/core_typesTypeObjectSupport.cxx types/StringTestPubSubTypes.cxx types/StringTestTypeObjectSupport.cxx - types/Data64kbPubSubTypes.cxx - types/Data64kbTypeObjectSupport.cxx - types/Data1mbPubSubTypes.cxx - types/Data1mbTypeObjectSupport.cxx - types/KeyedData1mbPubSubTypes.cxx - types/KeyedData1mbTypeObjectSupport.cxx - types/FixedSizedPubSubTypes.cxx - types/FixedSizedTypeObjectSupport.cxx types/UnboundedHelloWorldPubSubTypes.cxx types/UnboundedHelloWorldTypeObjectSupport.cxx @@ -103,20 +105,22 @@ gtest_discover_tests(BlackboxTests_RTPS file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} + types/Data1mbPubSubTypes.cxx + types/Data1mbTypeObjectSupport.cxx + types/Data64kbPubSubTypes.cxx + types/Data64kbTypeObjectSupport.cxx + types/FixedSizedPubSubTypes.cxx + types/FixedSizedTypeObjectSupport.cxx types/HelloWorldPubSubTypes.cxx types/HelloWorldTypeObjectSupport.cxx + types/KeyedData1mbPubSubTypes.cxx + types/KeyedData1mbTypeObjectSupport.cxx types/KeyedHelloWorldPubSubTypes.cxx types/KeyedHelloWorldTypeObjectSupport.cxx + types/core/core_typesPubSubTypes.cxx + types/core/core_typesTypeObjectSupport.cxx types/StringTestPubSubTypes.cxx types/StringTestTypeObjectSupport.cxx - types/Data64kbPubSubTypes.cxx - types/Data64kbTypeObjectSupport.cxx - types/Data1mbPubSubTypes.cxx - types/Data1mbTypeObjectSupport.cxx - types/KeyedData1mbPubSubTypes.cxx - types/KeyedData1mbTypeObjectSupport.cxx - types/FixedSizedPubSubTypes.cxx - types/FixedSizedTypeObjectSupport.cxx types/TestIncludeRegression3361TypeObjectSupport.cxx types/TestRegression3361PubSubTypes.cxx types/TestRegression3361TypeObjectSupport.cxx diff --git a/test/blackbox/common/BlackboxTests.hpp b/test/blackbox/common/BlackboxTests.hpp index 9665b329977..8ad5dbd201a 100644 --- a/test/blackbox/common/BlackboxTests.hpp +++ b/test/blackbox/common/BlackboxTests.hpp @@ -37,6 +37,7 @@ #include "../types/HelloWorldPubSubTypes.h" #include "../types/KeyedData1mbPubSubTypes.h" #include "../types/KeyedHelloWorldPubSubTypes.h" +#include "../types/core/core_typesPubSubTypes.h" #include "../types/StringTestPubSubTypes.h" #include "../types/UnboundedHelloWorldPubSubTypes.h" diff --git a/test/blackbox/common/BlackboxTestsDiscovery.cpp b/test/blackbox/common/BlackboxTestsDiscovery.cpp index 902260e17db..079619e8127 100644 --- a/test/blackbox/common/BlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/BlackboxTestsDiscovery.cpp @@ -13,6 +13,7 @@ // limitations under the License. +#include "fastdds/rtps/messages/RTPS_messages.h" #include #include @@ -22,17 +23,19 @@ #include +#include +#include + #include #include #include #include -// #include #include #include +#include #include -#include - +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "DatagramInjectionTransport.hpp" #include "PubSubReader.hpp" @@ -431,9 +434,9 @@ TEST(Discovery, EndpointRediscovery) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport_reader = std::make_shared(); reader.disable_builtin_transport(); - reader.add_user_transport_to_pparams(testTransport); + reader.add_user_transport_to_pparams(test_transport_reader); reader.lease_duration({ 3, 0 }, { 1, 0 }).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); @@ -441,10 +444,10 @@ TEST(Discovery, EndpointRediscovery) // To simulate lossy conditions, we are going to remove the default // bultin transport, and instead use a lossy shim layer variant. - testTransport = std::make_shared(); + auto test_transport_writer = std::make_shared(); // We drop 20% of all data frags writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport_writer); writer.lease_duration({ 6, 0 }, { 2, 0 }).init(); @@ -455,11 +458,13 @@ TEST(Discovery, EndpointRediscovery) writer.wait_discovery(); reader.wait_discovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport_writer->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport_reader->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; writer.wait_reader_undiscovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport_writer->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport_reader->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; writer.wait_discovery(); } @@ -470,14 +475,14 @@ TEST(Discovery, EndpointRediscovery_2) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); reader.lease_duration({ 120, 0 }, { 1, 0 }).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer.lease_duration({ 2, 0 }, { 1, 0 }).init(); @@ -487,11 +492,11 @@ TEST(Discovery, EndpointRediscovery_2) writer.wait_discovery(); reader.wait_discovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; reader.wait_participant_undiscovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; reader.wait_discovery(); } @@ -502,7 +507,7 @@ TEST(Discovery, EndpointRediscoveryWithTransientLocalData) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); reader .lease_duration({ 120, 0 }, { 1, 0 }) @@ -513,7 +518,7 @@ TEST(Discovery, EndpointRediscoveryWithTransientLocalData) ASSERT_TRUE(reader.isInitialized()); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer .lease_duration({ 2, 0 }, { 1, 0 }) @@ -536,11 +541,11 @@ TEST(Discovery, EndpointRediscoveryWithTransientLocalData) reader.block_for_all(); EXPECT_TRUE(writer.waitForAllAcked(std::chrono::seconds(1))); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; reader.wait_participant_undiscovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; reader.wait_discovery(); @@ -583,7 +588,7 @@ TEST(Discovery, ParticipantLivelinessAssertion) writer.wait_discovery(); reader.wait_discovery(); - test_UDPv4Transport::always_drop_participant_builtin_topic_data = true; + test_transport->test_transport_options->always_drop_participant_builtin_topic_data = true; std::thread thread([&writer]() { @@ -598,7 +603,7 @@ TEST(Discovery, ParticipantLivelinessAssertion) EXPECT_FALSE(reader.wait_participant_undiscovery(std::chrono::seconds(1))); EXPECT_FALSE(writer.wait_participant_undiscovery(std::chrono::seconds(1))); - test_UDPv4Transport::always_drop_participant_builtin_topic_data = false; + test_transport->test_transport_options->always_drop_participant_builtin_topic_data = false; thread.join(); } @@ -804,16 +809,14 @@ TEST(Discovery, LocalInitialPeersDiferrentLocators) return false; }; - auto old_locator_filter = test_UDPv4Transport::locator_filter; - test_UDPv4Transport::locator_filter = locator_printer; + auto test_transport = std::make_shared(); + test_transport->test_transport_options->locator_filter = locator_printer; // Configure writer participant: // - Uses the test transport, to check destination behavior // - Listens for metatraffic on `writer_port` // - Has no automatic announcements { - auto test_transport = std::make_shared(); - LocatorList_t writer_metatraffic_unicast; Locator_t locator; locator.port = static_cast(writer_port); @@ -875,9 +878,6 @@ TEST(Discovery, LocalInitialPeersDiferrentLocators) readers[1].init(); ASSERT_TRUE(readers[1].isInitialized()); readers[1].wait_discovery(); - - // Restore filter before deleting the participants - test_UDPv4Transport::locator_filter = old_locator_filter; } TEST_P(Discovery, PubSubAsReliableHelloworldParticipantDiscovery) @@ -1089,7 +1089,7 @@ TEST(Discovery, TwentyParticipantsMulticastLocalhostOnly) part->disable_builtin_transport().add_user_transport_to_pparams(test_transport); }; - test_UDPv4Transport::simulate_no_interfaces = true; + test_transport->test_transport_options->simulate_no_interfaces = true; discoverParticipantsTest(false, 20, 20, TEST_TOPIC_NAME, participant_config); } @@ -1966,13 +1966,16 @@ TEST(Discovery, RemoteBuiltinEndpointHonoring) reader_test_transport->drop_heartbeat_messages_filter_ = [&num_wlp_reader_heartbeat](CDRMessage_t& msg) { - auto old_pos = msg.pos; - msg.pos += 4; - eprosima::fastdds::rtps::EntityId_t writer_entity_id; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_entity_id); - msg.pos = old_pos; + // Go back to submsgkind + auto submsgkind_pos = msg.pos - 4; + auto hb_submsg = eprosima::fastdds::helpers::cdr_parse_heartbeat_submsg( + (char*)&msg.buffer[submsgkind_pos], + msg.length - submsgkind_pos); + + assert(hb_submsg.submsgHeader().submessageId() == HEARTBEAT); - if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == writer_entity_id) + if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == + *reinterpret_cast(&hb_submsg.writerId())) { num_wlp_reader_heartbeat++; } @@ -1981,13 +1984,16 @@ TEST(Discovery, RemoteBuiltinEndpointHonoring) reader_test_transport->drop_ack_nack_messages_filter_ = [&num_wlp_reader_acknack](CDRMessage_t& msg) { - auto old_pos = msg.pos; - msg.pos += 4; - eprosima::fastdds::rtps::EntityId_t writer_entity_id; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_entity_id); - msg.pos = old_pos; + // Go back to submsgkind + auto submsgkind_pos = msg.pos - 4; + auto acknack_submsg = eprosima::fastdds::helpers::cdr_parse_acknack_submsg( + (char*)&msg.buffer[submsgkind_pos], + msg.length - submsgkind_pos); + + assert(acknack_submsg.submsgHeader().submessageId() == ACKNACK); - if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == writer_entity_id) + if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == + *reinterpret_cast(&acknack_submsg.writerId())) { num_wlp_reader_acknack++; } @@ -1999,15 +2005,18 @@ TEST(Discovery, RemoteBuiltinEndpointHonoring) uint32_t num_wlp_writer_heartbeat = 0; uint32_t num_wlp_writer_acknack = 0; - writer_test_transport->drop_heartbeat_messages_filter_ = [&num_wlp_writer_heartbeat](CDRMessage_t& msg) + writer_test_transport->drop_heartbeat_messages_filter_ = [&](CDRMessage_t& msg) { - auto old_pos = msg.pos; - msg.pos += 4; - eprosima::fastdds::rtps::EntityId_t writer_entity_id; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_entity_id); - msg.pos = old_pos; + // Go back to submsgkind + auto submsgkind_pos = msg.pos - 4; + auto hb_submsg = eprosima::fastdds::helpers::cdr_parse_heartbeat_submsg( + (char*)&msg.buffer[submsgkind_pos], + msg.length - submsgkind_pos); - if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == writer_entity_id) + assert(hb_submsg.submsgHeader().submessageId() == HEARTBEAT); + + if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == + *reinterpret_cast(&hb_submsg.writerId())) { num_wlp_writer_heartbeat++; } @@ -2016,13 +2025,16 @@ TEST(Discovery, RemoteBuiltinEndpointHonoring) writer_test_transport->drop_ack_nack_messages_filter_ = [&num_wlp_writer_acknack](CDRMessage_t& msg) { - auto old_pos = msg.pos; - msg.pos += 4; - eprosima::fastdds::rtps::EntityId_t writer_entity_id; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_entity_id); - msg.pos = old_pos; + // Go back to submsgkind + auto submsgkind_pos = msg.pos - 4; + auto acknack_submsg = eprosima::fastdds::helpers::cdr_parse_acknack_submsg( + (char*)&msg.buffer[submsgkind_pos], + msg.length - submsgkind_pos); + + assert(acknack_submsg.submsgHeader().submessageId() == ACKNACK); - if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == writer_entity_id) + if (eprosima::fastdds::rtps::c_EntityId_WriterLiveliness == + *reinterpret_cast(&acknack_submsg.writerId())) { num_wlp_writer_acknack++; } diff --git a/test/blackbox/common/BlackboxTestsKeys.cpp b/test/blackbox/common/BlackboxTestsKeys.cpp index 8ba989ba920..760c0b23376 100644 --- a/test/blackbox/common/BlackboxTestsKeys.cpp +++ b/test/blackbox/common/BlackboxTestsKeys.cpp @@ -14,12 +14,13 @@ #include "BlackboxTests.hpp" +#include +#include + +#include "../utils/filter_helpers.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include -#include - TEST(KeyedTopic, RegistrationNonKeyedFail) { PubSubWriter writer(TEST_TOPIC_NAME); @@ -190,12 +191,12 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) PubSubWriter writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); bool writer_sends_inline_qos = true; bool writer_sends_pid_key_hash = true; - testTransport->drop_data_messages_filter_ = [&writer_sends_inline_qos, + test_transport->drop_data_messages_filter_ = [&writer_sends_inline_qos, &writer_sends_pid_key_hash](eprosima::fastdds::rtps::CDRMessage_t& msg) -> bool { // Check for inline_qos @@ -204,8 +205,10 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) // Skip extraFlags, read octetsToInlineQos, and calculate inline qos position. msg.pos += 2; - uint16_t to_inline_qos = 0; - eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, &to_inline_qos); + uint16_t to_inline_qos = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint32_t inline_qos_pos = msg.pos + to_inline_qos; // Filters are only applied to user data @@ -226,11 +229,12 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) bool key_hash_was_found = false; while (msg.pos < msg.length) { - uint16_t pid = 0; - uint16_t plen = 0; - - eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, &pid); - eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, &plen); + uint16_t pid = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plen = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; uint32_t next_pos = msg.pos + plen; if (pid == eprosima::fastdds::dds::PID_KEY_HASH) @@ -255,7 +259,7 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) writer. disable_builtin_transport(). - add_user_transport_to_pparams(testTransport). + add_user_transport_to_pparams(test_transport). init(); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp index edb3d948048..c9efde56dbc 100644 --- a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp +++ b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include "BlackboxTests.hpp" @@ -26,8 +27,6 @@ #include "ReqRepAsReliableHelloWorldReplier.hpp" #include "ReqRepAsReliableHelloWorldRequester.hpp" -#include - using namespace eprosima::fastdds; using namespace eprosima::fastdds::rtps; @@ -1951,8 +1950,8 @@ TEST(LivelinessTests, Detect_Deadlock_ManualByParticipant_Intraprocess) // Regression test of Refs #20584, github issue #4373 TEST(LivelinessTests, Reader_Successfully_Asserts_Liveliness_on_a_Disconnected_Writer) { - // Create a TestTransport to simulate a network shutdown (Ctrl+C) - auto testTransport = std::make_shared(); + // Create a test_transport to simulate a network shutdown (Ctrl+C) + auto test_transport = std::make_shared(); // Create two writer participants PubSubWriter writer_1(TEST_TOPIC_NAME); @@ -1974,7 +1973,7 @@ TEST(LivelinessTests, Reader_Successfully_Asserts_Liveliness_on_a_Disconnected_W // Create writers writer_1.disable_builtin_transport() .lease_duration(c_TimeInfinite, 1) - .add_user_transport_to_pparams(testTransport) + .add_user_transport_to_pparams(test_transport) .liveliness_lease_duration(eprosima::fastdds::Time_t(1, 0)) .liveliness_kind(eprosima::fastdds::dds::AUTOMATIC_LIVELINESS_QOS) .liveliness_announcement_period(eprosima::fastdds::Time_t(0, 500000000)) @@ -1991,7 +1990,7 @@ TEST(LivelinessTests, Reader_Successfully_Asserts_Liveliness_on_a_Disconnected_W reader.sub_wait_liveliness_recovered(2); // Simulate a Ctrl+C in one of the writers - eprosima::fastdds::rtps::test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; // After 1.6 secs, we should receive a on_liveliness_changed(status lost) // in the TEST_TOPIC_NAME reader that was matched with the disconnected writer_1 diff --git a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp index 072426a6750..7686f982927 100644 --- a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp @@ -15,12 +15,10 @@ #include #include +#include #include #include -// TODO(jlbueno): remove private header -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -480,7 +478,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditions) // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } @@ -535,7 +533,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } @@ -591,7 +589,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditionsSm // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } @@ -646,7 +644,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableKeyedData300kbKeepLast1InLos // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } @@ -706,7 +704,7 @@ TEST(PubSubFragmentsLimited, // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } @@ -763,7 +761,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond // Sanity check. Make sure we have dropped a few packets ASSERT_EQ( - test_UDPv4Transport::test_UDPv4Transport_DropLog.size(), + testTransport->test_transport_options->test_UDPv4Transport_DropLog.size(), testTransport->dropLogLength); } diff --git a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp index f5e63ee94db..34064ec54f3 100644 --- a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp @@ -18,11 +18,11 @@ #include #include +#include +#include #include -// TODO(jlbueno): remove private header -#include - +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -680,7 +680,7 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif // Lifespan period in milliseconds constexpr uint32_t lifespan_ms = 1000; constexpr uint32_t max_block_time_ms = 500; - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); writer.resource_limits_max_instances(keys) .resource_limits_max_samples_per_instance(samples_per_instance) @@ -689,7 +689,7 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif .max_blocking_time(max_block_time_ms * 1e-3) .lifespan_period(lifespan_ms * 1e-3) .disable_builtin_transport() - .add_user_transport_to_pparams(testTransport) + .add_user_transport_to_pparams(test_transport) .init(); ASSERT_TRUE(writer.isInitialized()); @@ -698,7 +698,7 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif writer.wait_discovery(); reader.wait_discovery(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; auto data = default_keyedhelloworld_data_generator(2); @@ -710,10 +710,10 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif data = default_keyedhelloworld_data_generator(4); reader.startReception(data); - std::thread thread([]() + std::thread thread([&test_transport]() { std::this_thread::sleep_for(std::chrono::milliseconds(20)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; }); // Send data @@ -972,14 +972,14 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWithKeyUnorderedReception) ASSERT_TRUE(reader.isInitialized()); - auto testTransport = std::make_shared(); - testTransport->dropDataMessagesPercentage = 25; + auto test_transport = std::make_shared(); + test_transport->dropDataMessagesPercentage = 25; writer.resource_limits_max_instances(keys). reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(depth).mem_policy(mem_policy_). - disable_builtin_transport().add_user_transport_to_pparams(testTransport). + disable_builtin_transport().add_user_transport_to_pparams(test_transport). init(); ASSERT_TRUE(writer.isInitialized()); @@ -998,7 +998,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWithKeyUnorderedReception) reader.block_for_at_least(static_cast(keys * depth * 0.1)); //! Avoid dropping deterministically the same re-sent samples - testTransport->dropDataMessagesPercentage.store(10); + test_transport->dropDataMessagesPercentage.store(10); reader.block_for_all(); reader.stopReception(); @@ -1329,29 +1329,21 @@ TEST(PubSubHistory, ReliableUnmatchWithFutureChanges) std::atomic_bool drop_data {false}; std::atomic_bool drop_heartbeat {false}; - auto testTransport = std::make_shared(); - testTransport->drop_data_messages_filter_ = [&drop_data](eprosima::fastdds::rtps::CDRMessage_t& msg) + auto test_transport = std::make_shared(); + test_transport->drop_data_messages_filter_ = [&drop_data](eprosima::fastdds::rtps::CDRMessage_t&) -> bool { - auto old_pos = msg.pos; - - // Jump to writer entity id - msg.pos += 2 + 2 + 4; - - // Read writer entity id - eprosima::fastdds::rtps::GUID_t writer_guid; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_guid.entityId); - msg.pos = old_pos; - - return drop_data && !writer_guid.is_builtin(); + // drop_data_filter never receives builtin data + return drop_data; }; - testTransport->drop_heartbeat_messages_filter_ = [&drop_heartbeat](eprosima::fastdds::rtps::CDRMessage_t& msg) + test_transport->drop_heartbeat_messages_filter_ = [&drop_heartbeat](eprosima::fastdds::rtps::CDRMessage_t& msg) -> bool { auto old_pos = msg.pos; msg.pos += 4; eprosima::fastdds::rtps::GUID_t writer_guid; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_guid.entityId); + writer_guid.entityId = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); msg.pos = old_pos; return drop_heartbeat && !writer_guid.is_builtin(); @@ -1359,7 +1351,7 @@ TEST(PubSubHistory, ReliableUnmatchWithFutureChanges) writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).history_depth(depth). - disable_builtin_transport().add_user_transport_to_pparams(testTransport). + disable_builtin_transport().add_user_transport_to_pparams(test_transport). init(); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/common/BlackboxTestsReliability.cpp b/test/blackbox/common/BlackboxTestsReliability.cpp index 6a0da87575a..691b2eda91c 100644 --- a/test/blackbox/common/BlackboxTestsReliability.cpp +++ b/test/blackbox/common/BlackboxTestsReliability.cpp @@ -14,11 +14,11 @@ #include +#include +#include #include -// TODO(jlbueno): remove private header -#include - +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -43,9 +43,9 @@ void reliability_disable_heartbeat_piggyback( if (start_reception) { auto old_pos = msg.pos; - EntityId_t writer_id_msg; msg.pos += 4; - CDRMessage::readEntityId(&msg, &writer_id_msg); + EntityId_t writer_id_msg = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); if (writer_id == writer_id_msg) { heartbeat_found = true; diff --git a/test/blackbox/common/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp index 27943b40b19..1cfc866074c 100644 --- a/test/blackbox/common/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -26,11 +26,10 @@ #include #include #include +#include #include -// TODO(jlbueno): remove private header -#include - +#include "../utils/filter_helpers.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -523,7 +522,8 @@ TEST(Security, BuiltinAuthenticationPlugin_second_participant_creation_loop) // Read writer entity id eprosima::fastdds::rtps::GUID_t writer_guid; - eprosima::fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_guid.entityId); + writer_guid.entityId = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); msg.pos = old_pos; if (writer_guid.entityId == eprosima::fastdds::rtps::participant_stateless_message_writer_entity_id) @@ -3732,7 +3732,7 @@ TEST_P(Security, RemoveParticipantProxyDataonSecurityManagerLeaseExpired_validat std::cout << "Reader received at least two samples, shutting down publisher " << std::endl; //! 7.Simulate a force-quit (cntrl+c) on the publisher by dropping connection - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_udptransport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; bool pubsub_writer_undiscovered; diff --git a/test/blackbox/common/BlackboxTestsTransportSHM.cpp b/test/blackbox/common/BlackboxTestsTransportSHM.cpp index 5863fbc128b..1c295539edc 100644 --- a/test/blackbox/common/BlackboxTestsTransportSHM.cpp +++ b/test/blackbox/common/BlackboxTestsTransportSHM.cpp @@ -22,12 +22,10 @@ #include "./mock/BlackboxMockConsumer.h" -#include - #include - -#include +#include #include +#include using namespace eprosima::fastdds; diff --git a/test/blackbox/common/BlackboxTestsVolatile.cpp b/test/blackbox/common/BlackboxTestsVolatile.cpp index 67dd10e8a24..0a5e16e13b5 100644 --- a/test/blackbox/common/BlackboxTestsVolatile.cpp +++ b/test/blackbox/common/BlackboxTestsVolatile.cpp @@ -15,11 +15,9 @@ #include #include #include +#include #include -// TODO(jlbueno): remove private header -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" diff --git a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp index 2cb15e1616c..9f402e67464 100644 --- a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp +++ b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp @@ -38,9 +38,6 @@ #include #include -// TODO(jlbueno): remove private headers -#include - #include "BlackboxTests.hpp" #include "../api/dds-pim/CustomPayloadPool.hpp" #include "../api/dds-pim/PubSubReader.hpp" @@ -154,7 +151,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) // Number of samples written by writer uint32_t writer_samples = 15; - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); writer.keep_duration({2, 0}); //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); @@ -163,7 +160,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer.init(); reader.keep_duration({1, 0}); @@ -190,7 +187,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) // Block reader until reception finished or timeout. reader.block_for_all(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; data = default_helloworld_data_generator(writer_samples); reader.startReception(data); @@ -201,7 +198,7 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) std::this_thread::sleep_for(std::chrono::seconds(1)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; // Block reader until reception finished or timeout. reader.block_for_all(); @@ -220,7 +217,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) // Number of samples written by writer uint32_t writer_samples = 15; - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); writer.keep_duration({1, 0}); //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); @@ -229,7 +226,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); - writer.add_user_transport_to_pparams(testTransport); + writer.add_user_transport_to_pparams(test_transport); writer.init(); reader.keep_duration({1, 0}); @@ -256,7 +253,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) // Block reader until reception finished or timeout. reader.block_for_all(); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; data = default_helloworld_data_generator(writer_samples); reader.startReception(data); @@ -267,7 +264,7 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) std::this_thread::sleep_for(std::chrono::seconds(2)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; // Block reader until reception finished or timeout. ASSERT_EQ(reader.block_for_all(std::chrono::seconds(1)), 0u); diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index b97a59ab356..dee1708a07c 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -41,6 +41,7 @@ #include #include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "../api/dds-pim/CustomPayloadPool.hpp" @@ -392,11 +393,14 @@ bool check_related_sample_identity_field( msg.pos = original_pos + qos_size; ParameterId_t pid{PID_SENTINEL}; - uint16_t plength = 0; bool valid = true; auto msg_pid_pos = msg.pos; - valid &= fastdds::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); - valid &= fastdds::rtps::CDRMessage::readUInt16(&msg, &plength); + pid = (ParameterId_t)eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plength = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; if (pid == PID_SENTINEL) { diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index c27d5ff04dc..f38133c3c9b 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -30,11 +30,11 @@ #include #include #include -#include #include "../types/HelloWorldTypeObjectSupport.hpp" #include "../types/TestRegression3361PubSubTypes.h" #include "../types/TestRegression3361TypeObjectSupport.hpp" +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -65,14 +65,16 @@ struct ContentFilterInfoCounter // Skip extraFlags, read octetsToInlineQos, and calculate inline qos position. msg.pos += 2; - uint16_t to_inline_qos = 0; - fastdds::rtps::CDRMessage::readUInt16(&msg, &to_inline_qos); + uint16_t to_inline_qos = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; uint32_t inline_qos_pos = msg.pos + to_inline_qos; // Read writerId, and skip if built-in. msg.pos += 4; fastdds::rtps::GUID_t writer_guid; - fastdds::rtps::CDRMessage::readEntityId(&msg, &writer_guid.entityId); + writer_guid.entityId = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); msg.pos = old_pos; if (writer_guid.is_builtin()) @@ -87,11 +89,12 @@ struct ContentFilterInfoCounter msg.pos = inline_qos_pos; while (msg.pos < msg.length) { - uint16_t pid = 0; - uint16_t plen = 0; - - fastdds::rtps::CDRMessage::readUInt16(&msg, &pid); - fastdds::rtps::CDRMessage::readUInt16(&msg, &plen); + uint16_t pid = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plen = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; uint32_t next_pos = msg.pos + plen; if (pid == PID_CONTENT_FILTER_INFO) @@ -102,13 +105,15 @@ struct ContentFilterInfoCounter if (plen >= 4 + 4 + 4 + 16) { // Read numBitmaps and skip bitmaps - uint32_t num_bitmaps = 0; - fastdds::rtps::CDRMessage::readUInt32(&msg, &num_bitmaps); + uint32_t num_bitmaps = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; msg.pos += 4 * num_bitmaps; // Read numSignatures and keep maximum - uint32_t num_signatures = 0; - fastdds::rtps::CDRMessage::readUInt32(&msg, &num_signatures); + uint32_t num_signatures = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; if (max_filter_signature_number < num_signatures) { max_filter_signature_number = num_signatures; diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index 2ecddf57d4a..040efc430c0 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -28,9 +28,10 @@ #include #include #include +#include #include -#include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -273,9 +274,17 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; diff --git a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp index 00e61a6033d..91ed70bcd75 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp @@ -30,9 +30,7 @@ #include #include #include - -// TODO(jlbueno): remove private header -#include +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -97,9 +95,9 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) PubSubWriter writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); - writer.disable_builtin_transport().add_user_transport_to_pparams(testTransport).init(); + writer.disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); @@ -109,7 +107,7 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) reader.wait_discovery(); // Disable communication to prevent reception of ACKs - eprosima::fastdds::rtps::test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; auto data = default_keyedhelloworld_data_generator(2); @@ -139,7 +137,7 @@ TEST_P(DDSDataWriter, WaitForAcknowledgmentInstance) } // Enable communication and wait for acknowledgment - eprosima::fastdds::rtps::test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; EXPECT_TRUE(writer.waitForInstanceAcked(&sample_1, instance_handle_1, std::chrono::seconds(1))); EXPECT_TRUE(writer.waitForInstanceAcked(&sample_2, rtps::c_InstanceHandle_Unknown, std::chrono::seconds(1))); diff --git a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp index 50c1018165f..de61fe1d6e6 100644 --- a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp @@ -30,14 +30,13 @@ #include #include #include +#include #include #include #include #include -// TODO(jlbueno): remove private header -#include - +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -437,8 +436,8 @@ TEST(DDSDiscovery, DDSNetworkInterfaceChangesAtRunTime) ASSERT_TRUE(datareader.isInitialized()); // datawriter: launch without interfaces - test_UDPv4Transport::simulate_no_interfaces = true; auto test_transport = std::make_shared(); + test_transport->test_transport_options->simulate_no_interfaces = true; datawriter.disable_builtin_transport().add_user_transport_to_pparams(test_transport).history_depth(100).init(); ASSERT_TRUE(datawriter.isInitialized()); @@ -461,7 +460,7 @@ TEST(DDSDiscovery, DDSNetworkInterfaceChangesAtRunTime) EXPECT_EQ(datareader.block_for_all(std::chrono::seconds(3)), 0u); // enable interfaces - test_UDPv4Transport::simulate_no_interfaces = false; + test_transport->test_transport_options->simulate_no_interfaces = false; datawriter.participant_set_qos(); // Wait for discovery @@ -1975,7 +1974,7 @@ TEST(DDSDiscovery, DataracePDP) participant_listener.discovery_future.wait(); // Shutdown auxiliary participant's network, so it will be removed after lease duration - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + aux_udp_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; DomainParticipantFactory::get_instance()->delete_participant(aux_participant); std::this_thread::sleep_for(std::chrono::milliseconds(1500)); // Wait for longer than lease duration @@ -2041,13 +2040,14 @@ TEST(DDSDiscovery, pdp_simple_participants_exchange_same_pid_domain_id_and_disco { msg.pos = original_pos + qos_size; - ParameterId_t pid{eprosima::fastdds::dds::PID_SENTINEL}; - uint16_t plength = 0; + uint16_t pid = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; + uint16_t plength = eprosima::fastdds::helpers::cdr_parse_u16( + (char*)&msg.buffer[msg.pos]); + msg.pos += 2; bool valid = true; - valid &= eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, (uint16_t*)&pid); - valid &= eprosima::fastdds::rtps::CDRMessage::readUInt16(&msg, &plength); - if (pid == eprosima::fastdds::dds::PID_SENTINEL) { // PID_SENTINEL is always considered of length 0 @@ -2068,8 +2068,8 @@ TEST(DDSDiscovery, pdp_simple_participants_exchange_same_pid_domain_id_and_disco { if (pid == eprosima::fastdds::dds::PID_DOMAIN_ID) { - uint32_t domain_id = 0; - eprosima::fastdds::rtps::CDRMessage::readUInt32(&msg, &domain_id); + uint32_t domain_id = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); if (domain_id == (uint32_t)GET_PID() % 230) { pid_was_found = true; diff --git a/test/blackbox/common/DDSBlackboxTestsListeners.cpp b/test/blackbox/common/DDSBlackboxTestsListeners.cpp index 43c8abec4cd..e8463a69112 100644 --- a/test/blackbox/common/DDSBlackboxTestsListeners.cpp +++ b/test/blackbox/common/DDSBlackboxTestsListeners.cpp @@ -21,10 +21,11 @@ #include #include #include +#include #include #include -#include +#include "../utils/filter_helpers.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -701,9 +702,17 @@ void sample_lost_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -736,10 +745,21 @@ void sample_lost_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); - CDRMessage::readUInt32(&msg, &first_fragment); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + + first_fragment = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -1708,9 +1728,17 @@ void sample_rejected_test_dw_init( msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -2901,9 +2929,17 @@ TEST(DDSStatus, sample_rejected_waitset) msg.pos += 2; // flags msg.pos += 2; // octets to inline quos - CDRMessage::readEntityId(&msg, &readerID); - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + readerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; @@ -3088,8 +3124,14 @@ void reliable_on_unack_test_init( msg.pos += 2; // flags msg.pos += 2; // inline QoS msg.pos += 4; // readerID - CDRMessage::readEntityId(&msg, &writerID); - CDRMessage::readSequenceNumber(&msg, &sn); + writerID = eprosima::fastdds::helpers::cdr_parse_entity_id( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.high = (int32_t)eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); + msg.pos += 4; + sn.low = eprosima::fastdds::helpers::cdr_parse_u32( + (char*)&msg.buffer[msg.pos]); // restore buffer pos msg.pos = old_pos; diff --git a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp index c78164c8e0b..9088b66c423 100644 --- a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp +++ b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp @@ -25,9 +25,6 @@ #include #include -// TODO(jlbueno): remove private header -#include - #include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "PubSubReader.hpp" diff --git a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp index 41ac24f7eb2..278ef3be793 100644 --- a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -28,9 +29,6 @@ #include #include -// TODO(jlbueno): remove private headers -#include - #include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" @@ -396,8 +394,8 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) // To simulate lossy conditions int gaps_to_drop = 2; - auto testTransport = std::make_shared(); - testTransport->drop_gap_messages_filter_ = [&gaps_to_drop](rtps::CDRMessage_t& ) + auto test_transport = std::make_shared(); + test_transport->drop_gap_messages_filter_ = [&gaps_to_drop](rtps::CDRMessage_t& ) { if (gaps_to_drop > 0) { @@ -406,7 +404,7 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) } return false; }; - testTransport->dropLogLength = 1; + test_transport->dropLogLength = 1; reader. durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). @@ -416,7 +414,7 @@ TEST_P(RTPS, RTPSAsReliableWithRegistrationAndHolesInHistory) writer.durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). disable_builtin_transport(). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -483,7 +481,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME); // To simulate lossy conditions - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); reader. durability(eprosima::fastdds::rtps::DurabilityKind_t::TRANSIENT_LOCAL). @@ -498,7 +496,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) disable_builtin_transport(). reliability(eprosima::fastdds::rtps::ReliabilityKind_t::RELIABLE). history_depth(3). - add_user_transport_to_pparams(testTransport).init(); + add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -525,7 +523,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) reader.expected_data(expected); writer.send(data); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = true; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = true; std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -543,7 +541,7 @@ TEST(RTPS, RTPSUnavailableSampleGapWhenSeparateSending) std::this_thread::sleep_for(std::chrono::seconds(1)); - test_UDPv4Transport::test_UDPv4Transport_ShutdownAllNetwork = false; + test_transport->test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false; std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -689,8 +687,8 @@ TEST(RTPS, RTPSNetworkInterfaceChangesAtRunTime) ASSERT_TRUE(reader.isInitialized()); // writer: launch without interfaces - test_UDPv4Transport::simulate_no_interfaces = true; auto test_transport = std::make_shared(); + test_transport->test_transport_options->simulate_no_interfaces = true; writer.disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); @@ -715,7 +713,7 @@ TEST(RTPS, RTPSNetworkInterfaceChangesAtRunTime) EXPECT_EQ(reader.getReceivedCount(), 0u); // enable interfaces - test_UDPv4Transport::simulate_no_interfaces = false; + test_transport->test_transport_options->simulate_no_interfaces = false; writer.participant_update_attributes(); // Wait for discovery @@ -1163,10 +1161,10 @@ TEST(RTPS, max_output_message_size_participant) EXPECT_TRUE(reader.isInitialized()); // Create the RTPSParticipants with the appropriate value for the property - auto testTransport = std::make_shared(); + auto test_transport = std::make_shared(); const uint32_t segment_size = 1470; std::string segment_size_str = std::to_string(segment_size); - testTransport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) + test_transport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) { EXPECT_LE(datagram.length, segment_size); // Never drop samples @@ -1175,7 +1173,7 @@ TEST(RTPS, max_output_message_size_participant) eprosima::fastdds::rtps::RTPSParticipantAttributes patt; patt.useBuiltinTransports = false; - patt.userTransports.push_back(testTransport); + patt.userTransports.push_back(test_transport); patt.properties.properties().emplace_back("fastdds.max_message_size", segment_size_str); eprosima::fastdds::rtps::RTPSParticipant* participant_writer = eprosima::fastdds::rtps::RTPSDomain::createParticipant(static_cast(GET_PID()) % 230, patt); @@ -1213,8 +1211,8 @@ TEST(RTPS, max_output_message_size_writer) const uint32_t segment_size = 1470; std::string segment_size_str = std::to_string(segment_size); - auto testTransport = std::make_shared(); - testTransport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) + auto test_transport = std::make_shared(); + test_transport->messages_filter_ = [segment_size](eprosima::fastdds::rtps::CDRMessage_t& datagram) { EXPECT_LE(datagram.length, segment_size); // Never drop samples @@ -1222,7 +1220,7 @@ TEST(RTPS, max_output_message_size_writer) }; RTPSWithRegistrationWriter writer(TEST_TOPIC_NAME); writer.add_property("fastdds.max_message_size", segment_size_str). - disable_builtin_transport().add_user_transport_to_pparams(testTransport).init(); + disable_builtin_transport().add_user_transport_to_pparams(test_transport).init(); ASSERT_TRUE(writer.isInitialized()); RTPSWithRegistrationReader reader(TEST_TOPIC_NAME); diff --git a/test/blackbox/types/core/core_types.cxx b/test/blackbox/types/core/core_types.cxx new file mode 100644 index 00000000000..77514210525 --- /dev/null +++ b/test/blackbox/types/core/core_types.cxx @@ -0,0 +1,2844 @@ +// 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 core_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 "core_types.h" + +#include "core_typesTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +namespace eprosima { + +namespace fastdds { + +namespace rtps { + +namespace core { + +namespace detail { + + + +EntityId_t::EntityId_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +EntityId_t::~EntityId_t() +{ +} + +EntityId_t::EntityId_t( + const EntityId_t& x) +{ + m_value = x.m_value; +} + +EntityId_t::EntityId_t( + EntityId_t&& x) noexcept +{ + m_value = std::move(x.m_value); +} + +EntityId_t& EntityId_t::operator =( + const EntityId_t& x) +{ + + m_value = x.m_value; + return *this; +} + +EntityId_t& EntityId_t::operator =( + EntityId_t&& x) noexcept +{ + + m_value = std::move(x.m_value); + return *this; +} + +bool EntityId_t::operator ==( + const EntityId_t& x) const +{ + return (m_value == x.m_value); +} + +bool EntityId_t::operator !=( + const EntityId_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void EntityId_t::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void EntityId_t::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& EntityId_t::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& EntityId_t::value() +{ + return m_value; +} + + + + +ProtocolVersion_t::ProtocolVersion_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +ProtocolVersion_t::~ProtocolVersion_t() +{ +} + +ProtocolVersion_t::ProtocolVersion_t( + const ProtocolVersion_t& x) +{ + m_major = x.m_major; + m_minor = x.m_minor; +} + +ProtocolVersion_t::ProtocolVersion_t( + ProtocolVersion_t&& x) noexcept +{ + m_major = x.m_major; + m_minor = x.m_minor; +} + +ProtocolVersion_t& ProtocolVersion_t::operator =( + const ProtocolVersion_t& x) +{ + + m_major = x.m_major; + m_minor = x.m_minor; + return *this; +} + +ProtocolVersion_t& ProtocolVersion_t::operator =( + ProtocolVersion_t&& x) noexcept +{ + + m_major = x.m_major; + m_minor = x.m_minor; + return *this; +} + +bool ProtocolVersion_t::operator ==( + const ProtocolVersion_t& x) const +{ + return (m_major == x.m_major && + m_minor == x.m_minor); +} + +bool ProtocolVersion_t::operator !=( + const ProtocolVersion_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member major + * @param _major New value for member major + */ +void ProtocolVersion_t::major( + uint8_t _major) +{ + m_major = _major; +} + +/*! + * @brief This function returns the value of member major + * @return Value of member major + */ +uint8_t ProtocolVersion_t::major() const +{ + return m_major; +} + +/*! + * @brief This function returns a reference to member major + * @return Reference to member major + */ +uint8_t& ProtocolVersion_t::major() +{ + return m_major; +} + + +/*! + * @brief This function sets a value in member minor + * @param _minor New value for member minor + */ +void ProtocolVersion_t::minor( + uint8_t _minor) +{ + m_minor = _minor; +} + +/*! + * @brief This function returns the value of member minor + * @return Value of member minor + */ +uint8_t ProtocolVersion_t::minor() const +{ + return m_minor; +} + +/*! + * @brief This function returns a reference to member minor + * @return Reference to member minor + */ +uint8_t& ProtocolVersion_t::minor() +{ + return m_minor; +} + + + + +VendorId_t::VendorId_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +VendorId_t::~VendorId_t() +{ +} + +VendorId_t::VendorId_t( + const VendorId_t& x) +{ + m_vendorId = x.m_vendorId; +} + +VendorId_t::VendorId_t( + VendorId_t&& x) noexcept +{ + m_vendorId = std::move(x.m_vendorId); +} + +VendorId_t& VendorId_t::operator =( + const VendorId_t& x) +{ + + m_vendorId = x.m_vendorId; + return *this; +} + +VendorId_t& VendorId_t::operator =( + VendorId_t&& x) noexcept +{ + + m_vendorId = std::move(x.m_vendorId); + return *this; +} + +bool VendorId_t::operator ==( + const VendorId_t& x) const +{ + return (m_vendorId == x.m_vendorId); +} + +bool VendorId_t::operator !=( + const VendorId_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ +void VendorId_t::vendorId( + const std::array& _vendorId) +{ + m_vendorId = _vendorId; +} + +/*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ +void VendorId_t::vendorId( + std::array&& _vendorId) +{ + m_vendorId = std::move(_vendorId); +} + +/*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ +const std::array& VendorId_t::vendorId() const +{ + return m_vendorId; +} + +/*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ +std::array& VendorId_t::vendorId() +{ + return m_vendorId; +} + + + + +GuidPrefix_t::GuidPrefix_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +GuidPrefix_t::~GuidPrefix_t() +{ +} + +GuidPrefix_t::GuidPrefix_t( + const GuidPrefix_t& x) +{ + m_value = x.m_value; +} + +GuidPrefix_t::GuidPrefix_t( + GuidPrefix_t&& x) noexcept +{ + m_value = std::move(x.m_value); +} + +GuidPrefix_t& GuidPrefix_t::operator =( + const GuidPrefix_t& x) +{ + + m_value = x.m_value; + return *this; +} + +GuidPrefix_t& GuidPrefix_t::operator =( + GuidPrefix_t&& x) noexcept +{ + + m_value = std::move(x.m_value); + return *this; +} + +bool GuidPrefix_t::operator ==( + const GuidPrefix_t& x) const +{ + return (m_value == x.m_value); +} + +bool GuidPrefix_t::operator !=( + const GuidPrefix_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void GuidPrefix_t::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void GuidPrefix_t::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& GuidPrefix_t::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& GuidPrefix_t::value() +{ + return m_value; +} + + + + +GUID_t::GUID_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +GUID_t::~GUID_t() +{ +} + +GUID_t::GUID_t( + const GUID_t& x) +{ + m_guidPrefix = x.m_guidPrefix; + m_entityId = x.m_entityId; +} + +GUID_t::GUID_t( + GUID_t&& x) noexcept +{ + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); +} + +GUID_t& GUID_t::operator =( + const GUID_t& x) +{ + + m_guidPrefix = x.m_guidPrefix; + m_entityId = x.m_entityId; + return *this; +} + +GUID_t& GUID_t::operator =( + GUID_t&& x) noexcept +{ + + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + return *this; +} + +bool GUID_t::operator ==( + const GUID_t& x) const +{ + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); +} + +bool GUID_t::operator !=( + const GUID_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void GUID_t::guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void GUID_t::guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& GUID_t::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::rtps::core::detail::GuidPrefix_t& GUID_t::guidPrefix() +{ + return m_guidPrefix; +} + + +/*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ +void GUID_t::entityId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _entityId) +{ + m_entityId = _entityId; +} + +/*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ +void GUID_t::entityId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _entityId) +{ + m_entityId = std::move(_entityId); +} + +/*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ +const eprosima::fastdds::rtps::core::detail::EntityId_t& GUID_t::entityId() const +{ + return m_entityId; +} + +/*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ +eprosima::fastdds::rtps::core::detail::EntityId_t& GUID_t::entityId() +{ + return m_entityId; +} + + + + +SequenceNumber_t::SequenceNumber_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +SequenceNumber_t::~SequenceNumber_t() +{ +} + +SequenceNumber_t::SequenceNumber_t( + const SequenceNumber_t& x) +{ + m_high = x.m_high; + m_low = x.m_low; +} + +SequenceNumber_t::SequenceNumber_t( + SequenceNumber_t&& x) noexcept +{ + m_high = x.m_high; + m_low = x.m_low; +} + +SequenceNumber_t& SequenceNumber_t::operator =( + const SequenceNumber_t& x) +{ + + m_high = x.m_high; + m_low = x.m_low; + return *this; +} + +SequenceNumber_t& SequenceNumber_t::operator =( + SequenceNumber_t&& x) noexcept +{ + + m_high = x.m_high; + m_low = x.m_low; + return *this; +} + +bool SequenceNumber_t::operator ==( + const SequenceNumber_t& x) const +{ + return (m_high == x.m_high && + m_low == x.m_low); +} + +bool SequenceNumber_t::operator !=( + const SequenceNumber_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ +void SequenceNumber_t::high( + int32_t _high) +{ + m_high = _high; +} + +/*! + * @brief This function returns the value of member high + * @return Value of member high + */ +int32_t SequenceNumber_t::high() const +{ + return m_high; +} + +/*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ +int32_t& SequenceNumber_t::high() +{ + return m_high; +} + + +/*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ +void SequenceNumber_t::low( + uint32_t _low) +{ + m_low = _low; +} + +/*! + * @brief This function returns the value of member low + * @return Value of member low + */ +uint32_t SequenceNumber_t::low() const +{ + return m_low; +} + +/*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ +uint32_t& SequenceNumber_t::low() +{ + return m_low; +} + + + + +Count_t::Count_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +Count_t::~Count_t() +{ +} + +Count_t::Count_t( + const Count_t& x) +{ + m_value = x.m_value; +} + +Count_t::Count_t( + Count_t&& x) noexcept +{ + m_value = x.m_value; +} + +Count_t& Count_t::operator =( + const Count_t& x) +{ + + m_value = x.m_value; + return *this; +} + +Count_t& Count_t::operator =( + Count_t&& x) noexcept +{ + + m_value = x.m_value; + return *this; +} + +bool Count_t::operator ==( + const Count_t& x) const +{ + return (m_value == x.m_value); +} + +bool Count_t::operator !=( + const Count_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void Count_t::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t Count_t::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& Count_t::value() +{ + return m_value; +} + + + + +Time_t::Time_t() +{ + // Just to register all known types + registercore_typesTypes(); +} + +Time_t::~Time_t() +{ +} + +Time_t::Time_t( + const Time_t& x) +{ + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; +} + +Time_t::Time_t( + Time_t&& x) noexcept +{ + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; +} + +Time_t& Time_t::operator =( + const Time_t& x) +{ + + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + return *this; +} + +Time_t& Time_t::operator =( + Time_t&& x) noexcept +{ + + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + return *this; +} + +bool Time_t::operator ==( + const Time_t& x) const +{ + return (m_seconds == x.m_seconds && + m_fraction == x.m_fraction); +} + +bool Time_t::operator !=( + const Time_t& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member seconds + * @param _seconds New value for member seconds + */ +void Time_t::seconds( + uint32_t _seconds) +{ + m_seconds = _seconds; +} + +/*! + * @brief This function returns the value of member seconds + * @return Value of member seconds + */ +uint32_t Time_t::seconds() const +{ + return m_seconds; +} + +/*! + * @brief This function returns a reference to member seconds + * @return Reference to member seconds + */ +uint32_t& Time_t::seconds() +{ + return m_seconds; +} + + +/*! + * @brief This function sets a value in member fraction + * @param _fraction New value for member fraction + */ +void Time_t::fraction( + uint32_t _fraction) +{ + m_fraction = _fraction; +} + +/*! + * @brief This function returns the value of member fraction + * @return Value of member fraction + */ +uint32_t Time_t::fraction() const +{ + return m_fraction; +} + +/*! + * @brief This function returns a reference to member fraction + * @return Reference to member fraction + */ +uint32_t& Time_t::fraction() +{ + return m_fraction; +} + + + + + +} // namespace detail + + +Header::Header() +{ + // Just to register all known types + registercore_typesTypes(); +} + +Header::~Header() +{ +} + +Header::Header( + const Header& x) +{ + m_prefix = x.m_prefix; + m_version = x.m_version; + m_vendorId = x.m_vendorId; + m_guidPrefix = x.m_guidPrefix; +} + +Header::Header( + Header&& x) noexcept +{ + m_prefix = std::move(x.m_prefix); + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); +} + +Header& Header::operator =( + const Header& x) +{ + + m_prefix = x.m_prefix; + m_version = x.m_version; + m_vendorId = x.m_vendorId; + m_guidPrefix = x.m_guidPrefix; + return *this; +} + +Header& Header::operator =( + Header&& x) noexcept +{ + + m_prefix = std::move(x.m_prefix); + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; +} + +bool Header::operator ==( + const Header& x) const +{ + return (m_prefix == x.m_prefix && + m_version == x.m_version && + m_vendorId == x.m_vendorId && + m_guidPrefix == x.m_guidPrefix); +} + +bool Header::operator !=( + const Header& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member prefix + * @param _prefix New value to be copied in member prefix + */ +void Header::prefix( + const std::array& _prefix) +{ + m_prefix = _prefix; +} + +/*! + * @brief This function moves the value in member prefix + * @param _prefix New value to be moved in member prefix + */ +void Header::prefix( + std::array&& _prefix) +{ + m_prefix = std::move(_prefix); +} + +/*! + * @brief This function returns a constant reference to member prefix + * @return Constant reference to member prefix + */ +const std::array& Header::prefix() const +{ + return m_prefix; +} + +/*! + * @brief This function returns a reference to member prefix + * @return Reference to member prefix + */ +std::array& Header::prefix() +{ + return m_prefix; +} + + +/*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ +void Header::version( + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& _version) +{ + m_version = _version; +} + +/*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ +void Header::version( + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t&& _version) +{ + m_version = std::move(_version); +} + +/*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ +const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& Header::version() const +{ + return m_version; +} + +/*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ +eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& Header::version() +{ + return m_version; +} + + +/*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ +void Header::vendorId( + const eprosima::fastdds::rtps::core::detail::VendorId_t& _vendorId) +{ + m_vendorId = _vendorId; +} + +/*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ +void Header::vendorId( + eprosima::fastdds::rtps::core::detail::VendorId_t&& _vendorId) +{ + m_vendorId = std::move(_vendorId); +} + +/*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ +const eprosima::fastdds::rtps::core::detail::VendorId_t& Header::vendorId() const +{ + return m_vendorId; +} + +/*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ +eprosima::fastdds::rtps::core::detail::VendorId_t& Header::vendorId() +{ + return m_vendorId; +} + + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void Header::guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void Header::guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& Header::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::rtps::core::detail::GuidPrefix_t& Header::guidPrefix() +{ + return m_guidPrefix; +} + + + + +SubmessageHeader::SubmessageHeader() +{ + // Just to register all known types + registercore_typesTypes(); +} + +SubmessageHeader::~SubmessageHeader() +{ +} + +SubmessageHeader::SubmessageHeader( + const SubmessageHeader& x) +{ + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; +} + +SubmessageHeader::SubmessageHeader( + SubmessageHeader&& x) noexcept +{ + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; +} + +SubmessageHeader& SubmessageHeader::operator =( + const SubmessageHeader& x) +{ + + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; + return *this; +} + +SubmessageHeader& SubmessageHeader::operator =( + SubmessageHeader&& x) noexcept +{ + + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; + return *this; +} + +bool SubmessageHeader::operator ==( + const SubmessageHeader& x) const +{ + return (m_submessageId == x.m_submessageId && + m_flags == x.m_flags && + m_submessageLength == x.m_submessageLength); +} + +bool SubmessageHeader::operator !=( + const SubmessageHeader& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function sets a value in member submessageId + * @param _submessageId New value for member submessageId + */ +void SubmessageHeader::submessageId( + uint8_t _submessageId) +{ + m_submessageId = _submessageId; +} + +/*! + * @brief This function returns the value of member submessageId + * @return Value of member submessageId + */ +uint8_t SubmessageHeader::submessageId() const +{ + return m_submessageId; +} + +/*! + * @brief This function returns a reference to member submessageId + * @return Reference to member submessageId + */ +uint8_t& SubmessageHeader::submessageId() +{ + return m_submessageId; +} + + +/*! + * @brief This function sets a value in member flags + * @param _flags New value for member flags + */ +void SubmessageHeader::flags( + uint8_t _flags) +{ + m_flags = _flags; +} + +/*! + * @brief This function returns the value of member flags + * @return Value of member flags + */ +uint8_t SubmessageHeader::flags() const +{ + return m_flags; +} + +/*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ +uint8_t& SubmessageHeader::flags() +{ + return m_flags; +} + + +/*! + * @brief This function sets a value in member submessageLength + * @param _submessageLength New value for member submessageLength + */ +void SubmessageHeader::submessageLength( + uint16_t _submessageLength) +{ + m_submessageLength = _submessageLength; +} + +/*! + * @brief This function returns the value of member submessageLength + * @return Value of member submessageLength + */ +uint16_t SubmessageHeader::submessageLength() const +{ + return m_submessageLength; +} + +/*! + * @brief This function returns a reference to member submessageLength + * @return Reference to member submessageLength + */ +uint16_t& SubmessageHeader::submessageLength() +{ + return m_submessageLength; +} + + + + + +HeartBeatSubmessage::HeartBeatSubmessage() +{ + // Just to register all known types + registercore_typesTypes(); +} + +HeartBeatSubmessage::~HeartBeatSubmessage() +{ +} + +HeartBeatSubmessage::HeartBeatSubmessage( + const HeartBeatSubmessage& x) +{ + m_submsgHeader = x.m_submsgHeader; + m_readerId = x.m_readerId; + m_writerId = x.m_writerId; + m_firstSN = x.m_firstSN; + m_lastSN = x.m_lastSN; + m_count = x.m_count; +} + +HeartBeatSubmessage::HeartBeatSubmessage( + HeartBeatSubmessage&& x) noexcept +{ + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_firstSN = std::move(x.m_firstSN); + m_lastSN = std::move(x.m_lastSN); + m_count = std::move(x.m_count); +} + +HeartBeatSubmessage& HeartBeatSubmessage::operator =( + const HeartBeatSubmessage& x) +{ + + m_submsgHeader = x.m_submsgHeader; + m_readerId = x.m_readerId; + m_writerId = x.m_writerId; + m_firstSN = x.m_firstSN; + m_lastSN = x.m_lastSN; + m_count = x.m_count; + return *this; +} + +HeartBeatSubmessage& HeartBeatSubmessage::operator =( + HeartBeatSubmessage&& x) noexcept +{ + + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_firstSN = std::move(x.m_firstSN); + m_lastSN = std::move(x.m_lastSN); + m_count = std::move(x.m_count); + return *this; +} + +bool HeartBeatSubmessage::operator ==( + const HeartBeatSubmessage& x) const +{ + return (m_submsgHeader == x.m_submsgHeader && + m_readerId == x.m_readerId && + m_writerId == x.m_writerId && + m_firstSN == x.m_firstSN && + m_lastSN == x.m_lastSN && + m_count == x.m_count); +} + +bool HeartBeatSubmessage::operator !=( + const HeartBeatSubmessage& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ +void HeartBeatSubmessage::submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader) +{ + m_submsgHeader = _submsgHeader; +} + +/*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ +void HeartBeatSubmessage::submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader) +{ + m_submsgHeader = std::move(_submsgHeader); +} + +/*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ +const eprosima::fastdds::rtps::core::SubmessageHeader& HeartBeatSubmessage::submsgHeader() const +{ + return m_submsgHeader; +} + +/*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ +eprosima::fastdds::rtps::core::SubmessageHeader& HeartBeatSubmessage::submsgHeader() +{ + return m_submsgHeader; +} + + +/*! + * @brief This function copies the value in member readerId + * @param _readerId New value to be copied in member readerId + */ +void HeartBeatSubmessage::readerId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _readerId) +{ + m_readerId = _readerId; +} + +/*! + * @brief This function moves the value in member readerId + * @param _readerId New value to be moved in member readerId + */ +void HeartBeatSubmessage::readerId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _readerId) +{ + m_readerId = std::move(_readerId); +} + +/*! + * @brief This function returns a constant reference to member readerId + * @return Constant reference to member readerId + */ +const eprosima::fastdds::rtps::core::detail::EntityId_t& HeartBeatSubmessage::readerId() const +{ + return m_readerId; +} + +/*! + * @brief This function returns a reference to member readerId + * @return Reference to member readerId + */ +eprosima::fastdds::rtps::core::detail::EntityId_t& HeartBeatSubmessage::readerId() +{ + return m_readerId; +} + + +/*! + * @brief This function copies the value in member writerId + * @param _writerId New value to be copied in member writerId + */ +void HeartBeatSubmessage::writerId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _writerId) +{ + m_writerId = _writerId; +} + +/*! + * @brief This function moves the value in member writerId + * @param _writerId New value to be moved in member writerId + */ +void HeartBeatSubmessage::writerId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _writerId) +{ + m_writerId = std::move(_writerId); +} + +/*! + * @brief This function returns a constant reference to member writerId + * @return Constant reference to member writerId + */ +const eprosima::fastdds::rtps::core::detail::EntityId_t& HeartBeatSubmessage::writerId() const +{ + return m_writerId; +} + +/*! + * @brief This function returns a reference to member writerId + * @return Reference to member writerId + */ +eprosima::fastdds::rtps::core::detail::EntityId_t& HeartBeatSubmessage::writerId() +{ + return m_writerId; +} + + +/*! + * @brief This function copies the value in member firstSN + * @param _firstSN New value to be copied in member firstSN + */ +void HeartBeatSubmessage::firstSN( + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& _firstSN) +{ + m_firstSN = _firstSN; +} + +/*! + * @brief This function moves the value in member firstSN + * @param _firstSN New value to be moved in member firstSN + */ +void HeartBeatSubmessage::firstSN( + eprosima::fastdds::rtps::core::detail::SequenceNumber_t&& _firstSN) +{ + m_firstSN = std::move(_firstSN); +} + +/*! + * @brief This function returns a constant reference to member firstSN + * @return Constant reference to member firstSN + */ +const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& HeartBeatSubmessage::firstSN() const +{ + return m_firstSN; +} + +/*! + * @brief This function returns a reference to member firstSN + * @return Reference to member firstSN + */ +eprosima::fastdds::rtps::core::detail::SequenceNumber_t& HeartBeatSubmessage::firstSN() +{ + return m_firstSN; +} + + +/*! + * @brief This function copies the value in member lastSN + * @param _lastSN New value to be copied in member lastSN + */ +void HeartBeatSubmessage::lastSN( + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& _lastSN) +{ + m_lastSN = _lastSN; +} + +/*! + * @brief This function moves the value in member lastSN + * @param _lastSN New value to be moved in member lastSN + */ +void HeartBeatSubmessage::lastSN( + eprosima::fastdds::rtps::core::detail::SequenceNumber_t&& _lastSN) +{ + m_lastSN = std::move(_lastSN); +} + +/*! + * @brief This function returns a constant reference to member lastSN + * @return Constant reference to member lastSN + */ +const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& HeartBeatSubmessage::lastSN() const +{ + return m_lastSN; +} + +/*! + * @brief This function returns a reference to member lastSN + * @return Reference to member lastSN + */ +eprosima::fastdds::rtps::core::detail::SequenceNumber_t& HeartBeatSubmessage::lastSN() +{ + return m_lastSN; +} + + +/*! + * @brief This function copies the value in member count + * @param _count New value to be copied in member count + */ +void HeartBeatSubmessage::count( + const eprosima::fastdds::rtps::core::detail::Count_t& _count) +{ + m_count = _count; +} + +/*! + * @brief This function moves the value in member count + * @param _count New value to be moved in member count + */ +void HeartBeatSubmessage::count( + eprosima::fastdds::rtps::core::detail::Count_t&& _count) +{ + m_count = std::move(_count); +} + +/*! + * @brief This function returns a constant reference to member count + * @return Constant reference to member count + */ +const eprosima::fastdds::rtps::core::detail::Count_t& HeartBeatSubmessage::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +eprosima::fastdds::rtps::core::detail::Count_t& HeartBeatSubmessage::count() +{ + return m_count; +} + + + + +InfoDestinationSubmessage::InfoDestinationSubmessage() +{ + // Just to register all known types + registercore_typesTypes(); +} + +InfoDestinationSubmessage::~InfoDestinationSubmessage() +{ +} + +InfoDestinationSubmessage::InfoDestinationSubmessage( + const InfoDestinationSubmessage& x) +{ + m_submsgHeader = x.m_submsgHeader; + m_guidPrefix = x.m_guidPrefix; +} + +InfoDestinationSubmessage::InfoDestinationSubmessage( + InfoDestinationSubmessage&& x) noexcept +{ + m_submsgHeader = std::move(x.m_submsgHeader); + m_guidPrefix = std::move(x.m_guidPrefix); +} + +InfoDestinationSubmessage& InfoDestinationSubmessage::operator =( + const InfoDestinationSubmessage& x) +{ + + m_submsgHeader = x.m_submsgHeader; + m_guidPrefix = x.m_guidPrefix; + return *this; +} + +InfoDestinationSubmessage& InfoDestinationSubmessage::operator =( + InfoDestinationSubmessage&& x) noexcept +{ + + m_submsgHeader = std::move(x.m_submsgHeader); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; +} + +bool InfoDestinationSubmessage::operator ==( + const InfoDestinationSubmessage& x) const +{ + return (m_submsgHeader == x.m_submsgHeader && + m_guidPrefix == x.m_guidPrefix); +} + +bool InfoDestinationSubmessage::operator !=( + const InfoDestinationSubmessage& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ +void InfoDestinationSubmessage::submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader) +{ + m_submsgHeader = _submsgHeader; +} + +/*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ +void InfoDestinationSubmessage::submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader) +{ + m_submsgHeader = std::move(_submsgHeader); +} + +/*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ +const eprosima::fastdds::rtps::core::SubmessageHeader& InfoDestinationSubmessage::submsgHeader() const +{ + return m_submsgHeader; +} + +/*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ +eprosima::fastdds::rtps::core::SubmessageHeader& InfoDestinationSubmessage::submsgHeader() +{ + return m_submsgHeader; +} + + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void InfoDestinationSubmessage::guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void InfoDestinationSubmessage::guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& InfoDestinationSubmessage::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::rtps::core::detail::GuidPrefix_t& InfoDestinationSubmessage::guidPrefix() +{ + return m_guidPrefix; +} + + + + +InfoSourceSubmessage::InfoSourceSubmessage() +{ + // Just to register all known types + registercore_typesTypes(); +} + +InfoSourceSubmessage::~InfoSourceSubmessage() +{ +} + +InfoSourceSubmessage::InfoSourceSubmessage( + const InfoSourceSubmessage& x) +{ + m_submsgHeader = x.m_submsgHeader; + m_unused = x.m_unused; + m_version = x.m_version; + m_vendorId = x.m_vendorId; + m_guidPrefix = x.m_guidPrefix; +} + +InfoSourceSubmessage::InfoSourceSubmessage( + InfoSourceSubmessage&& x) noexcept +{ + m_submsgHeader = std::move(x.m_submsgHeader); + m_unused = x.m_unused; + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); +} + +InfoSourceSubmessage& InfoSourceSubmessage::operator =( + const InfoSourceSubmessage& x) +{ + + m_submsgHeader = x.m_submsgHeader; + m_unused = x.m_unused; + m_version = x.m_version; + m_vendorId = x.m_vendorId; + m_guidPrefix = x.m_guidPrefix; + return *this; +} + +InfoSourceSubmessage& InfoSourceSubmessage::operator =( + InfoSourceSubmessage&& x) noexcept +{ + + m_submsgHeader = std::move(x.m_submsgHeader); + m_unused = x.m_unused; + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; +} + +bool InfoSourceSubmessage::operator ==( + const InfoSourceSubmessage& x) const +{ + return (m_submsgHeader == x.m_submsgHeader && + m_unused == x.m_unused && + m_version == x.m_version && + m_vendorId == x.m_vendorId && + m_guidPrefix == x.m_guidPrefix); +} + +bool InfoSourceSubmessage::operator !=( + const InfoSourceSubmessage& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ +void InfoSourceSubmessage::submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader) +{ + m_submsgHeader = _submsgHeader; +} + +/*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ +void InfoSourceSubmessage::submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader) +{ + m_submsgHeader = std::move(_submsgHeader); +} + +/*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ +const eprosima::fastdds::rtps::core::SubmessageHeader& InfoSourceSubmessage::submsgHeader() const +{ + return m_submsgHeader; +} + +/*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ +eprosima::fastdds::rtps::core::SubmessageHeader& InfoSourceSubmessage::submsgHeader() +{ + return m_submsgHeader; +} + + +/*! + * @brief This function sets a value in member unused + * @param _unused New value for member unused + */ +void InfoSourceSubmessage::unused( + int32_t _unused) +{ + m_unused = _unused; +} + +/*! + * @brief This function returns the value of member unused + * @return Value of member unused + */ +int32_t InfoSourceSubmessage::unused() const +{ + return m_unused; +} + +/*! + * @brief This function returns a reference to member unused + * @return Reference to member unused + */ +int32_t& InfoSourceSubmessage::unused() +{ + return m_unused; +} + + +/*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ +void InfoSourceSubmessage::version( + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& _version) +{ + m_version = _version; +} + +/*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ +void InfoSourceSubmessage::version( + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t&& _version) +{ + m_version = std::move(_version); +} + +/*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ +const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& InfoSourceSubmessage::version() const +{ + return m_version; +} + +/*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ +eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& InfoSourceSubmessage::version() +{ + return m_version; +} + + +/*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ +void InfoSourceSubmessage::vendorId( + const eprosima::fastdds::rtps::core::detail::VendorId_t& _vendorId) +{ + m_vendorId = _vendorId; +} + +/*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ +void InfoSourceSubmessage::vendorId( + eprosima::fastdds::rtps::core::detail::VendorId_t&& _vendorId) +{ + m_vendorId = std::move(_vendorId); +} + +/*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ +const eprosima::fastdds::rtps::core::detail::VendorId_t& InfoSourceSubmessage::vendorId() const +{ + return m_vendorId; +} + +/*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ +eprosima::fastdds::rtps::core::detail::VendorId_t& InfoSourceSubmessage::vendorId() +{ + return m_vendorId; +} + + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void InfoSourceSubmessage::guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void InfoSourceSubmessage::guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& InfoSourceSubmessage::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::rtps::core::detail::GuidPrefix_t& InfoSourceSubmessage::guidPrefix() +{ + return m_guidPrefix; +} + + + + +InfoTimestampSubmessage::InfoTimestampSubmessage() +{ + // Just to register all known types + registercore_typesTypes(); +} + +InfoTimestampSubmessage::~InfoTimestampSubmessage() +{ +} + +InfoTimestampSubmessage::InfoTimestampSubmessage( + const InfoTimestampSubmessage& x) +{ + m_submsgHeader = x.m_submsgHeader; + m_timestamp = x.m_timestamp; +} + +InfoTimestampSubmessage::InfoTimestampSubmessage( + InfoTimestampSubmessage&& x) noexcept +{ + m_submsgHeader = std::move(x.m_submsgHeader); + m_timestamp = std::move(x.m_timestamp); +} + +InfoTimestampSubmessage& InfoTimestampSubmessage::operator =( + const InfoTimestampSubmessage& x) +{ + + m_submsgHeader = x.m_submsgHeader; + m_timestamp = x.m_timestamp; + return *this; +} + +InfoTimestampSubmessage& InfoTimestampSubmessage::operator =( + InfoTimestampSubmessage&& x) noexcept +{ + + m_submsgHeader = std::move(x.m_submsgHeader); + m_timestamp = std::move(x.m_timestamp); + return *this; +} + +bool InfoTimestampSubmessage::operator ==( + const InfoTimestampSubmessage& x) const +{ + return (m_submsgHeader == x.m_submsgHeader && + m_timestamp == x.m_timestamp); +} + +bool InfoTimestampSubmessage::operator !=( + const InfoTimestampSubmessage& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ +void InfoTimestampSubmessage::submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader) +{ + m_submsgHeader = _submsgHeader; +} + +/*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ +void InfoTimestampSubmessage::submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader) +{ + m_submsgHeader = std::move(_submsgHeader); +} + +/*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ +const eprosima::fastdds::rtps::core::SubmessageHeader& InfoTimestampSubmessage::submsgHeader() const +{ + return m_submsgHeader; +} + +/*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ +eprosima::fastdds::rtps::core::SubmessageHeader& InfoTimestampSubmessage::submsgHeader() +{ + return m_submsgHeader; +} + + +/*! + * @brief This function copies the value in member timestamp + * @param _timestamp New value to be copied in member timestamp + */ +void InfoTimestampSubmessage::timestamp( + const eprosima::fastdds::rtps::core::detail::Timestamp& _timestamp) +{ + m_timestamp = _timestamp; +} + +/*! + * @brief This function moves the value in member timestamp + * @param _timestamp New value to be moved in member timestamp + */ +void InfoTimestampSubmessage::timestamp( + eprosima::fastdds::rtps::core::detail::Timestamp&& _timestamp) +{ + m_timestamp = std::move(_timestamp); +} + +/*! + * @brief This function returns a constant reference to member timestamp + * @return Constant reference to member timestamp + */ +const eprosima::fastdds::rtps::core::detail::Timestamp& InfoTimestampSubmessage::timestamp() const +{ + return m_timestamp; +} + +/*! + * @brief This function returns a reference to member timestamp + * @return Reference to member timestamp + */ +eprosima::fastdds::rtps::core::detail::Timestamp& InfoTimestampSubmessage::timestamp() +{ + return m_timestamp; +} + + + + +Submessage::Submessage() +{ + m__d = eprosima::fastdds::rtps::core::RTPS_HE; +} + +Submessage::~Submessage() +{ +} + +Submessage::Submessage( + const Submessage& x) +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + m_heartbeat_submsg = x.m_heartbeat_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + m_info_ts_submsg = x.m_info_ts_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + m_info_src_submsg = x.m_info_src_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + m_info_dst_submsg = x.m_info_dst_submsg; + break; + + + default: + m_unknown_submsg = x.m_unknown_submsg; + + break; + } +} + +Submessage::Submessage( + Submessage&& x) noexcept +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + m_heartbeat_submsg = std::move(x.m_heartbeat_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + m_info_ts_submsg = std::move(x.m_info_ts_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + m_info_src_submsg = std::move(x.m_info_src_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + m_info_dst_submsg = std::move(x.m_info_dst_submsg); + + break; + + + default: + m_unknown_submsg = std::move(x.m_unknown_submsg); + + break; + } +} + +Submessage& Submessage::operator =( + const Submessage& x) +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + m_heartbeat_submsg = x.m_heartbeat_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + m_info_ts_submsg = x.m_info_ts_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + m_info_src_submsg = x.m_info_src_submsg; + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + m_info_dst_submsg = x.m_info_dst_submsg; + break; + + + default: + m_unknown_submsg = x.m_unknown_submsg; + + break; + } + + return *this; +} + +Submessage& Submessage::operator =( + Submessage&& x) noexcept +{ + m__d = x.m__d; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + m_heartbeat_submsg = std::move(x.m_heartbeat_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + m_info_ts_submsg = std::move(x.m_info_ts_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + m_info_src_submsg = std::move(x.m_info_src_submsg); + + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + m_info_dst_submsg = std::move(x.m_info_dst_submsg); + + break; + + + default: + m_unknown_submsg = std::move(x.m_unknown_submsg); + + break; + } + + return *this; +} + +bool Submessage::operator ==( + const Submessage& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + return (m_heartbeat_submsg == x.m_heartbeat_submsg); + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + return (m_info_ts_submsg == x.m_info_ts_submsg); + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + return (m_info_src_submsg == x.m_info_src_submsg); + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + return (m_info_dst_submsg == x.m_info_dst_submsg); + break; + + + default: + return m_unknown_submsg == x.m_unknown_submsg; + + break; + } + return false; +} + +bool Submessage::operator !=( + const Submessage& x) const +{ + return !(*this == x); +} + +void Submessage::_d( + eprosima::fastdds::rtps::core::SubmessageKind __d) +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + switch (__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::rtps::core::INFO_TS: + switch (__d) + { + case eprosima::fastdds::rtps::core::INFO_TS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::rtps::core::INFO_SRC: + switch (__d) + { + case eprosima::fastdds::rtps::core::INFO_SRC: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::rtps::core::INFO_DST: + switch (__d) + { + case eprosima::fastdds::rtps::core::INFO_DST: + b = true; + break; + default: + break; + } + break; + + + default: + b = true; + switch (__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + case eprosima::fastdds::rtps::core::INFO_TS: + case eprosima::fastdds::rtps::core::INFO_SRC: + case eprosima::fastdds::rtps::core::INFO_DST: + b = false; + break; + default: + break; + } + break; + + } + + if (!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +eprosima::fastdds::rtps::core::SubmessageKind Submessage::_d() const +{ + return m__d; +} + +eprosima::fastdds::rtps::core::SubmessageKind& Submessage::_d() +{ + return m__d; +} + +void Submessage::heartbeat_submsg( + const eprosima::fastdds::rtps::core::HeartBeatSubmessage& _heartbeat_submsg) +{ + m_heartbeat_submsg = _heartbeat_submsg; + m__d = eprosima::fastdds::rtps::core::HEARTBEAT; + +} + +void Submessage::heartbeat_submsg( + eprosima::fastdds::rtps::core::HeartBeatSubmessage&& _heartbeat_submsg) +{ + m_heartbeat_submsg = std::move(_heartbeat_submsg); + m__d = eprosima::fastdds::rtps::core::HEARTBEAT; + +} + +const eprosima::fastdds::rtps::core::HeartBeatSubmessage& Submessage::heartbeat_submsg() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_heartbeat_submsg; +} + +eprosima::fastdds::rtps::core::HeartBeatSubmessage& Submessage::heartbeat_submsg() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_heartbeat_submsg; +} + + +void Submessage::info_ts_submsg( + const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& _info_ts_submsg) +{ + m_info_ts_submsg = _info_ts_submsg; + m__d = eprosima::fastdds::rtps::core::INFO_TS; + +} + +void Submessage::info_ts_submsg( + eprosima::fastdds::rtps::core::InfoTimestampSubmessage&& _info_ts_submsg) +{ + m_info_ts_submsg = std::move(_info_ts_submsg); + m__d = eprosima::fastdds::rtps::core::INFO_TS; + +} + +const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& Submessage::info_ts_submsg() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_TS: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_ts_submsg; +} + +eprosima::fastdds::rtps::core::InfoTimestampSubmessage& Submessage::info_ts_submsg() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_TS: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_ts_submsg; +} + + +void Submessage::info_src_submsg( + const eprosima::fastdds::rtps::core::InfoSourceSubmessage& _info_src_submsg) +{ + m_info_src_submsg = _info_src_submsg; + m__d = eprosima::fastdds::rtps::core::INFO_SRC; + +} + +void Submessage::info_src_submsg( + eprosima::fastdds::rtps::core::InfoSourceSubmessage&& _info_src_submsg) +{ + m_info_src_submsg = std::move(_info_src_submsg); + m__d = eprosima::fastdds::rtps::core::INFO_SRC; + +} + +const eprosima::fastdds::rtps::core::InfoSourceSubmessage& Submessage::info_src_submsg() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_SRC: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_src_submsg; +} + +eprosima::fastdds::rtps::core::InfoSourceSubmessage& Submessage::info_src_submsg() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_SRC: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_src_submsg; +} + + +void Submessage::info_dst_submsg( + const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& _info_dst_submsg) +{ + m_info_dst_submsg = _info_dst_submsg; + m__d = eprosima::fastdds::rtps::core::INFO_DST; + +} + +void Submessage::info_dst_submsg( + eprosima::fastdds::rtps::core::InfoDestinationSubmessage&& _info_dst_submsg) +{ + m_info_dst_submsg = std::move(_info_dst_submsg); + m__d = eprosima::fastdds::rtps::core::INFO_DST; + +} + +const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& Submessage::info_dst_submsg() const +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_DST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_dst_submsg; +} + +eprosima::fastdds::rtps::core::InfoDestinationSubmessage& Submessage::info_dst_submsg() +{ + bool b = false; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::INFO_DST: + b = true; + break; + default: + break; + } + + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_info_dst_submsg; +} + + +void Submessage::unknown_submsg( + const eprosima::fastdds::rtps::core::SubmessageHeader& _unknown_submsg) +{ + m_unknown_submsg = _unknown_submsg; + m__d = eprosima::fastdds::rtps::core::RTPS_HE; + +} + +void Submessage::unknown_submsg( + eprosima::fastdds::rtps::core::SubmessageHeader&& _unknown_submsg) +{ + m_unknown_submsg = std::move(_unknown_submsg); + m__d = eprosima::fastdds::rtps::core::RTPS_HE; + +} + +const eprosima::fastdds::rtps::core::SubmessageHeader& Submessage::unknown_submsg() const +{ + bool b = true; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + case eprosima::fastdds::rtps::core::INFO_TS: + case eprosima::fastdds::rtps::core::INFO_SRC: + case eprosima::fastdds::rtps::core::INFO_DST: + b = false; + break; + default: + break; + } + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_unknown_submsg; +} + +eprosima::fastdds::rtps::core::SubmessageHeader& Submessage::unknown_submsg() +{ + bool b = true; + + switch (m__d) + { + case eprosima::fastdds::rtps::core::HEARTBEAT: + case eprosima::fastdds::rtps::core::INFO_TS: + case eprosima::fastdds::rtps::core::INFO_SRC: + case eprosima::fastdds::rtps::core::INFO_DST: + b = false; + break; + default: + break; + } + if (!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_unknown_submsg; +} + + + + + + +RTPSMessage::RTPSMessage() +{ + // Just to register all known types + registercore_typesTypes(); +} + +RTPSMessage::~RTPSMessage() +{ +} + +RTPSMessage::RTPSMessage( + const RTPSMessage& x) +{ + m_msg_header = x.m_msg_header; + m_submessages = x.m_submessages; +} + +RTPSMessage::RTPSMessage( + RTPSMessage&& x) noexcept +{ + m_msg_header = std::move(x.m_msg_header); + m_submessages = std::move(x.m_submessages); +} + +RTPSMessage& RTPSMessage::operator =( + const RTPSMessage& x) +{ + + m_msg_header = x.m_msg_header; + m_submessages = x.m_submessages; + return *this; +} + +RTPSMessage& RTPSMessage::operator =( + RTPSMessage&& x) noexcept +{ + + m_msg_header = std::move(x.m_msg_header); + m_submessages = std::move(x.m_submessages); + return *this; +} + +bool RTPSMessage::operator ==( + const RTPSMessage& x) const +{ + return (m_msg_header == x.m_msg_header && + m_submessages == x.m_submessages); +} + +bool RTPSMessage::operator !=( + const RTPSMessage& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member msg_header + * @param _msg_header New value to be copied in member msg_header + */ +void RTPSMessage::msg_header( + const eprosima::fastdds::rtps::core::Header& _msg_header) +{ + m_msg_header = _msg_header; +} + +/*! + * @brief This function moves the value in member msg_header + * @param _msg_header New value to be moved in member msg_header + */ +void RTPSMessage::msg_header( + eprosima::fastdds::rtps::core::Header&& _msg_header) +{ + m_msg_header = std::move(_msg_header); +} + +/*! + * @brief This function returns a constant reference to member msg_header + * @return Constant reference to member msg_header + */ +const eprosima::fastdds::rtps::core::Header& RTPSMessage::msg_header() const +{ + return m_msg_header; +} + +/*! + * @brief This function returns a reference to member msg_header + * @return Reference to member msg_header + */ +eprosima::fastdds::rtps::core::Header& RTPSMessage::msg_header() +{ + return m_msg_header; +} + + +/*! + * @brief This function copies the value in member submessages + * @param _submessages New value to be copied in member submessages + */ +void RTPSMessage::submessages( + const std::vector& _submessages) +{ + m_submessages = _submessages; +} + +/*! + * @brief This function moves the value in member submessages + * @param _submessages New value to be moved in member submessages + */ +void RTPSMessage::submessages( + std::vector&& _submessages) +{ + m_submessages = std::move(_submessages); +} + +/*! + * @brief This function returns a constant reference to member submessages + * @return Constant reference to member submessages + */ +const std::vector& RTPSMessage::submessages() const +{ + return m_submessages; +} + +/*! + * @brief This function returns a reference to member submessages + * @return Reference to member submessages + */ +std::vector& RTPSMessage::submessages() +{ + return m_submessages; +} + + + + +} // namespace core + + +} // namespace rtps + + +} // namespace fastdds + + +} // namespace eprosima +// Include auxiliary functions like for serializing/deserializing. +#include "core_typesCdrAux.ipp" + diff --git a/test/blackbox/types/core/core_types.h b/test/blackbox/types/core/core_types.h new file mode 100644 index 00000000000..329031fbfe3 --- /dev/null +++ b/test/blackbox/types/core/core_types.h @@ -0,0 +1,2262 @@ +// 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 core_types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_H_ + +#include +#include +#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(CORE_TYPES_SOURCE) +#define CORE_TYPES_DllAPI __declspec( dllexport ) +#else +#define CORE_TYPES_DllAPI __declspec( dllimport ) +#endif // CORE_TYPES_SOURCE +#else +#define CORE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CORE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + + +namespace eprosima { + +namespace fastdds { + +namespace rtps { + +namespace core { + +namespace detail { + + + +/*! + * @brief This class represents the structure EntityId_t defined by the user in the IDL file. + * @ingroup core_types + */ +class EntityId_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + const EntityId_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + EntityId_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + const EntityId_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + EntityId_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_t& x) const; + + /*! + * @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 std::array& _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( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure ProtocolVersion_t defined by the user in the IDL file. + * @ingroup core_types + */ +class ProtocolVersion_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtocolVersion_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtocolVersion_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t( + const ProtocolVersion_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t( + ProtocolVersion_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t& operator =( + const ProtocolVersion_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t& operator =( + ProtocolVersion_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::ProtocolVersion_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtocolVersion_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::ProtocolVersion_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtocolVersion_t& x) const; + + /*! + * @brief This function sets a value in member major + * @param _major New value for member major + */ + eProsima_user_DllExport void major( + uint8_t _major); + + /*! + * @brief This function returns the value of member major + * @return Value of member major + */ + eProsima_user_DllExport uint8_t major() const; + + /*! + * @brief This function returns a reference to member major + * @return Reference to member major + */ + eProsima_user_DllExport uint8_t& major(); + + + /*! + * @brief This function sets a value in member minor + * @param _minor New value for member minor + */ + eProsima_user_DllExport void minor( + uint8_t _minor); + + /*! + * @brief This function returns the value of member minor + * @return Value of member minor + */ + eProsima_user_DllExport uint8_t minor() const; + + /*! + * @brief This function returns a reference to member minor + * @return Reference to member minor + */ + eProsima_user_DllExport uint8_t& minor(); + +private: + + uint8_t m_major{0}; + uint8_t m_minor{0}; + +}; + + +/*! + * @brief This class represents the structure VendorId_t defined by the user in the IDL file. + * @ingroup core_types + */ +class VendorId_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VendorId_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VendorId_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t( + const VendorId_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t( + VendorId_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t& operator =( + const VendorId_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t& operator =( + VendorId_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::VendorId_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VendorId_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::VendorId_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VendorId_t& x) const; + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const std::array& _vendorId); + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + std::array&& _vendorId); + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const std::array& vendorId() const; + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport std::array& vendorId(); + +private: + + std::array m_vendorId{0}; + +}; + + +/*! + * @brief This class represents the structure GuidPrefix_t defined by the user in the IDL file. + * @ingroup core_types + */ +class GuidPrefix_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t( + const GuidPrefix_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t( + GuidPrefix_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t& operator =( + const GuidPrefix_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t& operator =( + GuidPrefix_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::GuidPrefix_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::GuidPrefix_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_t& x) const; + + /*! + * @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 std::array& _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( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure GUID_t defined by the user in the IDL file. + * @ingroup core_types + */ +class GUID_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + const GUID_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + GUID_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + const GUID_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + GUID_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::GUID_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::GUID_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_t& x) const; + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix(); + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _entityId); + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _entityId); + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::EntityId_t& entityId() const; + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::EntityId_t& entityId(); + +private: + + eprosima::fastdds::rtps::core::detail::GuidPrefix_t m_guidPrefix; + eprosima::fastdds::rtps::core::detail::EntityId_t m_entityId; + +}; + + +/*! + * @brief This class represents the structure SequenceNumber_t defined by the user in the IDL file. + * @ingroup core_types + */ +class SequenceNumber_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + const SequenceNumber_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + SequenceNumber_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + const SequenceNumber_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + SequenceNumber_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_t& x) const; + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high); + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const; + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high(); + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low); + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const; + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low(); + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; + + +/*! + * @brief This class represents the structure Count_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Count_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Count_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Count_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Count_t that will be copied. + */ + eProsima_user_DllExport Count_t( + const Count_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Count_t that will be copied. + */ + eProsima_user_DllExport Count_t( + Count_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Count_t that will be copied. + */ + eProsima_user_DllExport Count_t& operator =( + const Count_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Count_t that will be copied. + */ + eProsima_user_DllExport Count_t& operator =( + Count_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::Count_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Count_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::Count_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Count_t& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + + +/*! + * @brief This class represents the structure Time_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Time_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time_t(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time_t(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Time_t that will be copied. + */ + eProsima_user_DllExport Time_t( + const Time_t& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Time_t that will be copied. + */ + eProsima_user_DllExport Time_t( + Time_t&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Time_t that will be copied. + */ + eProsima_user_DllExport Time_t& operator =( + const Time_t& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::detail::Time_t that will be copied. + */ + eProsima_user_DllExport Time_t& operator =( + Time_t&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::Time_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time_t& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::detail::Time_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time_t& x) const; + + /*! + * @brief This function sets a value in member seconds + * @param _seconds New value for member seconds + */ + eProsima_user_DllExport void seconds( + uint32_t _seconds); + + /*! + * @brief This function returns the value of member seconds + * @return Value of member seconds + */ + eProsima_user_DllExport uint32_t seconds() const; + + /*! + * @brief This function returns a reference to member seconds + * @return Reference to member seconds + */ + eProsima_user_DllExport uint32_t& seconds(); + + + /*! + * @brief This function sets a value in member fraction + * @param _fraction New value for member fraction + */ + eProsima_user_DllExport void fraction( + uint32_t _fraction); + + /*! + * @brief This function returns the value of member fraction + * @return Value of member fraction + */ + eProsima_user_DllExport uint32_t fraction() const; + + /*! + * @brief This function returns a reference to member fraction + * @return Reference to member fraction + */ + eProsima_user_DllExport uint32_t& fraction(); + +private: + + uint32_t m_seconds{0}; + uint32_t m_fraction{0}; + +}; +typedef eprosima::fastdds::rtps::core::detail::Time_t Timestamp; + + +} // namespace detail + + +/*! + * @brief This class represents the structure Header defined by the user in the IDL file. + * @ingroup core_types + */ +class Header +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::Header that will be copied. + */ + eProsima_user_DllExport Header( + const Header& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::Header that will be copied. + */ + eProsima_user_DllExport Header( + Header&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + const Header& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + Header&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::Header object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Header& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::Header object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Header& x) const; + + /*! + * @brief This function copies the value in member prefix + * @param _prefix New value to be copied in member prefix + */ + eProsima_user_DllExport void prefix( + const std::array& _prefix); + + /*! + * @brief This function moves the value in member prefix + * @param _prefix New value to be moved in member prefix + */ + eProsima_user_DllExport void prefix( + std::array&& _prefix); + + /*! + * @brief This function returns a constant reference to member prefix + * @return Constant reference to member prefix + */ + eProsima_user_DllExport const std::array& prefix() const; + + /*! + * @brief This function returns a reference to member prefix + * @return Reference to member prefix + */ + eProsima_user_DllExport std::array& prefix(); + + + /*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ + eProsima_user_DllExport void version( + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& _version); + + /*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ + eProsima_user_DllExport void version( + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t&& _version); + + /*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& version() const; + + /*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& version(); + + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const eprosima::fastdds::rtps::core::detail::VendorId_t& _vendorId); + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + eprosima::fastdds::rtps::core::detail::VendorId_t&& _vendorId); + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::VendorId_t& vendorId() const; + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::VendorId_t& vendorId(); + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix(); + +private: + + std::array m_prefix{0}; + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t m_version; + eprosima::fastdds::rtps::core::detail::VendorId_t m_vendorId; + eprosima::fastdds::rtps::core::detail::GuidPrefix_t m_guidPrefix; + +}; + + +/*! + * @brief This class represents the structure SubmessageHeader defined by the user in the IDL file. + * @ingroup core_types + */ +class SubmessageHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SubmessageHeader(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SubmessageHeader(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader( + const SubmessageHeader& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader( + SubmessageHeader&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader& operator =( + const SubmessageHeader& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader& operator =( + SubmessageHeader&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::SubmessageHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SubmessageHeader& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::SubmessageHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SubmessageHeader& x) const; + + /*! + * @brief This function sets a value in member submessageId + * @param _submessageId New value for member submessageId + */ + eProsima_user_DllExport void submessageId( + uint8_t _submessageId); + + /*! + * @brief This function returns the value of member submessageId + * @return Value of member submessageId + */ + eProsima_user_DllExport uint8_t submessageId() const; + + /*! + * @brief This function returns a reference to member submessageId + * @return Reference to member submessageId + */ + eProsima_user_DllExport uint8_t& submessageId(); + + + /*! + * @brief This function sets a value in member flags + * @param _flags New value for member flags + */ + eProsima_user_DllExport void flags( + uint8_t _flags); + + /*! + * @brief This function returns the value of member flags + * @return Value of member flags + */ + eProsima_user_DllExport uint8_t flags() const; + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport uint8_t& flags(); + + + /*! + * @brief This function sets a value in member submessageLength + * @param _submessageLength New value for member submessageLength + */ + eProsima_user_DllExport void submessageLength( + uint16_t _submessageLength); + + /*! + * @brief This function returns the value of member submessageLength + * @return Value of member submessageLength + */ + eProsima_user_DllExport uint16_t submessageLength() const; + + /*! + * @brief This function returns a reference to member submessageLength + * @return Reference to member submessageLength + */ + eProsima_user_DllExport uint16_t& submessageLength(); + +private: + + uint8_t m_submessageId{0}; + uint8_t m_flags{0}; + uint16_t m_submessageLength{0}; + +}; +/*! + * @brief This class represents the enumeration SubmessageKind defined by the user in the IDL file. + * @ingroup core_types + */ +enum SubmessageKind : uint32_t +{ + RTPS_HE, + PAD, + ACKNACK, + HEARTBEAT, + GAP, + INFO_TS, + INFO_SRC, + INFO_REPLY_IP4, + INFO_DST, + INFO_REPLY, + NACK_FRAG, + HEARTBEAT_FRAG, + DATA, + DATA_FRAG +}; + + +/*! + * @brief This class represents the structure HeartBeatSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class HeartBeatSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeartBeatSubmessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeartBeatSubmessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage( + const HeartBeatSubmessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage( + HeartBeatSubmessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage& operator =( + const HeartBeatSubmessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage& operator =( + HeartBeatSubmessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::HeartBeatSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeartBeatSubmessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::HeartBeatSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeartBeatSubmessage& x) const; + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader); + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader); + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader() const; + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader(); + + + /*! + * @brief This function copies the value in member readerId + * @param _readerId New value to be copied in member readerId + */ + eProsima_user_DllExport void readerId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _readerId); + + /*! + * @brief This function moves the value in member readerId + * @param _readerId New value to be moved in member readerId + */ + eProsima_user_DllExport void readerId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _readerId); + + /*! + * @brief This function returns a constant reference to member readerId + * @return Constant reference to member readerId + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::EntityId_t& readerId() const; + + /*! + * @brief This function returns a reference to member readerId + * @return Reference to member readerId + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::EntityId_t& readerId(); + + + /*! + * @brief This function copies the value in member writerId + * @param _writerId New value to be copied in member writerId + */ + eProsima_user_DllExport void writerId( + const eprosima::fastdds::rtps::core::detail::EntityId_t& _writerId); + + /*! + * @brief This function moves the value in member writerId + * @param _writerId New value to be moved in member writerId + */ + eProsima_user_DllExport void writerId( + eprosima::fastdds::rtps::core::detail::EntityId_t&& _writerId); + + /*! + * @brief This function returns a constant reference to member writerId + * @return Constant reference to member writerId + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::EntityId_t& writerId() const; + + /*! + * @brief This function returns a reference to member writerId + * @return Reference to member writerId + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::EntityId_t& writerId(); + + + /*! + * @brief This function copies the value in member firstSN + * @param _firstSN New value to be copied in member firstSN + */ + eProsima_user_DllExport void firstSN( + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& _firstSN); + + /*! + * @brief This function moves the value in member firstSN + * @param _firstSN New value to be moved in member firstSN + */ + eProsima_user_DllExport void firstSN( + eprosima::fastdds::rtps::core::detail::SequenceNumber_t&& _firstSN); + + /*! + * @brief This function returns a constant reference to member firstSN + * @return Constant reference to member firstSN + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& firstSN() const; + + /*! + * @brief This function returns a reference to member firstSN + * @return Reference to member firstSN + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::SequenceNumber_t& firstSN(); + + + /*! + * @brief This function copies the value in member lastSN + * @param _lastSN New value to be copied in member lastSN + */ + eProsima_user_DllExport void lastSN( + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& _lastSN); + + /*! + * @brief This function moves the value in member lastSN + * @param _lastSN New value to be moved in member lastSN + */ + eProsima_user_DllExport void lastSN( + eprosima::fastdds::rtps::core::detail::SequenceNumber_t&& _lastSN); + + /*! + * @brief This function returns a constant reference to member lastSN + * @return Constant reference to member lastSN + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& lastSN() const; + + /*! + * @brief This function returns a reference to member lastSN + * @return Reference to member lastSN + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::SequenceNumber_t& lastSN(); + + + /*! + * @brief This function copies the value in member count + * @param _count New value to be copied in member count + */ + eProsima_user_DllExport void count( + const eprosima::fastdds::rtps::core::detail::Count_t& _count); + + /*! + * @brief This function moves the value in member count + * @param _count New value to be moved in member count + */ + eProsima_user_DllExport void count( + eprosima::fastdds::rtps::core::detail::Count_t&& _count); + + /*! + * @brief This function returns a constant reference to member count + * @return Constant reference to member count + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::Count_t& count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::Count_t& count(); + +private: + + eprosima::fastdds::rtps::core::SubmessageHeader m_submsgHeader; + eprosima::fastdds::rtps::core::detail::EntityId_t m_readerId; + eprosima::fastdds::rtps::core::detail::EntityId_t m_writerId; + eprosima::fastdds::rtps::core::detail::SequenceNumber_t m_firstSN; + eprosima::fastdds::rtps::core::detail::SequenceNumber_t m_lastSN; + eprosima::fastdds::rtps::core::detail::Count_t m_count; + +}; + + +/*! + * @brief This class represents the structure InfoDestinationSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoDestinationSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoDestinationSubmessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoDestinationSubmessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage( + const InfoDestinationSubmessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage( + InfoDestinationSubmessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage& operator =( + const InfoDestinationSubmessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage& operator =( + InfoDestinationSubmessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoDestinationSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoDestinationSubmessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoDestinationSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoDestinationSubmessage& x) const; + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader); + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader); + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader() const; + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader(); + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix(); + +private: + + eprosima::fastdds::rtps::core::SubmessageHeader m_submsgHeader; + eprosima::fastdds::rtps::core::detail::GuidPrefix_t m_guidPrefix; + +}; + + +/*! + * @brief This class represents the structure InfoSourceSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoSourceSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoSourceSubmessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoSourceSubmessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage( + const InfoSourceSubmessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage( + InfoSourceSubmessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage& operator =( + const InfoSourceSubmessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage& operator =( + InfoSourceSubmessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoSourceSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoSourceSubmessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoSourceSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoSourceSubmessage& x) const; + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader); + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader); + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader() const; + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader(); + + + /*! + * @brief This function sets a value in member unused + * @param _unused New value for member unused + */ + eProsima_user_DllExport void unused( + int32_t _unused); + + /*! + * @brief This function returns the value of member unused + * @return Value of member unused + */ + eProsima_user_DllExport int32_t unused() const; + + /*! + * @brief This function returns a reference to member unused + * @return Reference to member unused + */ + eProsima_user_DllExport int32_t& unused(); + + + /*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ + eProsima_user_DllExport void version( + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& _version); + + /*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ + eProsima_user_DllExport void version( + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t&& _version); + + /*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& version() const; + + /*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& version(); + + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const eprosima::fastdds::rtps::core::detail::VendorId_t& _vendorId); + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + eprosima::fastdds::rtps::core::detail::VendorId_t&& _vendorId); + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::VendorId_t& vendorId() const; + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::VendorId_t& vendorId(); + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::rtps::core::detail::GuidPrefix_t&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::GuidPrefix_t& guidPrefix(); + +private: + + eprosima::fastdds::rtps::core::SubmessageHeader m_submsgHeader; + int32_t m_unused{0}; + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t m_version; + eprosima::fastdds::rtps::core::detail::VendorId_t m_vendorId; + eprosima::fastdds::rtps::core::detail::GuidPrefix_t m_guidPrefix; + +}; + + +/*! + * @brief This class represents the structure InfoTimestampSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoTimestampSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoTimestampSubmessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoTimestampSubmessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage( + const InfoTimestampSubmessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage( + InfoTimestampSubmessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage& operator =( + const InfoTimestampSubmessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage& operator =( + InfoTimestampSubmessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoTimestampSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoTimestampSubmessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::InfoTimestampSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoTimestampSubmessage& x) const; + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const eprosima::fastdds::rtps::core::SubmessageHeader& _submsgHeader); + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + eprosima::fastdds::rtps::core::SubmessageHeader&& _submsgHeader); + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader() const; + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageHeader& submsgHeader(); + + + /*! + * @brief This function copies the value in member timestamp + * @param _timestamp New value to be copied in member timestamp + */ + eProsima_user_DllExport void timestamp( + const eprosima::fastdds::rtps::core::detail::Timestamp& _timestamp); + + /*! + * @brief This function moves the value in member timestamp + * @param _timestamp New value to be moved in member timestamp + */ + eProsima_user_DllExport void timestamp( + eprosima::fastdds::rtps::core::detail::Timestamp&& _timestamp); + + /*! + * @brief This function returns a constant reference to member timestamp + * @return Constant reference to member timestamp + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::detail::Timestamp& timestamp() const; + + /*! + * @brief This function returns a reference to member timestamp + * @return Reference to member timestamp + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::detail::Timestamp& timestamp(); + +private: + + eprosima::fastdds::rtps::core::SubmessageHeader m_submsgHeader; + eprosima::fastdds::rtps::core::detail::Timestamp m_timestamp; + +}; + + +/*! + * @brief This class represents the union Submessage defined by the user in the IDL file. + * @ingroup core_types + */ +class Submessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Submessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Submessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::Submessage that will be copied. + */ + eProsima_user_DllExport Submessage( + const Submessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::Submessage that will be copied. + */ + eProsima_user_DllExport Submessage( + Submessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::Submessage that will be copied. + */ + eProsima_user_DllExport Submessage& operator =( + const Submessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::Submessage that will be copied. + */ + eProsima_user_DllExport Submessage& operator =( + Submessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::Submessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Submessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::Submessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Submessage& 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::rtps::core::SubmessageKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageKind& _d(); + + /*! + * @brief This function copies the value in member heartbeat_submsg + * @param _heartbeat_submsg New value to be copied in member heartbeat_submsg + */ + eProsima_user_DllExport void heartbeat_submsg( + const eprosima::fastdds::rtps::core::HeartBeatSubmessage& _heartbeat_submsg); + + /*! + * @brief This function moves the value in member heartbeat_submsg + * @param _heartbeat_submsg New value to be moved in member heartbeat_submsg + */ + eProsima_user_DllExport void heartbeat_submsg( + eprosima::fastdds::rtps::core::HeartBeatSubmessage&& _heartbeat_submsg); + + /*! + * @brief This function returns a constant reference to member heartbeat_submsg + * @return Constant reference to member heartbeat_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::HeartBeatSubmessage& heartbeat_submsg() const; + + /*! + * @brief This function returns a reference to member heartbeat_submsg + * @return Reference to member heartbeat_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::HeartBeatSubmessage& heartbeat_submsg(); + + + /*! + * @brief This function copies the value in member info_ts_submsg + * @param _info_ts_submsg New value to be copied in member info_ts_submsg + */ + eProsima_user_DllExport void info_ts_submsg( + const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& _info_ts_submsg); + + /*! + * @brief This function moves the value in member info_ts_submsg + * @param _info_ts_submsg New value to be moved in member info_ts_submsg + */ + eProsima_user_DllExport void info_ts_submsg( + eprosima::fastdds::rtps::core::InfoTimestampSubmessage&& _info_ts_submsg); + + /*! + * @brief This function returns a constant reference to member info_ts_submsg + * @return Constant reference to member info_ts_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& info_ts_submsg() const; + + /*! + * @brief This function returns a reference to member info_ts_submsg + * @return Reference to member info_ts_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::InfoTimestampSubmessage& info_ts_submsg(); + + + /*! + * @brief This function copies the value in member info_src_submsg + * @param _info_src_submsg New value to be copied in member info_src_submsg + */ + eProsima_user_DllExport void info_src_submsg( + const eprosima::fastdds::rtps::core::InfoSourceSubmessage& _info_src_submsg); + + /*! + * @brief This function moves the value in member info_src_submsg + * @param _info_src_submsg New value to be moved in member info_src_submsg + */ + eProsima_user_DllExport void info_src_submsg( + eprosima::fastdds::rtps::core::InfoSourceSubmessage&& _info_src_submsg); + + /*! + * @brief This function returns a constant reference to member info_src_submsg + * @return Constant reference to member info_src_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::InfoSourceSubmessage& info_src_submsg() const; + + /*! + * @brief This function returns a reference to member info_src_submsg + * @return Reference to member info_src_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::InfoSourceSubmessage& info_src_submsg(); + + + /*! + * @brief This function copies the value in member info_dst_submsg + * @param _info_dst_submsg New value to be copied in member info_dst_submsg + */ + eProsima_user_DllExport void info_dst_submsg( + const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& _info_dst_submsg); + + /*! + * @brief This function moves the value in member info_dst_submsg + * @param _info_dst_submsg New value to be moved in member info_dst_submsg + */ + eProsima_user_DllExport void info_dst_submsg( + eprosima::fastdds::rtps::core::InfoDestinationSubmessage&& _info_dst_submsg); + + /*! + * @brief This function returns a constant reference to member info_dst_submsg + * @return Constant reference to member info_dst_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& info_dst_submsg() const; + + /*! + * @brief This function returns a reference to member info_dst_submsg + * @return Reference to member info_dst_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::InfoDestinationSubmessage& info_dst_submsg(); + + + /*! + * @brief This function copies the value in member unknown_submsg + * @param _unknown_submsg New value to be copied in member unknown_submsg + */ + eProsima_user_DllExport void unknown_submsg( + const eprosima::fastdds::rtps::core::SubmessageHeader& _unknown_submsg); + + /*! + * @brief This function moves the value in member unknown_submsg + * @param _unknown_submsg New value to be moved in member unknown_submsg + */ + eProsima_user_DllExport void unknown_submsg( + eprosima::fastdds::rtps::core::SubmessageHeader&& _unknown_submsg); + + /*! + * @brief This function returns a constant reference to member unknown_submsg + * @return Constant reference to member unknown_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::SubmessageHeader& unknown_submsg() const; + + /*! + * @brief This function returns a reference to member unknown_submsg + * @return Reference to member unknown_submsg + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::SubmessageHeader& unknown_submsg(); + +private: + + eprosima::fastdds::rtps::core::SubmessageKind m__d; + + eprosima::fastdds::rtps::core::HeartBeatSubmessage m_heartbeat_submsg; + eprosima::fastdds::rtps::core::InfoTimestampSubmessage m_info_ts_submsg; + eprosima::fastdds::rtps::core::InfoSourceSubmessage m_info_src_submsg; + eprosima::fastdds::rtps::core::InfoDestinationSubmessage m_info_dst_submsg; + eprosima::fastdds::rtps::core::SubmessageHeader m_unknown_submsg; +}; + + + + +/*! + * @brief This class represents the structure RTPSMessage defined by the user in the IDL file. + * @ingroup core_types + */ +class RTPSMessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RTPSMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RTPSMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage( + const RTPSMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::rtps::core::RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage( + RTPSMessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage& operator =( + const RTPSMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::rtps::core::RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage& operator =( + RTPSMessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::RTPSMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RTPSMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::rtps::core::RTPSMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RTPSMessage& x) const; + + /*! + * @brief This function copies the value in member msg_header + * @param _msg_header New value to be copied in member msg_header + */ + eProsima_user_DllExport void msg_header( + const eprosima::fastdds::rtps::core::Header& _msg_header); + + /*! + * @brief This function moves the value in member msg_header + * @param _msg_header New value to be moved in member msg_header + */ + eProsima_user_DllExport void msg_header( + eprosima::fastdds::rtps::core::Header&& _msg_header); + + /*! + * @brief This function returns a constant reference to member msg_header + * @return Constant reference to member msg_header + */ + eProsima_user_DllExport const eprosima::fastdds::rtps::core::Header& msg_header() const; + + /*! + * @brief This function returns a reference to member msg_header + * @return Reference to member msg_header + */ + eProsima_user_DllExport eprosima::fastdds::rtps::core::Header& msg_header(); + + + /*! + * @brief This function copies the value in member submessages + * @param _submessages New value to be copied in member submessages + */ + eProsima_user_DllExport void submessages( + const std::vector& _submessages); + + /*! + * @brief This function moves the value in member submessages + * @param _submessages New value to be moved in member submessages + */ + eProsima_user_DllExport void submessages( + std::vector&& _submessages); + + /*! + * @brief This function returns a constant reference to member submessages + * @return Constant reference to member submessages + */ + eProsima_user_DllExport const std::vector& submessages() const; + + /*! + * @brief This function returns a reference to member submessages + * @return Reference to member submessages + */ + eProsima_user_DllExport std::vector& submessages(); + +private: + + eprosima::fastdds::rtps::core::Header m_msg_header; + std::vector m_submessages; + +}; + +} // namespace core + +} // namespace rtps + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_H_ + + + diff --git a/test/blackbox/types/core/core_types.hpp b/test/blackbox/types/core/core_types.hpp new file mode 100644 index 00000000000..6a5d752127c --- /dev/null +++ b/test/blackbox/types/core/core_types.hpp @@ -0,0 +1,4940 @@ +// 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 core_types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_HPP_ + +#include +#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(CORE_TYPES_SOURCE) +#define CORE_TYPES_DllAPI __declspec( dllexport ) +#else +#define CORE_TYPES_DllAPI __declspec( dllimport ) +#endif // CORE_TYPES_SOURCE +#else +#define CORE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CORE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace rtps { + +namespace core { + +namespace detail { + +/*! + * @brief This class represents the structure EntityId_t defined by the user in the IDL file. + * @ingroup core_types + */ +class EntityId_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + const EntityId_t& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + EntityId_t&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + const EntityId_t& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + EntityId_t&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_t& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_t& x) const + { + return !(*this == x); + } + + /*! + * @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 std::array& _value) + { + m_value = _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( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure ProtocolVersion_t defined by the user in the IDL file. + * @ingroup core_types + */ +class ProtocolVersion_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtocolVersion_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtocolVersion_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t( + const ProtocolVersion_t& x) + { + m_major = x.m_major; + + m_minor = x.m_minor; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t( + ProtocolVersion_t&& x) noexcept + { + m_major = x.m_major; + m_minor = x.m_minor; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t& operator =( + const ProtocolVersion_t& x) + { + + m_major = x.m_major; + + m_minor = x.m_minor; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ProtocolVersion_t that will be copied. + */ + eProsima_user_DllExport ProtocolVersion_t& operator =( + ProtocolVersion_t&& x) noexcept + { + + m_major = x.m_major; + m_minor = x.m_minor; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ProtocolVersion_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtocolVersion_t& x) const + { + return (m_major == x.m_major && + m_minor == x.m_minor); + } + + /*! + * @brief Comparison operator. + * @param x ProtocolVersion_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtocolVersion_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member major + * @param _major New value for member major + */ + eProsima_user_DllExport void major( + uint8_t _major) + { + m_major = _major; + } + + /*! + * @brief This function returns the value of member major + * @return Value of member major + */ + eProsima_user_DllExport uint8_t major() const + { + return m_major; + } + + /*! + * @brief This function returns a reference to member major + * @return Reference to member major + */ + eProsima_user_DllExport uint8_t& major() + { + return m_major; + } + + + /*! + * @brief This function sets a value in member minor + * @param _minor New value for member minor + */ + eProsima_user_DllExport void minor( + uint8_t _minor) + { + m_minor = _minor; + } + + /*! + * @brief This function returns the value of member minor + * @return Value of member minor + */ + eProsima_user_DllExport uint8_t minor() const + { + return m_minor; + } + + /*! + * @brief This function returns a reference to member minor + * @return Reference to member minor + */ + eProsima_user_DllExport uint8_t& minor() + { + return m_minor; + } + + + +private: + + uint8_t m_major{0}; + uint8_t m_minor{0}; + +}; +/*! + * @brief This class represents the structure VendorId_t defined by the user in the IDL file. + * @ingroup core_types + */ +class VendorId_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VendorId_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VendorId_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t( + const VendorId_t& x) + { + m_vendorId = x.m_vendorId; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t( + VendorId_t&& x) noexcept + { + m_vendorId = std::move(x.m_vendorId); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t& operator =( + const VendorId_t& x) + { + + m_vendorId = x.m_vendorId; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object VendorId_t that will be copied. + */ + eProsima_user_DllExport VendorId_t& operator =( + VendorId_t&& x) noexcept + { + + m_vendorId = std::move(x.m_vendorId); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x VendorId_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VendorId_t& x) const + { + return (m_vendorId == x.m_vendorId); + } + + /*! + * @brief Comparison operator. + * @param x VendorId_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VendorId_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const std::array& _vendorId) + { + m_vendorId = _vendorId; + } + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + std::array&& _vendorId) + { + m_vendorId = std::move(_vendorId); + } + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const std::array& vendorId() const + { + return m_vendorId; + } + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport std::array& vendorId() + { + return m_vendorId; + } + + + +private: + + std::array m_vendorId{0}; + +}; +/*! + * @brief This class represents the structure GuidPrefix_t defined by the user in the IDL file. + * @ingroup core_types + */ +class GuidPrefix_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t( + const GuidPrefix_t& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t( + GuidPrefix_t&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t& operator =( + const GuidPrefix_t& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GuidPrefix_t that will be copied. + */ + eProsima_user_DllExport GuidPrefix_t& operator =( + GuidPrefix_t&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_t& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_t& x) const + { + return !(*this == x); + } + + /*! + * @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 std::array& _value) + { + m_value = _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( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure GUID_t defined by the user in the IDL file. + * @ingroup core_types + */ +class GUID_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + const GUID_t& x) + { + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + GUID_t&& x) noexcept + { + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + const GUID_t& x) + { + + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + GUID_t&& x) noexcept + { + + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GUID_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_t& x) const + { + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); + } + + /*! + * @brief Comparison operator. + * @param x GUID_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const GuidPrefix_t& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + GuidPrefix_t&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const GuidPrefix_t& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport GuidPrefix_t& guidPrefix() + { + return m_guidPrefix; + } + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const EntityId_t& _entityId) + { + m_entityId = _entityId; + } + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + EntityId_t&& _entityId) + { + m_entityId = std::move(_entityId); + } + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const EntityId_t& entityId() const + { + return m_entityId; + } + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport EntityId_t& entityId() + { + return m_entityId; + } + + + +private: + + GuidPrefix_t m_guidPrefix; + EntityId_t m_entityId; + +}; +/*! + * @brief This class represents the structure SequenceNumber_t defined by the user in the IDL file. + * @ingroup core_types + */ +class SequenceNumber_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + const SequenceNumber_t& x) + { + m_high = x.m_high; + + m_low = x.m_low; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + SequenceNumber_t&& x) noexcept + { + m_high = x.m_high; + m_low = x.m_low; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + const SequenceNumber_t& x) + { + + m_high = x.m_high; + + m_low = x.m_low; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + SequenceNumber_t&& x) noexcept + { + + m_high = x.m_high; + m_low = x.m_low; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_t& x) const + { + return (m_high == x.m_high && + m_low == x.m_low); + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high) + { + m_high = _high; + } + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const + { + return m_high; + } + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high() + { + return m_high; + } + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low) + { + m_low = _low; + } + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const + { + return m_low; + } + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low() + { + return m_low; + } + + + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; +/*! + * @brief This class represents the structure Count_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Count_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Count_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Count_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Count_t that will be copied. + */ + eProsima_user_DllExport Count_t( + const Count_t& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Count_t that will be copied. + */ + eProsima_user_DllExport Count_t( + Count_t&& x) noexcept + { + m_value = x.m_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Count_t that will be copied. + */ + eProsima_user_DllExport Count_t& operator =( + const Count_t& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Count_t that will be copied. + */ + eProsima_user_DllExport Count_t& operator =( + Count_t&& x) noexcept + { + + m_value = x.m_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Count_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Count_t& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x Count_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Count_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value) + { + m_value = _value; + } + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value() + { + return m_value; + } + + + +private: + + int32_t m_value{0}; + +}; +/*! + * @brief This class represents the structure Time_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Time_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Time_t that will be copied. + */ + eProsima_user_DllExport Time_t( + const Time_t& x) + { + m_seconds = x.m_seconds; + + m_fraction = x.m_fraction; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Time_t that will be copied. + */ + eProsima_user_DllExport Time_t( + Time_t&& x) noexcept + { + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Time_t that will be copied. + */ + eProsima_user_DllExport Time_t& operator =( + const Time_t& x) + { + + m_seconds = x.m_seconds; + + m_fraction = x.m_fraction; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Time_t that will be copied. + */ + eProsima_user_DllExport Time_t& operator =( + Time_t&& x) noexcept + { + + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Time_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time_t& x) const + { + return (m_seconds == x.m_seconds && + m_fraction == x.m_fraction); + } + + /*! + * @brief Comparison operator. + * @param x Time_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member seconds + * @param _seconds New value for member seconds + */ + eProsima_user_DllExport void seconds( + uint32_t _seconds) + { + m_seconds = _seconds; + } + + /*! + * @brief This function returns the value of member seconds + * @return Value of member seconds + */ + eProsima_user_DllExport uint32_t seconds() const + { + return m_seconds; + } + + /*! + * @brief This function returns a reference to member seconds + * @return Reference to member seconds + */ + eProsima_user_DllExport uint32_t& seconds() + { + return m_seconds; + } + + + /*! + * @brief This function sets a value in member fraction + * @param _fraction New value for member fraction + */ + eProsima_user_DllExport void fraction( + uint32_t _fraction) + { + m_fraction = _fraction; + } + + /*! + * @brief This function returns the value of member fraction + * @return Value of member fraction + */ + eProsima_user_DllExport uint32_t fraction() const + { + return m_fraction; + } + + /*! + * @brief This function returns a reference to member fraction + * @return Reference to member fraction + */ + eProsima_user_DllExport uint32_t& fraction() + { + return m_fraction; + } + + + +private: + + uint32_t m_seconds{0}; + uint32_t m_fraction{0}; + +}; +typedef Time_t Timestamp; + +/*! + * @brief This class represents the structure SequenceNumberSet defined by the user in the IDL file. + * @ingroup core_types + */ +class SequenceNumberSet +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumberSet() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumberSet() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceNumberSet that will be copied. + */ + eProsima_user_DllExport SequenceNumberSet( + const SequenceNumberSet& x) + { + m_bitmapBase = x.m_bitmapBase; + + m_numBits = x.m_numBits; + + m_bitmap = x.m_bitmap; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceNumberSet that will be copied. + */ + eProsima_user_DllExport SequenceNumberSet( + SequenceNumberSet&& x) noexcept + { + m_bitmapBase = std::move(x.m_bitmapBase); + m_numBits = x.m_numBits; + m_bitmap = std::move(x.m_bitmap); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceNumberSet that will be copied. + */ + eProsima_user_DllExport SequenceNumberSet& operator =( + const SequenceNumberSet& x) + { + + m_bitmapBase = x.m_bitmapBase; + + m_numBits = x.m_numBits; + + m_bitmap = x.m_bitmap; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceNumberSet that will be copied. + */ + eProsima_user_DllExport SequenceNumberSet& operator =( + SequenceNumberSet&& x) noexcept + { + + m_bitmapBase = std::move(x.m_bitmapBase); + m_numBits = x.m_numBits; + m_bitmap = std::move(x.m_bitmap); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumberSet object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumberSet& x) const + { + return (m_bitmapBase == x.m_bitmapBase && + m_numBits == x.m_numBits && + m_bitmap == x.m_bitmap); + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumberSet object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumberSet& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitmapBase + * @param _bitmapBase New value to be copied in member bitmapBase + */ + eProsima_user_DllExport void bitmapBase( + const SequenceNumber_t& _bitmapBase) + { + m_bitmapBase = _bitmapBase; + } + + /*! + * @brief This function moves the value in member bitmapBase + * @param _bitmapBase New value to be moved in member bitmapBase + */ + eProsima_user_DllExport void bitmapBase( + SequenceNumber_t&& _bitmapBase) + { + m_bitmapBase = std::move(_bitmapBase); + } + + /*! + * @brief This function returns a constant reference to member bitmapBase + * @return Constant reference to member bitmapBase + */ + eProsima_user_DllExport const SequenceNumber_t& bitmapBase() const + { + return m_bitmapBase; + } + + /*! + * @brief This function returns a reference to member bitmapBase + * @return Reference to member bitmapBase + */ + eProsima_user_DllExport SequenceNumber_t& bitmapBase() + { + return m_bitmapBase; + } + + + /*! + * @brief This function sets a value in member numBits + * @param _numBits New value for member numBits + */ + eProsima_user_DllExport void numBits( + uint32_t _numBits) + { + m_numBits = _numBits; + } + + /*! + * @brief This function returns the value of member numBits + * @return Value of member numBits + */ + eProsima_user_DllExport uint32_t numBits() const + { + return m_numBits; + } + + /*! + * @brief This function returns a reference to member numBits + * @return Reference to member numBits + */ + eProsima_user_DllExport uint32_t& numBits() + { + return m_numBits; + } + + + /*! + * @brief This function copies the value in member bitmap + * @param _bitmap New value to be copied in member bitmap + */ + eProsima_user_DllExport void bitmap( + const std::array& _bitmap) + { + m_bitmap = _bitmap; + } + + /*! + * @brief This function moves the value in member bitmap + * @param _bitmap New value to be moved in member bitmap + */ + eProsima_user_DllExport void bitmap( + std::array&& _bitmap) + { + m_bitmap = std::move(_bitmap); + } + + /*! + * @brief This function returns a constant reference to member bitmap + * @return Constant reference to member bitmap + */ + eProsima_user_DllExport const std::array& bitmap() const + { + return m_bitmap; + } + + /*! + * @brief This function returns a reference to member bitmap + * @return Reference to member bitmap + */ + eProsima_user_DllExport std::array& bitmap() + { + return m_bitmap; + } + + + +private: + + SequenceNumber_t m_bitmapBase; + uint32_t m_numBits{0}; + std::array m_bitmap{0}; + +}; +/*! + * @brief This class represents the structure Locator_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Locator_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Locator_t that will be copied. + */ + eProsima_user_DllExport Locator_t( + const Locator_t& x) + { + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Locator_t that will be copied. + */ + eProsima_user_DllExport Locator_t( + Locator_t&& x) noexcept + { + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Locator_t that will be copied. + */ + eProsima_user_DllExport Locator_t& operator =( + const Locator_t& x) + { + + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Locator_t that will be copied. + */ + eProsima_user_DllExport Locator_t& operator =( + Locator_t&& x) noexcept + { + + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Locator_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_t& x) const + { + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); + } + + /*! + * @brief Comparison operator. + * @param x Locator_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind) + { + m_kind = _kind; + } + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const + { + return m_kind; + } + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind() + { + return m_kind; + } + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port) + { + m_port = _port; + } + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const + { + return m_port; + } + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port() + { + return m_port; + } + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address) + { + m_address = _address; + } + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address) + { + m_address = std::move(_address); + } + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const + { + return m_address; + } + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address() + { + return m_address; + } + + + +private: + + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; + +}; +/*! + * @brief This class represents the structure Duration_t defined by the user in the IDL file. + * @ingroup core_types + */ +class Duration_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Duration_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Duration_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Duration_t that will be copied. + */ + eProsima_user_DllExport Duration_t( + const Duration_t& x) + { + m_seconds = x.m_seconds; + + m_fraction = x.m_fraction; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Duration_t that will be copied. + */ + eProsima_user_DllExport Duration_t( + Duration_t&& x) noexcept + { + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Duration_t that will be copied. + */ + eProsima_user_DllExport Duration_t& operator =( + const Duration_t& x) + { + + m_seconds = x.m_seconds; + + m_fraction = x.m_fraction; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Duration_t that will be copied. + */ + eProsima_user_DllExport Duration_t& operator =( + Duration_t&& x) noexcept + { + + m_seconds = x.m_seconds; + m_fraction = x.m_fraction; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Duration_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Duration_t& x) const + { + return (m_seconds == x.m_seconds && + m_fraction == x.m_fraction); + } + + /*! + * @brief Comparison operator. + * @param x Duration_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Duration_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member seconds + * @param _seconds New value for member seconds + */ + eProsima_user_DllExport void seconds( + int32_t _seconds) + { + m_seconds = _seconds; + } + + /*! + * @brief This function returns the value of member seconds + * @return Value of member seconds + */ + eProsima_user_DllExport int32_t seconds() const + { + return m_seconds; + } + + /*! + * @brief This function returns a reference to member seconds + * @return Reference to member seconds + */ + eProsima_user_DllExport int32_t& seconds() + { + return m_seconds; + } + + + /*! + * @brief This function sets a value in member fraction + * @param _fraction New value for member fraction + */ + eProsima_user_DllExport void fraction( + uint32_t _fraction) + { + m_fraction = _fraction; + } + + /*! + * @brief This function returns the value of member fraction + * @return Value of member fraction + */ + eProsima_user_DllExport uint32_t fraction() const + { + return m_fraction; + } + + /*! + * @brief This function returns a reference to member fraction + * @return Reference to member fraction + */ + eProsima_user_DllExport uint32_t& fraction() + { + return m_fraction; + } + + + +private: + + int32_t m_seconds{0}; + uint32_t m_fraction{0}; + +}; +typedef uint32_t DomainId_t; + +typedef uint32_t BuiltinEndpointQos_t; + +/*! + * @brief This class represents the structure StatusInfo_t defined by the user in the IDL file. + * @ingroup core_types + */ +class StatusInfo_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StatusInfo_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StatusInfo_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StatusInfo_t that will be copied. + */ + eProsima_user_DllExport StatusInfo_t( + const StatusInfo_t& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StatusInfo_t that will be copied. + */ + eProsima_user_DllExport StatusInfo_t( + StatusInfo_t&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StatusInfo_t that will be copied. + */ + eProsima_user_DllExport StatusInfo_t& operator =( + const StatusInfo_t& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StatusInfo_t that will be copied. + */ + eProsima_user_DllExport StatusInfo_t& operator =( + StatusInfo_t&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StatusInfo_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StatusInfo_t& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x StatusInfo_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StatusInfo_t& x) const + { + return !(*this == x); + } + + /*! + * @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 std::array& _value) + { + m_value = _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( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure KeyHash_t defined by the user in the IDL file. + * @ingroup core_types + */ +class KeyHash_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyHash_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyHash_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyHash_t that will be copied. + */ + eProsima_user_DllExport KeyHash_t( + const KeyHash_t& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyHash_t that will be copied. + */ + eProsima_user_DllExport KeyHash_t( + KeyHash_t&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyHash_t that will be copied. + */ + eProsima_user_DllExport KeyHash_t& operator =( + const KeyHash_t& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyHash_t that will be copied. + */ + eProsima_user_DllExport KeyHash_t& operator =( + KeyHash_t&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x KeyHash_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyHash_t& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x KeyHash_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyHash_t& x) const + { + return !(*this == x); + } + + /*! + * @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 std::array& _value) + { + m_value = _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( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure EntityName_t defined by the user in the IDL file. + * @ingroup core_types + */ +class EntityName_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityName_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityName_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityName_t that will be copied. + */ + eProsima_user_DllExport EntityName_t( + const EntityName_t& x) + { + m_name = x.m_name; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityName_t that will be copied. + */ + eProsima_user_DllExport EntityName_t( + EntityName_t&& x) noexcept + { + m_name = std::move(x.m_name); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityName_t that will be copied. + */ + eProsima_user_DllExport EntityName_t& operator =( + const EntityName_t& x) + { + + m_name = x.m_name; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityName_t that will be copied. + */ + eProsima_user_DllExport EntityName_t& operator =( + EntityName_t&& x) noexcept + { + + m_name = std::move(x.m_name); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityName_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityName_t& x) const + { + return (m_name == x.m_name); + } + + /*! + * @brief Comparison operator. + * @param x EntityName_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityName_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const std::string& _name) + { + m_name = _name; + } + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + std::string&& _name) + { + m_name = std::move(_name); + } + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const std::string& name() const + { + return m_name; + } + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport std::string& name() + { + return m_name; + } + + + +private: + + std::string m_name; + +}; + +} // namespace detail +/*! + * @brief This class represents the structure Header defined by the user in the IDL file. + * @ingroup core_types + */ +class Header +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Header that will be copied. + */ + eProsima_user_DllExport Header( + const Header& x) + { + m_prefix = x.m_prefix; + + m_version = x.m_version; + + m_vendorId = x.m_vendorId; + + m_guidPrefix = x.m_guidPrefix; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Header that will be copied. + */ + eProsima_user_DllExport Header( + Header&& x) noexcept + { + m_prefix = std::move(x.m_prefix); + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + const Header& x) + { + + m_prefix = x.m_prefix; + + m_version = x.m_version; + + m_vendorId = x.m_vendorId; + + m_guidPrefix = x.m_guidPrefix; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + Header&& x) noexcept + { + + m_prefix = std::move(x.m_prefix); + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Header object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Header& x) const + { + return (m_prefix == x.m_prefix && + m_version == x.m_version && + m_vendorId == x.m_vendorId && + m_guidPrefix == x.m_guidPrefix); + } + + /*! + * @brief Comparison operator. + * @param x Header object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Header& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member prefix + * @param _prefix New value to be copied in member prefix + */ + eProsima_user_DllExport void prefix( + const std::array& _prefix) + { + m_prefix = _prefix; + } + + /*! + * @brief This function moves the value in member prefix + * @param _prefix New value to be moved in member prefix + */ + eProsima_user_DllExport void prefix( + std::array&& _prefix) + { + m_prefix = std::move(_prefix); + } + + /*! + * @brief This function returns a constant reference to member prefix + * @return Constant reference to member prefix + */ + eProsima_user_DllExport const std::array& prefix() const + { + return m_prefix; + } + + /*! + * @brief This function returns a reference to member prefix + * @return Reference to member prefix + */ + eProsima_user_DllExport std::array& prefix() + { + return m_prefix; + } + + + /*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ + eProsima_user_DllExport void version( + const detail::ProtocolVersion_t& _version) + { + m_version = _version; + } + + /*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ + eProsima_user_DllExport void version( + detail::ProtocolVersion_t&& _version) + { + m_version = std::move(_version); + } + + /*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ + eProsima_user_DllExport const detail::ProtocolVersion_t& version() const + { + return m_version; + } + + /*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ + eProsima_user_DllExport detail::ProtocolVersion_t& version() + { + return m_version; + } + + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const detail::VendorId_t& _vendorId) + { + m_vendorId = _vendorId; + } + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + detail::VendorId_t&& _vendorId) + { + m_vendorId = std::move(_vendorId); + } + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const detail::VendorId_t& vendorId() const + { + return m_vendorId; + } + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport detail::VendorId_t& vendorId() + { + return m_vendorId; + } + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const detail::GuidPrefix_t& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + detail::GuidPrefix_t&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const detail::GuidPrefix_t& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport detail::GuidPrefix_t& guidPrefix() + { + return m_guidPrefix; + } + + + +private: + + std::array m_prefix{0}; + detail::ProtocolVersion_t m_version; + detail::VendorId_t m_vendorId; + detail::GuidPrefix_t m_guidPrefix; + +}; +/*! + * @brief This class represents the structure SubmessageHeader defined by the user in the IDL file. + * @ingroup core_types + */ +class SubmessageHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SubmessageHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SubmessageHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader( + const SubmessageHeader& x) + { + m_submessageId = x.m_submessageId; + + m_flags = x.m_flags; + + m_submessageLength = x.m_submessageLength; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader( + SubmessageHeader&& x) noexcept + { + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader& operator =( + const SubmessageHeader& x) + { + + m_submessageId = x.m_submessageId; + + m_flags = x.m_flags; + + m_submessageLength = x.m_submessageLength; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SubmessageHeader that will be copied. + */ + eProsima_user_DllExport SubmessageHeader& operator =( + SubmessageHeader&& x) noexcept + { + + m_submessageId = x.m_submessageId; + m_flags = x.m_flags; + m_submessageLength = x.m_submessageLength; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SubmessageHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SubmessageHeader& x) const + { + return (m_submessageId == x.m_submessageId && + m_flags == x.m_flags && + m_submessageLength == x.m_submessageLength); + } + + /*! + * @brief Comparison operator. + * @param x SubmessageHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SubmessageHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member submessageId + * @param _submessageId New value for member submessageId + */ + eProsima_user_DllExport void submessageId( + uint8_t _submessageId) + { + m_submessageId = _submessageId; + } + + /*! + * @brief This function returns the value of member submessageId + * @return Value of member submessageId + */ + eProsima_user_DllExport uint8_t submessageId() const + { + return m_submessageId; + } + + /*! + * @brief This function returns a reference to member submessageId + * @return Reference to member submessageId + */ + eProsima_user_DllExport uint8_t& submessageId() + { + return m_submessageId; + } + + + /*! + * @brief This function sets a value in member flags + * @param _flags New value for member flags + */ + eProsima_user_DllExport void flags( + uint8_t _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function returns the value of member flags + * @return Value of member flags + */ + eProsima_user_DllExport uint8_t flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport uint8_t& flags() + { + return m_flags; + } + + + /*! + * @brief This function sets a value in member submessageLength + * @param _submessageLength New value for member submessageLength + */ + eProsima_user_DllExport void submessageLength( + uint16_t _submessageLength) + { + m_submessageLength = _submessageLength; + } + + /*! + * @brief This function returns the value of member submessageLength + * @return Value of member submessageLength + */ + eProsima_user_DllExport uint16_t submessageLength() const + { + return m_submessageLength; + } + + /*! + * @brief This function returns a reference to member submessageLength + * @return Reference to member submessageLength + */ + eProsima_user_DllExport uint16_t& submessageLength() + { + return m_submessageLength; + } + + + +private: + + uint8_t m_submessageId{0}; + uint8_t m_flags{0}; + uint16_t m_submessageLength{0}; + +}; +namespace SubmessageKind { + +const char RTPS_HE = 0x00; +const char PAD = 0x01; +const char ACKNACK = 0x06; +const char HEARTBEAT = 0x07; +const char GAP = 0x08; +const char INFO_TS = 0x09; +const char INFO_SRC = 0x0c; +const char INFO_REPLY_IP4 = 0x0d; +const char INFO_DST = 0x0e; +const char INFO_REPLY = 0x0f; +const char NACK_FRAG = 0x12; +const char HEARTBEAT_FRAG = 0x13; +const char DATA = 0x15; +const char DATA_FRAG = 0x16; + +} // namespace SubmessageKind +/*! + * @brief This class represents the structure AckNackSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class AckNackSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AckNackSubmessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AckNackSubmessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AckNackSubmessage that will be copied. + */ + eProsima_user_DllExport AckNackSubmessage( + const AckNackSubmessage& x) + { + m_submsgHeader = x.m_submsgHeader; + + m_readerId = x.m_readerId; + + m_writerId = x.m_writerId; + + m_readerSNState = x.m_readerSNState; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AckNackSubmessage that will be copied. + */ + eProsima_user_DllExport AckNackSubmessage( + AckNackSubmessage&& x) noexcept + { + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_readerSNState = std::move(x.m_readerSNState); + m_count = std::move(x.m_count); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AckNackSubmessage that will be copied. + */ + eProsima_user_DllExport AckNackSubmessage& operator =( + const AckNackSubmessage& x) + { + + m_submsgHeader = x.m_submsgHeader; + + m_readerId = x.m_readerId; + + m_writerId = x.m_writerId; + + m_readerSNState = x.m_readerSNState; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AckNackSubmessage that will be copied. + */ + eProsima_user_DllExport AckNackSubmessage& operator =( + AckNackSubmessage&& x) noexcept + { + + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_readerSNState = std::move(x.m_readerSNState); + m_count = std::move(x.m_count); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AckNackSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AckNackSubmessage& x) const + { + return (m_submsgHeader == x.m_submsgHeader && + m_readerId == x.m_readerId && + m_writerId == x.m_writerId && + m_readerSNState == x.m_readerSNState && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x AckNackSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AckNackSubmessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const SubmessageHeader& _submsgHeader) + { + m_submsgHeader = _submsgHeader; + } + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + SubmessageHeader&& _submsgHeader) + { + m_submsgHeader = std::move(_submsgHeader); + } + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const SubmessageHeader& submsgHeader() const + { + return m_submsgHeader; + } + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport SubmessageHeader& submsgHeader() + { + return m_submsgHeader; + } + + + /*! + * @brief This function copies the value in member readerId + * @param _readerId New value to be copied in member readerId + */ + eProsima_user_DllExport void readerId( + const detail::EntityId_t& _readerId) + { + m_readerId = _readerId; + } + + /*! + * @brief This function moves the value in member readerId + * @param _readerId New value to be moved in member readerId + */ + eProsima_user_DllExport void readerId( + detail::EntityId_t&& _readerId) + { + m_readerId = std::move(_readerId); + } + + /*! + * @brief This function returns a constant reference to member readerId + * @return Constant reference to member readerId + */ + eProsima_user_DllExport const detail::EntityId_t& readerId() const + { + return m_readerId; + } + + /*! + * @brief This function returns a reference to member readerId + * @return Reference to member readerId + */ + eProsima_user_DllExport detail::EntityId_t& readerId() + { + return m_readerId; + } + + + /*! + * @brief This function copies the value in member writerId + * @param _writerId New value to be copied in member writerId + */ + eProsima_user_DllExport void writerId( + const detail::EntityId_t& _writerId) + { + m_writerId = _writerId; + } + + /*! + * @brief This function moves the value in member writerId + * @param _writerId New value to be moved in member writerId + */ + eProsima_user_DllExport void writerId( + detail::EntityId_t&& _writerId) + { + m_writerId = std::move(_writerId); + } + + /*! + * @brief This function returns a constant reference to member writerId + * @return Constant reference to member writerId + */ + eProsima_user_DllExport const detail::EntityId_t& writerId() const + { + return m_writerId; + } + + /*! + * @brief This function returns a reference to member writerId + * @return Reference to member writerId + */ + eProsima_user_DllExport detail::EntityId_t& writerId() + { + return m_writerId; + } + + + /*! + * @brief This function copies the value in member readerSNState + * @param _readerSNState New value to be copied in member readerSNState + */ + eProsima_user_DllExport void readerSNState( + const detail::SequenceNumberSet& _readerSNState) + { + m_readerSNState = _readerSNState; + } + + /*! + * @brief This function moves the value in member readerSNState + * @param _readerSNState New value to be moved in member readerSNState + */ + eProsima_user_DllExport void readerSNState( + detail::SequenceNumberSet&& _readerSNState) + { + m_readerSNState = std::move(_readerSNState); + } + + /*! + * @brief This function returns a constant reference to member readerSNState + * @return Constant reference to member readerSNState + */ + eProsima_user_DllExport const detail::SequenceNumberSet& readerSNState() const + { + return m_readerSNState; + } + + /*! + * @brief This function returns a reference to member readerSNState + * @return Reference to member readerSNState + */ + eProsima_user_DllExport detail::SequenceNumberSet& readerSNState() + { + return m_readerSNState; + } + + + /*! + * @brief This function copies the value in member count + * @param _count New value to be copied in member count + */ + eProsima_user_DllExport void count( + const detail::Count_t& _count) + { + m_count = _count; + } + + /*! + * @brief This function moves the value in member count + * @param _count New value to be moved in member count + */ + eProsima_user_DllExport void count( + detail::Count_t&& _count) + { + m_count = std::move(_count); + } + + /*! + * @brief This function returns a constant reference to member count + * @return Constant reference to member count + */ + eProsima_user_DllExport const detail::Count_t& count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport detail::Count_t& count() + { + return m_count; + } + + + +private: + + SubmessageHeader m_submsgHeader; + detail::EntityId_t m_readerId; + detail::EntityId_t m_writerId; + detail::SequenceNumberSet m_readerSNState; + detail::Count_t m_count; + +}; +/*! + * @brief This class represents the structure HeartBeatSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class HeartBeatSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeartBeatSubmessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeartBeatSubmessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage( + const HeartBeatSubmessage& x) + { + m_submsgHeader = x.m_submsgHeader; + + m_readerId = x.m_readerId; + + m_writerId = x.m_writerId; + + m_firstSN = x.m_firstSN; + + m_lastSN = x.m_lastSN; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage( + HeartBeatSubmessage&& x) noexcept + { + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_firstSN = std::move(x.m_firstSN); + m_lastSN = std::move(x.m_lastSN); + m_count = std::move(x.m_count); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage& operator =( + const HeartBeatSubmessage& x) + { + + m_submsgHeader = x.m_submsgHeader; + + m_readerId = x.m_readerId; + + m_writerId = x.m_writerId; + + m_firstSN = x.m_firstSN; + + m_lastSN = x.m_lastSN; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HeartBeatSubmessage that will be copied. + */ + eProsima_user_DllExport HeartBeatSubmessage& operator =( + HeartBeatSubmessage&& x) noexcept + { + + m_submsgHeader = std::move(x.m_submsgHeader); + m_readerId = std::move(x.m_readerId); + m_writerId = std::move(x.m_writerId); + m_firstSN = std::move(x.m_firstSN); + m_lastSN = std::move(x.m_lastSN); + m_count = std::move(x.m_count); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HeartBeatSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeartBeatSubmessage& x) const + { + return (m_submsgHeader == x.m_submsgHeader && + m_readerId == x.m_readerId && + m_writerId == x.m_writerId && + m_firstSN == x.m_firstSN && + m_lastSN == x.m_lastSN && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x HeartBeatSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeartBeatSubmessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const SubmessageHeader& _submsgHeader) + { + m_submsgHeader = _submsgHeader; + } + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + SubmessageHeader&& _submsgHeader) + { + m_submsgHeader = std::move(_submsgHeader); + } + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const SubmessageHeader& submsgHeader() const + { + return m_submsgHeader; + } + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport SubmessageHeader& submsgHeader() + { + return m_submsgHeader; + } + + + /*! + * @brief This function copies the value in member readerId + * @param _readerId New value to be copied in member readerId + */ + eProsima_user_DllExport void readerId( + const detail::EntityId_t& _readerId) + { + m_readerId = _readerId; + } + + /*! + * @brief This function moves the value in member readerId + * @param _readerId New value to be moved in member readerId + */ + eProsima_user_DllExport void readerId( + detail::EntityId_t&& _readerId) + { + m_readerId = std::move(_readerId); + } + + /*! + * @brief This function returns a constant reference to member readerId + * @return Constant reference to member readerId + */ + eProsima_user_DllExport const detail::EntityId_t& readerId() const + { + return m_readerId; + } + + /*! + * @brief This function returns a reference to member readerId + * @return Reference to member readerId + */ + eProsima_user_DllExport detail::EntityId_t& readerId() + { + return m_readerId; + } + + + /*! + * @brief This function copies the value in member writerId + * @param _writerId New value to be copied in member writerId + */ + eProsima_user_DllExport void writerId( + const detail::EntityId_t& _writerId) + { + m_writerId = _writerId; + } + + /*! + * @brief This function moves the value in member writerId + * @param _writerId New value to be moved in member writerId + */ + eProsima_user_DllExport void writerId( + detail::EntityId_t&& _writerId) + { + m_writerId = std::move(_writerId); + } + + /*! + * @brief This function returns a constant reference to member writerId + * @return Constant reference to member writerId + */ + eProsima_user_DllExport const detail::EntityId_t& writerId() const + { + return m_writerId; + } + + /*! + * @brief This function returns a reference to member writerId + * @return Reference to member writerId + */ + eProsima_user_DllExport detail::EntityId_t& writerId() + { + return m_writerId; + } + + + /*! + * @brief This function copies the value in member firstSN + * @param _firstSN New value to be copied in member firstSN + */ + eProsima_user_DllExport void firstSN( + const detail::SequenceNumber_t& _firstSN) + { + m_firstSN = _firstSN; + } + + /*! + * @brief This function moves the value in member firstSN + * @param _firstSN New value to be moved in member firstSN + */ + eProsima_user_DllExport void firstSN( + detail::SequenceNumber_t&& _firstSN) + { + m_firstSN = std::move(_firstSN); + } + + /*! + * @brief This function returns a constant reference to member firstSN + * @return Constant reference to member firstSN + */ + eProsima_user_DllExport const detail::SequenceNumber_t& firstSN() const + { + return m_firstSN; + } + + /*! + * @brief This function returns a reference to member firstSN + * @return Reference to member firstSN + */ + eProsima_user_DllExport detail::SequenceNumber_t& firstSN() + { + return m_firstSN; + } + + + /*! + * @brief This function copies the value in member lastSN + * @param _lastSN New value to be copied in member lastSN + */ + eProsima_user_DllExport void lastSN( + const detail::SequenceNumber_t& _lastSN) + { + m_lastSN = _lastSN; + } + + /*! + * @brief This function moves the value in member lastSN + * @param _lastSN New value to be moved in member lastSN + */ + eProsima_user_DllExport void lastSN( + detail::SequenceNumber_t&& _lastSN) + { + m_lastSN = std::move(_lastSN); + } + + /*! + * @brief This function returns a constant reference to member lastSN + * @return Constant reference to member lastSN + */ + eProsima_user_DllExport const detail::SequenceNumber_t& lastSN() const + { + return m_lastSN; + } + + /*! + * @brief This function returns a reference to member lastSN + * @return Reference to member lastSN + */ + eProsima_user_DllExport detail::SequenceNumber_t& lastSN() + { + return m_lastSN; + } + + + /*! + * @brief This function copies the value in member count + * @param _count New value to be copied in member count + */ + eProsima_user_DllExport void count( + const detail::Count_t& _count) + { + m_count = _count; + } + + /*! + * @brief This function moves the value in member count + * @param _count New value to be moved in member count + */ + eProsima_user_DllExport void count( + detail::Count_t&& _count) + { + m_count = std::move(_count); + } + + /*! + * @brief This function returns a constant reference to member count + * @return Constant reference to member count + */ + eProsima_user_DllExport const detail::Count_t& count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport detail::Count_t& count() + { + return m_count; + } + + + +private: + + SubmessageHeader m_submsgHeader; + detail::EntityId_t m_readerId; + detail::EntityId_t m_writerId; + detail::SequenceNumber_t m_firstSN; + detail::SequenceNumber_t m_lastSN; + detail::Count_t m_count; + +}; +/*! + * @brief This class represents the structure InfoDestinationSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoDestinationSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoDestinationSubmessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoDestinationSubmessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage( + const InfoDestinationSubmessage& x) + { + m_submsgHeader = x.m_submsgHeader; + + m_guidPrefix = x.m_guidPrefix; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage( + InfoDestinationSubmessage&& x) noexcept + { + m_submsgHeader = std::move(x.m_submsgHeader); + m_guidPrefix = std::move(x.m_guidPrefix); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage& operator =( + const InfoDestinationSubmessage& x) + { + + m_submsgHeader = x.m_submsgHeader; + + m_guidPrefix = x.m_guidPrefix; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object InfoDestinationSubmessage that will be copied. + */ + eProsima_user_DllExport InfoDestinationSubmessage& operator =( + InfoDestinationSubmessage&& x) noexcept + { + + m_submsgHeader = std::move(x.m_submsgHeader); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x InfoDestinationSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoDestinationSubmessage& x) const + { + return (m_submsgHeader == x.m_submsgHeader && + m_guidPrefix == x.m_guidPrefix); + } + + /*! + * @brief Comparison operator. + * @param x InfoDestinationSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoDestinationSubmessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const SubmessageHeader& _submsgHeader) + { + m_submsgHeader = _submsgHeader; + } + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + SubmessageHeader&& _submsgHeader) + { + m_submsgHeader = std::move(_submsgHeader); + } + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const SubmessageHeader& submsgHeader() const + { + return m_submsgHeader; + } + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport SubmessageHeader& submsgHeader() + { + return m_submsgHeader; + } + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const detail::GuidPrefix_t& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + detail::GuidPrefix_t&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const detail::GuidPrefix_t& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport detail::GuidPrefix_t& guidPrefix() + { + return m_guidPrefix; + } + + + +private: + + SubmessageHeader m_submsgHeader; + detail::GuidPrefix_t m_guidPrefix; + +}; +/*! + * @brief This class represents the structure InfoSourceSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoSourceSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoSourceSubmessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoSourceSubmessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage( + const InfoSourceSubmessage& x) + { + m_submsgHeader = x.m_submsgHeader; + + m_unused = x.m_unused; + + m_version = x.m_version; + + m_vendorId = x.m_vendorId; + + m_guidPrefix = x.m_guidPrefix; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage( + InfoSourceSubmessage&& x) noexcept + { + m_submsgHeader = std::move(x.m_submsgHeader); + m_unused = x.m_unused; + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage& operator =( + const InfoSourceSubmessage& x) + { + + m_submsgHeader = x.m_submsgHeader; + + m_unused = x.m_unused; + + m_version = x.m_version; + + m_vendorId = x.m_vendorId; + + m_guidPrefix = x.m_guidPrefix; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object InfoSourceSubmessage that will be copied. + */ + eProsima_user_DllExport InfoSourceSubmessage& operator =( + InfoSourceSubmessage&& x) noexcept + { + + m_submsgHeader = std::move(x.m_submsgHeader); + m_unused = x.m_unused; + m_version = std::move(x.m_version); + m_vendorId = std::move(x.m_vendorId); + m_guidPrefix = std::move(x.m_guidPrefix); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x InfoSourceSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoSourceSubmessage& x) const + { + return (m_submsgHeader == x.m_submsgHeader && + m_unused == x.m_unused && + m_version == x.m_version && + m_vendorId == x.m_vendorId && + m_guidPrefix == x.m_guidPrefix); + } + + /*! + * @brief Comparison operator. + * @param x InfoSourceSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoSourceSubmessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const SubmessageHeader& _submsgHeader) + { + m_submsgHeader = _submsgHeader; + } + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + SubmessageHeader&& _submsgHeader) + { + m_submsgHeader = std::move(_submsgHeader); + } + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const SubmessageHeader& submsgHeader() const + { + return m_submsgHeader; + } + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport SubmessageHeader& submsgHeader() + { + return m_submsgHeader; + } + + + /*! + * @brief This function sets a value in member unused + * @param _unused New value for member unused + */ + eProsima_user_DllExport void unused( + int32_t _unused) + { + m_unused = _unused; + } + + /*! + * @brief This function returns the value of member unused + * @return Value of member unused + */ + eProsima_user_DllExport int32_t unused() const + { + return m_unused; + } + + /*! + * @brief This function returns a reference to member unused + * @return Reference to member unused + */ + eProsima_user_DllExport int32_t& unused() + { + return m_unused; + } + + + /*! + * @brief This function copies the value in member version + * @param _version New value to be copied in member version + */ + eProsima_user_DllExport void version( + const detail::ProtocolVersion_t& _version) + { + m_version = _version; + } + + /*! + * @brief This function moves the value in member version + * @param _version New value to be moved in member version + */ + eProsima_user_DllExport void version( + detail::ProtocolVersion_t&& _version) + { + m_version = std::move(_version); + } + + /*! + * @brief This function returns a constant reference to member version + * @return Constant reference to member version + */ + eProsima_user_DllExport const detail::ProtocolVersion_t& version() const + { + return m_version; + } + + /*! + * @brief This function returns a reference to member version + * @return Reference to member version + */ + eProsima_user_DllExport detail::ProtocolVersion_t& version() + { + return m_version; + } + + + /*! + * @brief This function copies the value in member vendorId + * @param _vendorId New value to be copied in member vendorId + */ + eProsima_user_DllExport void vendorId( + const detail::VendorId_t& _vendorId) + { + m_vendorId = _vendorId; + } + + /*! + * @brief This function moves the value in member vendorId + * @param _vendorId New value to be moved in member vendorId + */ + eProsima_user_DllExport void vendorId( + detail::VendorId_t&& _vendorId) + { + m_vendorId = std::move(_vendorId); + } + + /*! + * @brief This function returns a constant reference to member vendorId + * @return Constant reference to member vendorId + */ + eProsima_user_DllExport const detail::VendorId_t& vendorId() const + { + return m_vendorId; + } + + /*! + * @brief This function returns a reference to member vendorId + * @return Reference to member vendorId + */ + eProsima_user_DllExport detail::VendorId_t& vendorId() + { + return m_vendorId; + } + + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const detail::GuidPrefix_t& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + detail::GuidPrefix_t&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const detail::GuidPrefix_t& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport detail::GuidPrefix_t& guidPrefix() + { + return m_guidPrefix; + } + + + +private: + + SubmessageHeader m_submsgHeader; + int32_t m_unused{0}; + detail::ProtocolVersion_t m_version; + detail::VendorId_t m_vendorId; + detail::GuidPrefix_t m_guidPrefix; + +}; +/*! + * @brief This class represents the structure InfoTimestampSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ +class InfoTimestampSubmessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport InfoTimestampSubmessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~InfoTimestampSubmessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage( + const InfoTimestampSubmessage& x) + { + m_submsgHeader = x.m_submsgHeader; + + m_timestamp = x.m_timestamp; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage( + InfoTimestampSubmessage&& x) noexcept + { + m_submsgHeader = std::move(x.m_submsgHeader); + m_timestamp = std::move(x.m_timestamp); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage& operator =( + const InfoTimestampSubmessage& x) + { + + m_submsgHeader = x.m_submsgHeader; + + m_timestamp = x.m_timestamp; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object InfoTimestampSubmessage that will be copied. + */ + eProsima_user_DllExport InfoTimestampSubmessage& operator =( + InfoTimestampSubmessage&& x) noexcept + { + + m_submsgHeader = std::move(x.m_submsgHeader); + m_timestamp = std::move(x.m_timestamp); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x InfoTimestampSubmessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const InfoTimestampSubmessage& x) const + { + return (m_submsgHeader == x.m_submsgHeader && + m_timestamp == x.m_timestamp); + } + + /*! + * @brief Comparison operator. + * @param x InfoTimestampSubmessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const InfoTimestampSubmessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member submsgHeader + * @param _submsgHeader New value to be copied in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + const SubmessageHeader& _submsgHeader) + { + m_submsgHeader = _submsgHeader; + } + + /*! + * @brief This function moves the value in member submsgHeader + * @param _submsgHeader New value to be moved in member submsgHeader + */ + eProsima_user_DllExport void submsgHeader( + SubmessageHeader&& _submsgHeader) + { + m_submsgHeader = std::move(_submsgHeader); + } + + /*! + * @brief This function returns a constant reference to member submsgHeader + * @return Constant reference to member submsgHeader + */ + eProsima_user_DllExport const SubmessageHeader& submsgHeader() const + { + return m_submsgHeader; + } + + /*! + * @brief This function returns a reference to member submsgHeader + * @return Reference to member submsgHeader + */ + eProsima_user_DllExport SubmessageHeader& submsgHeader() + { + return m_submsgHeader; + } + + + /*! + * @brief This function copies the value in member timestamp + * @param _timestamp New value to be copied in member timestamp + */ + eProsima_user_DllExport void timestamp( + const detail::Timestamp& _timestamp) + { + m_timestamp = _timestamp; + } + + /*! + * @brief This function moves the value in member timestamp + * @param _timestamp New value to be moved in member timestamp + */ + eProsima_user_DllExport void timestamp( + detail::Timestamp&& _timestamp) + { + m_timestamp = std::move(_timestamp); + } + + /*! + * @brief This function returns a constant reference to member timestamp + * @return Constant reference to member timestamp + */ + eProsima_user_DllExport const detail::Timestamp& timestamp() const + { + return m_timestamp; + } + + /*! + * @brief This function returns a reference to member timestamp + * @return Reference to member timestamp + */ + eProsima_user_DllExport detail::Timestamp& timestamp() + { + return m_timestamp; + } + + + +private: + + SubmessageHeader m_submsgHeader; + detail::Timestamp m_timestamp; + +}; +/*! + * @brief This class represents the union Submessage defined by the user in the IDL file. + * @ingroup core_types + */ +class Submessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Submessage() + { + unknown_submsg_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Submessage() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Submessage that will be copied. + */ + eProsima_user_DllExport Submessage( + const Submessage& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + heartbeat_submsg_() = x.m_heartbeat_submsg; + break; + + case 0x00000002: + info_ts_submsg_() = x.m_info_ts_submsg; + break; + + case 0x00000003: + info_src_submsg_() = x.m_info_src_submsg; + break; + + case 0x00000004: + info_dst_submsg_() = x.m_info_dst_submsg; + break; + + case 0x00000005: + unknown_submsg_() = x.m_unknown_submsg; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Submessage that will be copied. + */ + eProsima_user_DllExport Submessage( + Submessage&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + heartbeat_submsg_() = std::move(x.m_heartbeat_submsg); + break; + + case 0x00000002: + info_ts_submsg_() = std::move(x.m_info_ts_submsg); + break; + + case 0x00000003: + info_src_submsg_() = std::move(x.m_info_src_submsg); + break; + + case 0x00000004: + info_dst_submsg_() = std::move(x.m_info_dst_submsg); + break; + + case 0x00000005: + unknown_submsg_() = std::move(x.m_unknown_submsg); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Submessage that will be copied. + */ + eProsima_user_DllExport Submessage& operator =( + const Submessage& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + heartbeat_submsg_() = x.m_heartbeat_submsg; + break; + + case 0x00000002: + info_ts_submsg_() = x.m_info_ts_submsg; + break; + + case 0x00000003: + info_src_submsg_() = x.m_info_src_submsg; + break; + + case 0x00000004: + info_dst_submsg_() = x.m_info_dst_submsg; + break; + + case 0x00000005: + unknown_submsg_() = x.m_unknown_submsg; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Submessage that will be copied. + */ + eProsima_user_DllExport Submessage& operator =( + Submessage&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + heartbeat_submsg_() = std::move(x.m_heartbeat_submsg); + break; + + case 0x00000002: + info_ts_submsg_() = std::move(x.m_info_ts_submsg); + break; + + case 0x00000003: + info_src_submsg_() = std::move(x.m_info_src_submsg); + break; + + case 0x00000004: + info_dst_submsg_() = std::move(x.m_info_dst_submsg); + break; + + case 0x00000005: + unknown_submsg_() = std::move(x.m_unknown_submsg); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Submessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Submessage& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_heartbeat_submsg == x.m_heartbeat_submsg); + break; + + case 0x00000002: + ret_value = (m_info_ts_submsg == x.m_info_ts_submsg); + break; + + case 0x00000003: + ret_value = (m_info_src_submsg == x.m_info_src_submsg); + break; + + case 0x00000004: + ret_value = (m_info_dst_submsg == x.m_info_dst_submsg); + break; + + case 0x00000005: + ret_value = (m_unknown_submsg == x.m_unknown_submsg); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x Submessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Submessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + char __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case SubmessageKind::HEARTBEAT: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case SubmessageKind::INFO_TS: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case SubmessageKind::INFO_SRC: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case SubmessageKind::INFO_DST: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport char _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member heartbeat_submsg + * @param _heartbeat_submsg New value to be copied in member heartbeat_submsg + */ + eProsima_user_DllExport void heartbeat_submsg( + const HeartBeatSubmessage& _heartbeat_submsg) + { + heartbeat_submsg_() = _heartbeat_submsg; + m__d = SubmessageKind::HEARTBEAT; + } + + /*! + * @brief This function moves the value in member heartbeat_submsg + * @param _heartbeat_submsg New value to be moved in member heartbeat_submsg + */ + eProsima_user_DllExport void heartbeat_submsg( + HeartBeatSubmessage&& _heartbeat_submsg) + { + heartbeat_submsg_() = _heartbeat_submsg; + m__d = SubmessageKind::HEARTBEAT; + } + + /*! + * @brief This function returns a constant reference to member heartbeat_submsg + * @return Constant reference to member heartbeat_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const HeartBeatSubmessage& heartbeat_submsg() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_heartbeat_submsg; + } + + /*! + * @brief This function returns a reference to member heartbeat_submsg + * @return Reference to member heartbeat_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport HeartBeatSubmessage& heartbeat_submsg() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_heartbeat_submsg; + } + + + /*! + * @brief This function copies the value in member info_ts_submsg + * @param _info_ts_submsg New value to be copied in member info_ts_submsg + */ + eProsima_user_DllExport void info_ts_submsg( + const InfoTimestampSubmessage& _info_ts_submsg) + { + info_ts_submsg_() = _info_ts_submsg; + m__d = SubmessageKind::INFO_TS; + } + + /*! + * @brief This function moves the value in member info_ts_submsg + * @param _info_ts_submsg New value to be moved in member info_ts_submsg + */ + eProsima_user_DllExport void info_ts_submsg( + InfoTimestampSubmessage&& _info_ts_submsg) + { + info_ts_submsg_() = _info_ts_submsg; + m__d = SubmessageKind::INFO_TS; + } + + /*! + * @brief This function returns a constant reference to member info_ts_submsg + * @return Constant reference to member info_ts_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const InfoTimestampSubmessage& info_ts_submsg() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_ts_submsg; + } + + /*! + * @brief This function returns a reference to member info_ts_submsg + * @return Reference to member info_ts_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport InfoTimestampSubmessage& info_ts_submsg() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_ts_submsg; + } + + + /*! + * @brief This function copies the value in member info_src_submsg + * @param _info_src_submsg New value to be copied in member info_src_submsg + */ + eProsima_user_DllExport void info_src_submsg( + const InfoSourceSubmessage& _info_src_submsg) + { + info_src_submsg_() = _info_src_submsg; + m__d = SubmessageKind::INFO_SRC; + } + + /*! + * @brief This function moves the value in member info_src_submsg + * @param _info_src_submsg New value to be moved in member info_src_submsg + */ + eProsima_user_DllExport void info_src_submsg( + InfoSourceSubmessage&& _info_src_submsg) + { + info_src_submsg_() = _info_src_submsg; + m__d = SubmessageKind::INFO_SRC; + } + + /*! + * @brief This function returns a constant reference to member info_src_submsg + * @return Constant reference to member info_src_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const InfoSourceSubmessage& info_src_submsg() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_src_submsg; + } + + /*! + * @brief This function returns a reference to member info_src_submsg + * @return Reference to member info_src_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport InfoSourceSubmessage& info_src_submsg() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_src_submsg; + } + + + /*! + * @brief This function copies the value in member info_dst_submsg + * @param _info_dst_submsg New value to be copied in member info_dst_submsg + */ + eProsima_user_DllExport void info_dst_submsg( + const InfoDestinationSubmessage& _info_dst_submsg) + { + info_dst_submsg_() = _info_dst_submsg; + m__d = SubmessageKind::INFO_DST; + } + + /*! + * @brief This function moves the value in member info_dst_submsg + * @param _info_dst_submsg New value to be moved in member info_dst_submsg + */ + eProsima_user_DllExport void info_dst_submsg( + InfoDestinationSubmessage&& _info_dst_submsg) + { + info_dst_submsg_() = _info_dst_submsg; + m__d = SubmessageKind::INFO_DST; + } + + /*! + * @brief This function returns a constant reference to member info_dst_submsg + * @return Constant reference to member info_dst_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const InfoDestinationSubmessage& info_dst_submsg() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_dst_submsg; + } + + /*! + * @brief This function returns a reference to member info_dst_submsg + * @return Reference to member info_dst_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport InfoDestinationSubmessage& info_dst_submsg() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_info_dst_submsg; + } + + + /*! + * @brief This function copies the value in member unknown_submsg + * @param _unknown_submsg New value to be copied in member unknown_submsg + */ + eProsima_user_DllExport void unknown_submsg( + const SubmessageHeader& _unknown_submsg) + { + unknown_submsg_() = _unknown_submsg; + m__d = 1; + } + + /*! + * @brief This function moves the value in member unknown_submsg + * @param _unknown_submsg New value to be moved in member unknown_submsg + */ + eProsima_user_DllExport void unknown_submsg( + SubmessageHeader&& _unknown_submsg) + { + unknown_submsg_() = _unknown_submsg; + m__d = 1; + } + + /*! + * @brief This function returns a constant reference to member unknown_submsg + * @return Constant reference to member unknown_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SubmessageHeader& unknown_submsg() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_unknown_submsg; + } + + /*! + * @brief This function returns a reference to member unknown_submsg + * @return Reference to member unknown_submsg + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SubmessageHeader& unknown_submsg() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_unknown_submsg; + } + + + +private: + + HeartBeatSubmessage& heartbeat_submsg_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_heartbeat_submsg.~HeartBeatSubmessage();}; + new(&m_heartbeat_submsg) HeartBeatSubmessage(); + ; + } + + return m_heartbeat_submsg; + } + + InfoTimestampSubmessage& info_ts_submsg_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_info_ts_submsg.~InfoTimestampSubmessage();}; + new(&m_info_ts_submsg) InfoTimestampSubmessage(); + ; + } + + return m_info_ts_submsg; + } + + InfoSourceSubmessage& info_src_submsg_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_info_src_submsg.~InfoSourceSubmessage();}; + new(&m_info_src_submsg) InfoSourceSubmessage(); + ; + } + + return m_info_src_submsg; + } + + InfoDestinationSubmessage& info_dst_submsg_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_info_dst_submsg.~InfoDestinationSubmessage();}; + new(&m_info_dst_submsg) InfoDestinationSubmessage(); + ; + } + + return m_info_dst_submsg; + } + + SubmessageHeader& unknown_submsg_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_unknown_submsg.~SubmessageHeader();}; + new(&m_unknown_submsg) SubmessageHeader(); + ; + } + + return m_unknown_submsg; + } + + + char m__d {1}; + + union + { + HeartBeatSubmessage m_heartbeat_submsg; + InfoTimestampSubmessage m_info_ts_submsg; + InfoSourceSubmessage m_info_src_submsg; + InfoDestinationSubmessage m_info_dst_submsg; + SubmessageHeader m_unknown_submsg; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure RTPSMessage defined by the user in the IDL file. + * @ingroup core_types + */ +class RTPSMessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RTPSMessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RTPSMessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage( + const RTPSMessage& x) + { + m_msg_header = x.m_msg_header; + + m_submessages = x.m_submessages; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage( + RTPSMessage&& x) noexcept + { + m_msg_header = std::move(x.m_msg_header); + m_submessages = std::move(x.m_submessages); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage& operator =( + const RTPSMessage& x) + { + + m_msg_header = x.m_msg_header; + + m_submessages = x.m_submessages; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object RTPSMessage that will be copied. + */ + eProsima_user_DllExport RTPSMessage& operator =( + RTPSMessage&& x) noexcept + { + + m_msg_header = std::move(x.m_msg_header); + m_submessages = std::move(x.m_submessages); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x RTPSMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RTPSMessage& x) const + { + return (m_msg_header == x.m_msg_header && + m_submessages == x.m_submessages); + } + + /*! + * @brief Comparison operator. + * @param x RTPSMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RTPSMessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member msg_header + * @param _msg_header New value to be copied in member msg_header + */ + eProsima_user_DllExport void msg_header( + const Header& _msg_header) + { + m_msg_header = _msg_header; + } + + /*! + * @brief This function moves the value in member msg_header + * @param _msg_header New value to be moved in member msg_header + */ + eProsima_user_DllExport void msg_header( + Header&& _msg_header) + { + m_msg_header = std::move(_msg_header); + } + + /*! + * @brief This function returns a constant reference to member msg_header + * @return Constant reference to member msg_header + */ + eProsima_user_DllExport const Header& msg_header() const + { + return m_msg_header; + } + + /*! + * @brief This function returns a reference to member msg_header + * @return Reference to member msg_header + */ + eProsima_user_DllExport Header& msg_header() + { + return m_msg_header; + } + + + /*! + * @brief This function copies the value in member submessages + * @param _submessages New value to be copied in member submessages + */ + eProsima_user_DllExport void submessages( + const std::vector& _submessages) + { + m_submessages = _submessages; + } + + /*! + * @brief This function moves the value in member submessages + * @param _submessages New value to be moved in member submessages + */ + eProsima_user_DllExport void submessages( + std::vector&& _submessages) + { + m_submessages = std::move(_submessages); + } + + /*! + * @brief This function returns a constant reference to member submessages + * @return Constant reference to member submessages + */ + eProsima_user_DllExport const std::vector& submessages() const + { + return m_submessages; + } + + /*! + * @brief This function returns a reference to member submessages + * @return Reference to member submessages + */ + eProsima_user_DllExport std::vector& submessages() + { + return m_submessages; + } + + + +private: + + Header m_msg_header; + std::vector m_submessages; + +}; + +} // namespace core + +} // namespace rtps + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_HPP_ + + diff --git a/test/blackbox/types/core/core_types.idl b/test/blackbox/types/core/core_types.idl new file mode 100644 index 00000000000..f987b8afe3d --- /dev/null +++ b/test/blackbox/types/core/core_types.idl @@ -0,0 +1,220 @@ +// 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 test/blackbox/types/core/core_types.idl + */ + +module eprosima { +module fastdds { +module rtps { +module core { + +module detail { + + struct EntityId_t + { + octet value[4]; + }; + + struct ProtocolVersion_t + { + octet major; + octet minor; + }; + + struct VendorId_t + { + octet vendorId[2]; + }; + + struct GuidPrefix_t + { + octet value[12]; + }; + + struct GUID_t + { + GuidPrefix_t guidPrefix; + EntityId_t entityId; + }; + + struct SequenceNumber_t + { + long high; + unsigned long low; + }; + + struct Count_t + { + long value; + }; + + struct Time_t + { + unsigned long seconds; + unsigned long fraction; + }; + + typedef Time_t Timestamp; + + struct SequenceNumberSet + { + SequenceNumber_t bitmapBase; + unsigned long numBits; + octet bitmap[8]; + }; + + struct Locator_t + { + long kind; + unsigned long port; + octet address[16]; + }; + + struct Duration_t + { + long seconds; + unsigned long fraction; + }; + + typedef unsigned long DomainId_t; + typedef unsigned long BuiltinEndpointQos_t; + + struct StatusInfo_t + { + octet value[4]; + }; + + struct KeyHash_t + { + octet value[16]; + }; + + struct EntityName_t + { + string name; + }; + +}; // namespace detail + +//-------- RTPS 9.4.4 ------------ +struct Header +{ + octet prefix[4]; + detail::ProtocolVersion_t version; + detail::VendorId_t vendorId; + detail::GuidPrefix_t guidPrefix; +}; + +//-------- RTPS 9.4.5.1 ---------- +struct SubmessageHeader +{ + octet submessageId; + octet flags; + unsigned short submessageLength; /* octetsToNextHeader */ +}; + +//-------- RTPS 9.4.5.1.1 -------- +module SubmessageKind +{ + const char RTPS_HE = 0x00; + const char PAD = 0x01; + const char ACKNACK = 0x06; + const char HEARTBEAT = 0x07; + const char GAP = 0x08; + const char INFO_TS = 0x09; + const char INFO_SRC = 0x0c; + const char INFO_REPLY_IP4 = 0x0d; + const char INFO_DST = 0x0e; + const char INFO_REPLY = 0x0f; + const char NACK_FRAG = 0x12; + const char HEARTBEAT_FRAG = 0x13; + const char DATA = 0x15; + const char DATA_FRAG = 0x16; +}; + +//-------- RTPS 9.4.5.3 -------- +struct AckNackSubmessage +{ + SubmessageHeader submsgHeader; + detail::EntityId_t readerId; + detail::EntityId_t writerId; + detail::SequenceNumberSet readerSNState; + detail::Count_t count; +}; + +//-------- RTPS 9.4.5.7 -------- +struct HeartBeatSubmessage +{ + SubmessageHeader submsgHeader; + detail::EntityId_t readerId; + detail::EntityId_t writerId; + detail::SequenceNumber_t firstSN; + detail::SequenceNumber_t lastSN; + detail::Count_t count; +}; + +//-------- RTPS 9.4.5.9 -------- +struct InfoDestinationSubmessage +{ + SubmessageHeader submsgHeader; + detail::GuidPrefix_t guidPrefix; +}; + +//-------- RTPS 9.4.5.11 ------- +struct InfoSourceSubmessage +{ + SubmessageHeader submsgHeader; + long unused; + detail::ProtocolVersion_t version; + detail::VendorId_t vendorId; + detail::GuidPrefix_t guidPrefix; +}; + +//-------- RTPS 9.4.5.12 ------- +struct InfoTimestampSubmessage +{ + SubmessageHeader submsgHeader; + detail::Timestamp timestamp; +}; + +union Submessage switch (char) +{ + case SubmessageKind::HEARTBEAT: + HeartBeatSubmessage heartbeat_submsg; + + case SubmessageKind::INFO_TS: + InfoTimestampSubmessage info_ts_submsg; + + case SubmessageKind::INFO_SRC: + InfoSourceSubmessage info_src_submsg; + + case SubmessageKind::INFO_DST: + InfoDestinationSubmessage info_dst_submsg; + + default: + SubmessageHeader unknown_submsg; +}; + +struct RTPSMessage +{ + Header msg_header; /* header is illegal */ + sequence submessages; +}; + +}; // namespace core +}; // namespace rtps +}; // namespace fastdds +}; // namespace eprosima diff --git a/test/blackbox/types/core/core_typesCdrAux.hpp b/test/blackbox/types/core/core_typesCdrAux.hpp new file mode 100644 index 00000000000..7e042fb0d64 --- /dev/null +++ b/test/blackbox/types/core/core_typesCdrAux.hpp @@ -0,0 +1,202 @@ +// 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 core_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_RTPS_CORE_CORE_TYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPESCDRAUX_HPP_ + +#include "core_types.hpp" + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_SequenceNumber_t_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_SequenceNumber_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_InfoTimestampSubmessage_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_InfoTimestampSubmessage_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_ProtocolVersion_t_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_ProtocolVersion_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_GUID_t_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_GUID_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Time_t_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Time_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_EntityId_t_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_EntityId_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_Header_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_Header_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Duration_t_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Duration_t_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_rtps_core_RTPSMessage_max_cdr_typesize {52UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_RTPSMessage_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_SequenceNumberSet_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_SequenceNumberSet_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Count_t_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Count_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_GuidPrefix_t_max_cdr_typesize {16UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_GuidPrefix_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_StatusInfo_t_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_StatusInfo_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_AckNackSubmessage_max_cdr_typesize {64UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_AckNackSubmessage_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_InfoDestinationSubmessage_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_InfoDestinationSubmessage_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_EntityName_t_max_cdr_typesize {264UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_EntityName_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_SubmessageHeader_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_SubmessageHeader_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_KeyHash_t_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_KeyHash_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_VendorId_t_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_VendorId_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Locator_t_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_detail_Locator_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_HeartBeatSubmessage_max_cdr_typesize {60UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_HeartBeatSubmessage_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_rtps_core_InfoSourceSubmessage_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_rtps_core_InfoSourceSubmessage_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::rtps::core::detail::EntityId_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::VendorId_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::GUID_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Count_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Time_t& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::SequenceNumberSet& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Locator_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Duration_t& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::StatusInfo_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::KeyHash_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::EntityName_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::Header& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::SubmessageHeader& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::AckNackSubmessage& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::HeartBeatSubmessage& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoSourceSubmessage& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::RTPSMessage& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPESCDRAUX_HPP_ + diff --git a/test/blackbox/types/core/core_typesCdrAux.ipp b/test/blackbox/types/core/core_typesCdrAux.ipp new file mode 100644 index 00000000000..052885b19b7 --- /dev/null +++ b/test/blackbox/types/core/core_typesCdrAux.ipp @@ -0,0 +1,2324 @@ +// 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 core_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_RTPS_CORE_CORE_TYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPESCDRAUX_IPP_ + +#include "core_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::rtps::core::detail::EntityId_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.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::rtps::core::detail::EntityId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::EntityId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::EntityId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.major(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.minor(), 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::rtps::core::detail::ProtocolVersion_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.major() + << eprosima::fastcdr::MemberId(1) << data.minor() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.major(); + break; + + case 1: + dcdr >> data.minor(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::ProtocolVersion_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::VendorId_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.vendorId(), 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::rtps::core::detail::VendorId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.vendorId() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::VendorId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.vendorId(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::VendorId_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.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::rtps::core::detail::GuidPrefix_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::GuidPrefix_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::GuidPrefix_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::GUID_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.guidPrefix(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.entityId(), 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::rtps::core::detail::GUID_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.guidPrefix() + << eprosima::fastcdr::MemberId(1) << data.entityId() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::GUID_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.guidPrefix(); + break; + + case 1: + dcdr >> data.entityId(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::GUID_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.high(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.low(), 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::rtps::core::detail::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.high() + << eprosima::fastcdr::MemberId(1) << data.low() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.high(); + break; + + case 1: + dcdr >> data.low(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::Count_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.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::rtps::core::detail::Count_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::Count_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Count_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::Time_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.fraction(), 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::rtps::core::detail::Time_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds() + << eprosima::fastcdr::MemberId(1) << data.fraction() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::Time_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds(); + break; + + case 1: + dcdr >> data.fraction(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Time_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::SequenceNumberSet& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.bitmapBase(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.numBits(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.bitmap(), 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::rtps::core::detail::SequenceNumberSet& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.bitmapBase() + << eprosima::fastcdr::MemberId(1) << data.numBits() + << eprosima::fastcdr::MemberId(2) << data.bitmap() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::SequenceNumberSet& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.bitmapBase(); + break; + + case 1: + dcdr >> data.numBits(); + break; + + case 2: + dcdr >> data.bitmap(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::SequenceNumberSet& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::Locator_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.kind(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.port(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.address(), 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::rtps::core::detail::Locator_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.kind() + << eprosima::fastcdr::MemberId(1) << data.port() + << eprosima::fastcdr::MemberId(2) << data.address() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::Locator_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.kind(); + break; + + case 1: + dcdr >> data.port(); + break; + + case 2: + dcdr >> data.address(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Locator_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::Duration_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.fraction(), 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::rtps::core::detail::Duration_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds() + << eprosima::fastcdr::MemberId(1) << data.fraction() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::Duration_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.seconds(); + break; + + case 1: + dcdr >> data.fraction(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::Duration_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::StatusInfo_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.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::rtps::core::detail::StatusInfo_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::StatusInfo_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::StatusInfo_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::KeyHash_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.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::rtps::core::detail::KeyHash_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::KeyHash_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::KeyHash_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::detail::EntityName_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.name(), 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::rtps::core::detail::EntityName_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.name() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::detail::EntityName_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + 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.name(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::detail::EntityName_t& data) +{ + using namespace eprosima::fastdds::rtps::core::detail; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::Header& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.prefix(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.version(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.vendorId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.guidPrefix(), 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::rtps::core::Header& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.prefix() + << eprosima::fastcdr::MemberId(1) << data.version() + << eprosima::fastcdr::MemberId(2) << data.vendorId() + << eprosima::fastcdr::MemberId(3) << data.guidPrefix() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::Header& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.prefix(); + break; + + case 1: + dcdr >> data.version(); + break; + + case 2: + dcdr >> data.vendorId(); + break; + + case 3: + dcdr >> data.guidPrefix(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::Header& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::SubmessageHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submessageId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.submessageLength(), 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::rtps::core::SubmessageHeader& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submessageId() + << eprosima::fastcdr::MemberId(1) << data.flags() + << eprosima::fastcdr::MemberId(2) << data.submessageLength() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::SubmessageHeader& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submessageId(); + break; + + case 1: + dcdr >> data.flags(); + break; + + case 2: + dcdr >> data.submessageLength(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::SubmessageHeader& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::AckNackSubmessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.readerId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.writerId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.readerSNState(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + 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::rtps::core::AckNackSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader() + << eprosima::fastcdr::MemberId(1) << data.readerId() + << eprosima::fastcdr::MemberId(2) << data.writerId() + << eprosima::fastcdr::MemberId(3) << data.readerSNState() + << eprosima::fastcdr::MemberId(4) << data.count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::AckNackSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(); + break; + + case 1: + dcdr >> data.readerId(); + break; + + case 2: + dcdr >> data.writerId(); + break; + + case 3: + dcdr >> data.readerSNState(); + break; + + case 4: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::AckNackSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::HeartBeatSubmessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.readerId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.writerId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.firstSN(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.lastSN(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + 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::rtps::core::HeartBeatSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader() + << eprosima::fastcdr::MemberId(1) << data.readerId() + << eprosima::fastcdr::MemberId(2) << data.writerId() + << eprosima::fastcdr::MemberId(3) << data.firstSN() + << eprosima::fastcdr::MemberId(4) << data.lastSN() + << eprosima::fastcdr::MemberId(5) << data.count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::HeartBeatSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(); + break; + + case 1: + dcdr >> data.readerId(); + break; + + case 2: + dcdr >> data.writerId(); + break; + + case 3: + dcdr >> data.firstSN(); + break; + + case 4: + dcdr >> data.lastSN(); + break; + + case 5: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::HeartBeatSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.guidPrefix(), 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::rtps::core::InfoDestinationSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader() + << eprosima::fastcdr::MemberId(1) << data.guidPrefix() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::InfoDestinationSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(); + break; + + case 1: + dcdr >> data.guidPrefix(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoDestinationSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::InfoSourceSubmessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.unused(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.version(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.vendorId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.guidPrefix(), 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::rtps::core::InfoSourceSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader() + << eprosima::fastcdr::MemberId(1) << data.unused() + << eprosima::fastcdr::MemberId(2) << data.version() + << eprosima::fastcdr::MemberId(3) << data.vendorId() + << eprosima::fastcdr::MemberId(4) << data.guidPrefix() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::InfoSourceSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(); + break; + + case 1: + dcdr >> data.unused(); + break; + + case 2: + dcdr >> data.version(); + break; + + case 3: + dcdr >> data.vendorId(); + break; + + case 4: + dcdr >> data.guidPrefix(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoSourceSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.timestamp(), 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::rtps::core::InfoTimestampSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader() + << eprosima::fastcdr::MemberId(1) << data.timestamp() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::InfoTimestampSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.submsgHeader(); + break; + + case 1: + dcdr >> data.timestamp(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::InfoTimestampSubmessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::Submessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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 SubmessageKind::HEARTBEAT: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.heartbeat_submsg(), current_alignment); + break; + + case SubmessageKind::INFO_TS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.info_ts_submsg(), current_alignment); + break; + + case SubmessageKind::INFO_SRC: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.info_src_submsg(), current_alignment); + break; + + case SubmessageKind::INFO_DST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.info_dst_submsg(), current_alignment); + break; + + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.unknown_submsg(), current_alignment); + 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::rtps::core::Submessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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 SubmessageKind::HEARTBEAT: + scdr << eprosima::fastcdr::MemberId(1) << data.heartbeat_submsg(); + break; + + case SubmessageKind::INFO_TS: + scdr << eprosima::fastcdr::MemberId(2) << data.info_ts_submsg(); + break; + + case SubmessageKind::INFO_SRC: + scdr << eprosima::fastcdr::MemberId(3) << data.info_src_submsg(); + break; + + case SubmessageKind::INFO_DST: + scdr << eprosima::fastcdr::MemberId(4) << data.info_dst_submsg(); + break; + + default: + scdr << eprosima::fastcdr::MemberId(5) << data.unknown_submsg(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::Submessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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; + if (0 == mid.id) + { + char discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case SubmessageKind::HEARTBEAT: + { + eprosima::fastdds::rtps::core::HeartBeatSubmessage heartbeat_submsg_value; + data.heartbeat_submsg(std::move(heartbeat_submsg_value)); + data._d(discriminator); + break; + } + + case SubmessageKind::INFO_TS: + { + eprosima::fastdds::rtps::core::InfoTimestampSubmessage info_ts_submsg_value; + data.info_ts_submsg(std::move(info_ts_submsg_value)); + data._d(discriminator); + break; + } + + case SubmessageKind::INFO_SRC: + { + eprosima::fastdds::rtps::core::InfoSourceSubmessage info_src_submsg_value; + data.info_src_submsg(std::move(info_src_submsg_value)); + data._d(discriminator); + break; + } + + case SubmessageKind::INFO_DST: + { + eprosima::fastdds::rtps::core::InfoDestinationSubmessage info_dst_submsg_value; + data.info_dst_submsg(std::move(info_dst_submsg_value)); + data._d(discriminator); + break; + } + + default: + { + eprosima::fastdds::rtps::core::SubmessageHeader unknown_submsg_value; + data.unknown_submsg(std::move(unknown_submsg_value)); + data._d(discriminator); + break; + } + + } + } + else + { + switch (data._d()) + { + case SubmessageKind::HEARTBEAT: + dcdr >> data.heartbeat_submsg(); + break; + + case SubmessageKind::INFO_TS: + dcdr >> data.info_ts_submsg(); + break; + + case SubmessageKind::INFO_SRC: + dcdr >> data.info_src_submsg(); + break; + + case SubmessageKind::INFO_DST: + dcdr >> data.info_dst_submsg(); + break; + + default: + dcdr >> data.unknown_submsg(); + break; + + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::rtps::core::RTPSMessage& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.msg_header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.submessages(), 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::rtps::core::RTPSMessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.msg_header() + << eprosima::fastcdr::MemberId(1) << data.submessages() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::rtps::core::RTPSMessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + 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.msg_header(); + break; + + case 1: + dcdr >> data.submessages(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::rtps::core::RTPSMessage& data) +{ + using namespace eprosima::fastdds::rtps::core; + + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPESCDRAUX_IPP_ + diff --git a/test/blackbox/types/core/core_typesPubSubTypes.cxx b/test/blackbox/types/core/core_typesPubSubTypes.cxx new file mode 100644 index 00000000000..992458b63e1 --- /dev/null +++ b/test/blackbox/types/core/core_typesPubSubTypes.cxx @@ -0,0 +1,4304 @@ +// 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 core_typesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + +#include "core_typesPubSubTypes.h" + +#include +#include + +#include "core_typesCdrAux.hpp" +#include "core_typesTypeObjectSupport.hpp" + +using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + namespace fastdds { + namespace rtps { + namespace core { + namespace detail { + EntityId_tPubSubType::EntityId_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::EntityId_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityId_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_EntityId_t_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_rtps_core_detail_EntityId_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_EntityId_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + EntityId_tPubSubType::~EntityId_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool EntityId_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const EntityId_t* 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 EntityId_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + EntityId_t* 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 EntityId_tPubSubType::getSerializedSizeProvider( + const void* const 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* EntityId_tPubSubType::createData() + { + return reinterpret_cast(new EntityId_t()); + } + + void EntityId_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool EntityId_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const EntityId_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_EntityId_t_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_rtps_core_detail_EntityId_t_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; + } + + void EntityId_tPubSubType::register_type_object_representation() + { + register_EntityId_t_type_identifier(type_identifiers_); + } + + ProtocolVersion_tPubSubType::ProtocolVersion_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::ProtocolVersion_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtocolVersion_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_ProtocolVersion_t_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_rtps_core_detail_ProtocolVersion_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_ProtocolVersion_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtocolVersion_tPubSubType::~ProtocolVersion_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtocolVersion_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const ProtocolVersion_t* 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 ProtocolVersion_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + ProtocolVersion_t* 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 ProtocolVersion_tPubSubType::getSerializedSizeProvider( + const void* const 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* ProtocolVersion_tPubSubType::createData() + { + return reinterpret_cast(new ProtocolVersion_t()); + } + + void ProtocolVersion_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtocolVersion_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const ProtocolVersion_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_ProtocolVersion_t_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_rtps_core_detail_ProtocolVersion_t_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; + } + + void ProtocolVersion_tPubSubType::register_type_object_representation() + { + register_ProtocolVersion_t_type_identifier(type_identifiers_); + } + + VendorId_tPubSubType::VendorId_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::VendorId_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(VendorId_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_VendorId_t_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_rtps_core_detail_VendorId_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_VendorId_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VendorId_tPubSubType::~VendorId_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VendorId_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const VendorId_t* 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 VendorId_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + VendorId_t* 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 VendorId_tPubSubType::getSerializedSizeProvider( + const void* const 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* VendorId_tPubSubType::createData() + { + return reinterpret_cast(new VendorId_t()); + } + + void VendorId_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VendorId_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const VendorId_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_VendorId_t_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_rtps_core_detail_VendorId_t_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; + } + + void VendorId_tPubSubType::register_type_object_representation() + { + register_VendorId_t_type_identifier(type_identifiers_); + } + + GuidPrefix_tPubSubType::GuidPrefix_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::GuidPrefix_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GuidPrefix_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_GuidPrefix_t_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_rtps_core_detail_GuidPrefix_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_GuidPrefix_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GuidPrefix_tPubSubType::~GuidPrefix_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GuidPrefix_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const GuidPrefix_t* 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 GuidPrefix_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + GuidPrefix_t* 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 GuidPrefix_tPubSubType::getSerializedSizeProvider( + const void* const 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* GuidPrefix_tPubSubType::createData() + { + return reinterpret_cast(new GuidPrefix_t()); + } + + void GuidPrefix_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GuidPrefix_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const GuidPrefix_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_GuidPrefix_t_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_rtps_core_detail_GuidPrefix_t_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; + } + + void GuidPrefix_tPubSubType::register_type_object_representation() + { + register_GuidPrefix_t_type_identifier(type_identifiers_); + } + + GUID_tPubSubType::GUID_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::GUID_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GUID_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_GUID_t_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_rtps_core_detail_GUID_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_GUID_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GUID_tPubSubType::~GUID_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GUID_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const GUID_t* 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 GUID_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + GUID_t* 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 GUID_tPubSubType::getSerializedSizeProvider( + const void* const 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* GUID_tPubSubType::createData() + { + return reinterpret_cast(new GUID_t()); + } + + void GUID_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GUID_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const GUID_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_GUID_t_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_rtps_core_detail_GUID_t_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; + } + + void GUID_tPubSubType::register_type_object_representation() + { + register_GUID_t_type_identifier(type_identifiers_); + } + + SequenceNumber_tPubSubType::SequenceNumber_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::SequenceNumber_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceNumber_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_SequenceNumber_t_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_rtps_core_detail_SequenceNumber_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_SequenceNumber_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SequenceNumber_tPubSubType::~SequenceNumber_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SequenceNumber_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const SequenceNumber_t* 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 SequenceNumber_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + SequenceNumber_t* 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 SequenceNumber_tPubSubType::getSerializedSizeProvider( + const void* const 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* SequenceNumber_tPubSubType::createData() + { + return reinterpret_cast(new SequenceNumber_t()); + } + + void SequenceNumber_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SequenceNumber_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const SequenceNumber_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_SequenceNumber_t_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_rtps_core_detail_SequenceNumber_t_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; + } + + void SequenceNumber_tPubSubType::register_type_object_representation() + { + register_SequenceNumber_t_type_identifier(type_identifiers_); + } + + Count_tPubSubType::Count_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::Count_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Count_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_Count_t_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_rtps_core_detail_Count_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_Count_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Count_tPubSubType::~Count_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Count_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const Count_t* 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 Count_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Count_t* 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 Count_tPubSubType::getSerializedSizeProvider( + const void* const 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* Count_tPubSubType::createData() + { + return reinterpret_cast(new Count_t()); + } + + void Count_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Count_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const Count_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_Count_t_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_rtps_core_detail_Count_t_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; + } + + void Count_tPubSubType::register_type_object_representation() + { + register_Count_t_type_identifier(type_identifiers_); + } + + Time_tPubSubType::Time_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::Time_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Time_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_Time_t_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_rtps_core_detail_Time_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_Time_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Time_tPubSubType::~Time_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Time_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const Time_t* 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 Time_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Time_t* 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 Time_tPubSubType::getSerializedSizeProvider( + const void* const 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* Time_tPubSubType::createData() + { + return reinterpret_cast(new Time_t()); + } + + void Time_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Time_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const Time_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_Time_t_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_rtps_core_detail_Time_t_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; + } + + void Time_tPubSubType::register_type_object_representation() + { + register_Time_t_type_identifier(type_identifiers_); + } + + + SequenceNumberSetPubSubType::SequenceNumberSetPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::SequenceNumberSet"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceNumberSet::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_SequenceNumberSet_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_rtps_core_detail_SequenceNumberSet_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_SequenceNumberSet_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SequenceNumberSetPubSubType::~SequenceNumberSetPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SequenceNumberSetPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const SequenceNumberSet* 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 SequenceNumberSetPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + SequenceNumberSet* 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 SequenceNumberSetPubSubType::getSerializedSizeProvider( + const void* const 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* SequenceNumberSetPubSubType::createData() + { + return reinterpret_cast(new SequenceNumberSet()); + } + + void SequenceNumberSetPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SequenceNumberSetPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const SequenceNumberSet* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_SequenceNumberSet_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_rtps_core_detail_SequenceNumberSet_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; + } + + void SequenceNumberSetPubSubType::register_type_object_representation() + { + register_SequenceNumberSet_type_identifier(type_identifiers_); + } + + Locator_tPubSubType::Locator_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::Locator_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Locator_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_Locator_t_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_rtps_core_detail_Locator_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_Locator_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Locator_tPubSubType::~Locator_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Locator_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const Locator_t* 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 Locator_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Locator_t* 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 Locator_tPubSubType::getSerializedSizeProvider( + const void* const 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* Locator_tPubSubType::createData() + { + return reinterpret_cast(new Locator_t()); + } + + void Locator_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Locator_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const Locator_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_Locator_t_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_rtps_core_detail_Locator_t_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; + } + + void Locator_tPubSubType::register_type_object_representation() + { + register_Locator_t_type_identifier(type_identifiers_); + } + + Duration_tPubSubType::Duration_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::Duration_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Duration_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_Duration_t_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_rtps_core_detail_Duration_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_Duration_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + Duration_tPubSubType::~Duration_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool Duration_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const Duration_t* 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 Duration_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Duration_t* 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 Duration_tPubSubType::getSerializedSizeProvider( + const void* const 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* Duration_tPubSubType::createData() + { + return reinterpret_cast(new Duration_t()); + } + + void Duration_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool Duration_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const Duration_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_Duration_t_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_rtps_core_detail_Duration_t_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; + } + + void Duration_tPubSubType::register_type_object_representation() + { + register_Duration_t_type_identifier(type_identifiers_); + } + + + + StatusInfo_tPubSubType::StatusInfo_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::StatusInfo_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(StatusInfo_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_StatusInfo_t_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_rtps_core_detail_StatusInfo_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_StatusInfo_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + StatusInfo_tPubSubType::~StatusInfo_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool StatusInfo_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const StatusInfo_t* 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 StatusInfo_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + StatusInfo_t* 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 StatusInfo_tPubSubType::getSerializedSizeProvider( + const void* const 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* StatusInfo_tPubSubType::createData() + { + return reinterpret_cast(new StatusInfo_t()); + } + + void StatusInfo_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool StatusInfo_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const StatusInfo_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_StatusInfo_t_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_rtps_core_detail_StatusInfo_t_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; + } + + void StatusInfo_tPubSubType::register_type_object_representation() + { + register_StatusInfo_t_type_identifier(type_identifiers_); + } + + KeyHash_tPubSubType::KeyHash_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::KeyHash_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyHash_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_KeyHash_t_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_rtps_core_detail_KeyHash_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_KeyHash_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + KeyHash_tPubSubType::~KeyHash_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool KeyHash_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const KeyHash_t* 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 KeyHash_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + KeyHash_t* 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 KeyHash_tPubSubType::getSerializedSizeProvider( + const void* const 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* KeyHash_tPubSubType::createData() + { + return reinterpret_cast(new KeyHash_t()); + } + + void KeyHash_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool KeyHash_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const KeyHash_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_KeyHash_t_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_rtps_core_detail_KeyHash_t_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; + } + + void KeyHash_tPubSubType::register_type_object_representation() + { + register_KeyHash_t_type_identifier(type_identifiers_); + } + + EntityName_tPubSubType::EntityName_tPubSubType() + { + setName("eprosima::fastdds::rtps::core::detail::EntityName_t"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityName_t::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_detail_EntityName_t_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_rtps_core_detail_EntityName_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_detail_EntityName_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + EntityName_tPubSubType::~EntityName_tPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool EntityName_tPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const EntityName_t* 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 EntityName_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + EntityName_t* 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 EntityName_tPubSubType::getSerializedSizeProvider( + const void* const 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* EntityName_tPubSubType::createData() + { + return reinterpret_cast(new EntityName_t()); + } + + void EntityName_tPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool EntityName_tPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const EntityName_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_detail_EntityName_t_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_rtps_core_detail_EntityName_t_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; + } + + void EntityName_tPubSubType::register_type_object_representation() + { + register_EntityName_t_type_identifier(type_identifiers_); + } + + } // namespace detail + + HeaderPubSubType::HeaderPubSubType() + { + setName("eprosima::fastdds::rtps::core::Header"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Header::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_Header_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_rtps_core_Header_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_Header_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HeaderPubSubType::~HeaderPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HeaderPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const Header* 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 HeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Header* 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 HeaderPubSubType::getSerializedSizeProvider( + const void* const 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* HeaderPubSubType::createData() + { + return reinterpret_cast(new Header()); + } + + void HeaderPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HeaderPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const Header* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_Header_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_rtps_core_Header_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; + } + + void HeaderPubSubType::register_type_object_representation() + { + register_Header_type_identifier(type_identifiers_); + } + + SubmessageHeaderPubSubType::SubmessageHeaderPubSubType() + { + setName("eprosima::fastdds::rtps::core::SubmessageHeader"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SubmessageHeader::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_SubmessageHeader_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_rtps_core_SubmessageHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_SubmessageHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SubmessageHeaderPubSubType::~SubmessageHeaderPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SubmessageHeaderPubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const SubmessageHeader* 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 SubmessageHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + SubmessageHeader* 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 SubmessageHeaderPubSubType::getSerializedSizeProvider( + const void* const 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* SubmessageHeaderPubSubType::createData() + { + return reinterpret_cast(new SubmessageHeader()); + } + + void SubmessageHeaderPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SubmessageHeaderPubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const SubmessageHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_SubmessageHeader_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_rtps_core_SubmessageHeader_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; + } + + void SubmessageHeaderPubSubType::register_type_object_representation() + { + register_SubmessageHeader_type_identifier(type_identifiers_); + } + + namespace SubmessageKind { + } // namespace SubmessageKind + + AckNackSubmessagePubSubType::AckNackSubmessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::AckNackSubmessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(AckNackSubmessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_AckNackSubmessage_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_rtps_core_AckNackSubmessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_AckNackSubmessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AckNackSubmessagePubSubType::~AckNackSubmessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AckNackSubmessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const AckNackSubmessage* 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 AckNackSubmessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + AckNackSubmessage* 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 AckNackSubmessagePubSubType::getSerializedSizeProvider( + const void* const 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* AckNackSubmessagePubSubType::createData() + { + return reinterpret_cast(new AckNackSubmessage()); + } + + void AckNackSubmessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AckNackSubmessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const AckNackSubmessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_AckNackSubmessage_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_rtps_core_AckNackSubmessage_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; + } + + void AckNackSubmessagePubSubType::register_type_object_representation() + { + register_AckNackSubmessage_type_identifier(type_identifiers_); + } + + HeartBeatSubmessagePubSubType::HeartBeatSubmessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::HeartBeatSubmessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(HeartBeatSubmessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_HeartBeatSubmessage_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_rtps_core_HeartBeatSubmessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_HeartBeatSubmessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HeartBeatSubmessagePubSubType::~HeartBeatSubmessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HeartBeatSubmessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const HeartBeatSubmessage* 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 HeartBeatSubmessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + HeartBeatSubmessage* 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 HeartBeatSubmessagePubSubType::getSerializedSizeProvider( + const void* const 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* HeartBeatSubmessagePubSubType::createData() + { + return reinterpret_cast(new HeartBeatSubmessage()); + } + + void HeartBeatSubmessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HeartBeatSubmessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const HeartBeatSubmessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_HeartBeatSubmessage_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_rtps_core_HeartBeatSubmessage_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; + } + + void HeartBeatSubmessagePubSubType::register_type_object_representation() + { + register_HeartBeatSubmessage_type_identifier(type_identifiers_); + } + + InfoDestinationSubmessagePubSubType::InfoDestinationSubmessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::InfoDestinationSubmessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(InfoDestinationSubmessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_InfoDestinationSubmessage_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_rtps_core_InfoDestinationSubmessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_InfoDestinationSubmessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + InfoDestinationSubmessagePubSubType::~InfoDestinationSubmessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool InfoDestinationSubmessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const InfoDestinationSubmessage* 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 InfoDestinationSubmessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + InfoDestinationSubmessage* 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 InfoDestinationSubmessagePubSubType::getSerializedSizeProvider( + const void* const 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* InfoDestinationSubmessagePubSubType::createData() + { + return reinterpret_cast(new InfoDestinationSubmessage()); + } + + void InfoDestinationSubmessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool InfoDestinationSubmessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const InfoDestinationSubmessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_InfoDestinationSubmessage_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_rtps_core_InfoDestinationSubmessage_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; + } + + void InfoDestinationSubmessagePubSubType::register_type_object_representation() + { + register_InfoDestinationSubmessage_type_identifier(type_identifiers_); + } + + InfoSourceSubmessagePubSubType::InfoSourceSubmessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::InfoSourceSubmessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(InfoSourceSubmessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_InfoSourceSubmessage_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_rtps_core_InfoSourceSubmessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_InfoSourceSubmessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + InfoSourceSubmessagePubSubType::~InfoSourceSubmessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool InfoSourceSubmessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const InfoSourceSubmessage* 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 InfoSourceSubmessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + InfoSourceSubmessage* 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 InfoSourceSubmessagePubSubType::getSerializedSizeProvider( + const void* const 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* InfoSourceSubmessagePubSubType::createData() + { + return reinterpret_cast(new InfoSourceSubmessage()); + } + + void InfoSourceSubmessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool InfoSourceSubmessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const InfoSourceSubmessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_InfoSourceSubmessage_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_rtps_core_InfoSourceSubmessage_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; + } + + void InfoSourceSubmessagePubSubType::register_type_object_representation() + { + register_InfoSourceSubmessage_type_identifier(type_identifiers_); + } + + InfoTimestampSubmessagePubSubType::InfoTimestampSubmessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::InfoTimestampSubmessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(InfoTimestampSubmessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_InfoTimestampSubmessage_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_rtps_core_InfoTimestampSubmessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_InfoTimestampSubmessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + InfoTimestampSubmessagePubSubType::~InfoTimestampSubmessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool InfoTimestampSubmessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const InfoTimestampSubmessage* 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 InfoTimestampSubmessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + InfoTimestampSubmessage* 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 InfoTimestampSubmessagePubSubType::getSerializedSizeProvider( + const void* const 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* InfoTimestampSubmessagePubSubType::createData() + { + return reinterpret_cast(new InfoTimestampSubmessage()); + } + + void InfoTimestampSubmessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool InfoTimestampSubmessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const InfoTimestampSubmessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_InfoTimestampSubmessage_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_rtps_core_InfoTimestampSubmessage_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; + } + + void InfoTimestampSubmessagePubSubType::register_type_object_representation() + { + register_InfoTimestampSubmessage_type_identifier(type_identifiers_); + } + + + RTPSMessagePubSubType::RTPSMessagePubSubType() + { + setName("eprosima::fastdds::rtps::core::RTPSMessage"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(RTPSMessage::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_rtps_core_RTPSMessage_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_rtps_core_RTPSMessage_max_key_cdr_typesize > 16 ? eprosima_fastdds_rtps_core_RTPSMessage_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RTPSMessagePubSubType::~RTPSMessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RTPSMessagePubSubType::serialize( + const void* const data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + const RTPSMessage* 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 RTPSMessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + RTPSMessage* 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 RTPSMessagePubSubType::getSerializedSizeProvider( + const void* const 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* RTPSMessagePubSubType::createData() + { + return reinterpret_cast(new RTPSMessage()); + } + + void RTPSMessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RTPSMessagePubSubType::getKey( + const void* const data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + const RTPSMessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_rtps_core_RTPSMessage_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_rtps_core_RTPSMessage_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; + } + + void RTPSMessagePubSubType::register_type_object_representation() + { + register_RTPSMessage_type_identifier(type_identifiers_); + } + + } // namespace core + + } // namespace rtps + + } // namespace fastdds + +} // namespace eprosima + + +// Include auxiliary functions like for serializing/deserializing. +#include "core_typesCdrAux.ipp" diff --git a/test/blackbox/types/core/core_typesPubSubTypes.h b/test/blackbox/types/core/core_typesPubSubTypes.h new file mode 100644 index 00000000000..02d5873f917 --- /dev/null +++ b/test/blackbox/types/core/core_typesPubSubTypes.h @@ -0,0 +1,2066 @@ +// 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 core_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_RTPS_CORE_CORE_TYPES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "core_types.hpp" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated core_types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima +{ + namespace fastdds + { + namespace rtps + { + namespace core + { + namespace detail + { + + /*! + * @brief This class represents the TopicDataType of the type EntityId_t defined by the user in the IDL file. + * @ingroup core_types + */ + class EntityId_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef EntityId_t type; + + eProsima_user_DllExport EntityId_tPubSubType(); + + eProsima_user_DllExport ~EntityId_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 ProtocolVersion_t defined by the user in the IDL file. + * @ingroup core_types + */ + class ProtocolVersion_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtocolVersion_t type; + + eProsima_user_DllExport ProtocolVersion_tPubSubType(); + + eProsima_user_DllExport ~ProtocolVersion_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 VendorId_t defined by the user in the IDL file. + * @ingroup core_types + */ + class VendorId_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VendorId_t type; + + eProsima_user_DllExport VendorId_tPubSubType(); + + eProsima_user_DllExport ~VendorId_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 GuidPrefix_t defined by the user in the IDL file. + * @ingroup core_types + */ + class GuidPrefix_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GuidPrefix_t type; + + eProsima_user_DllExport GuidPrefix_tPubSubType(); + + eProsima_user_DllExport ~GuidPrefix_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 GUID_t defined by the user in the IDL file. + * @ingroup core_types + */ + class GUID_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GUID_t type; + + eProsima_user_DllExport GUID_tPubSubType(); + + eProsima_user_DllExport ~GUID_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 SequenceNumber_t defined by the user in the IDL file. + * @ingroup core_types + */ + class SequenceNumber_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SequenceNumber_t type; + + eProsima_user_DllExport SequenceNumber_tPubSubType(); + + eProsima_user_DllExport ~SequenceNumber_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 Count_t defined by the user in the IDL file. + * @ingroup core_types + */ + class Count_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Count_t type; + + eProsima_user_DllExport Count_tPubSubType(); + + eProsima_user_DllExport ~Count_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 Time_t defined by the user in the IDL file. + * @ingroup core_types + */ + class Time_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Time_t type; + + eProsima_user_DllExport Time_tPubSubType(); + + eProsima_user_DllExport ~Time_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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::rtps::core::detail::Time_t Timestamp; + + /*! + * @brief This class represents the TopicDataType of the type SequenceNumberSet defined by the user in the IDL file. + * @ingroup core_types + */ + class SequenceNumberSetPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SequenceNumberSet type; + + eProsima_user_DllExport SequenceNumberSetPubSubType(); + + eProsima_user_DllExport ~SequenceNumberSetPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 Locator_t defined by the user in the IDL file. + * @ingroup core_types + */ + class Locator_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Locator_t type; + + eProsima_user_DllExport Locator_tPubSubType(); + + eProsima_user_DllExport ~Locator_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 Duration_t defined by the user in the IDL file. + * @ingroup core_types + */ + class Duration_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Duration_t type; + + eProsima_user_DllExport Duration_tPubSubType(); + + eProsima_user_DllExport ~Duration_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 uint32_t DomainId_t; + typedef uint32_t BuiltinEndpointQos_t; + + /*! + * @brief This class represents the TopicDataType of the type StatusInfo_t defined by the user in the IDL file. + * @ingroup core_types + */ + class StatusInfo_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef StatusInfo_t type; + + eProsima_user_DllExport StatusInfo_tPubSubType(); + + eProsima_user_DllExport ~StatusInfo_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 KeyHash_t defined by the user in the IDL file. + * @ingroup core_types + */ + class KeyHash_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef KeyHash_t type; + + eProsima_user_DllExport KeyHash_tPubSubType(); + + eProsima_user_DllExport ~KeyHash_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 EntityName_t defined by the user in the IDL file. + * @ingroup core_types + */ + class EntityName_tPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef EntityName_t type; + + eProsima_user_DllExport EntityName_tPubSubType(); + + eProsima_user_DllExport ~EntityName_tPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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; + + }; + } // namespace detail + + /*! + * @brief This class represents the TopicDataType of the type Header defined by the user in the IDL file. + * @ingroup core_types + */ + class HeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Header type; + + eProsima_user_DllExport HeaderPubSubType(); + + eProsima_user_DllExport ~HeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 SubmessageHeader defined by the user in the IDL file. + * @ingroup core_types + */ + class SubmessageHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SubmessageHeader type; + + eProsima_user_DllExport SubmessageHeaderPubSubType(); + + eProsima_user_DllExport ~SubmessageHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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; + + }; + namespace SubmessageKind + { + } // namespace SubmessageKind + + /*! + * @brief This class represents the TopicDataType of the type AckNackSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ + class AckNackSubmessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AckNackSubmessage type; + + eProsima_user_DllExport AckNackSubmessagePubSubType(); + + eProsima_user_DllExport ~AckNackSubmessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 HeartBeatSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ + class HeartBeatSubmessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef HeartBeatSubmessage type; + + eProsima_user_DllExport HeartBeatSubmessagePubSubType(); + + eProsima_user_DllExport ~HeartBeatSubmessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 InfoDestinationSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ + class InfoDestinationSubmessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef InfoDestinationSubmessage type; + + eProsima_user_DllExport InfoDestinationSubmessagePubSubType(); + + eProsima_user_DllExport ~InfoDestinationSubmessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 InfoSourceSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ + class InfoSourceSubmessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef InfoSourceSubmessage type; + + eProsima_user_DllExport InfoSourceSubmessagePubSubType(); + + eProsima_user_DllExport ~InfoSourceSubmessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 InfoTimestampSubmessage defined by the user in the IDL file. + * @ingroup core_types + */ + class InfoTimestampSubmessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef InfoTimestampSubmessage type; + + eProsima_user_DllExport InfoTimestampSubmessagePubSubType(); + + eProsima_user_DllExport ~InfoTimestampSubmessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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 RTPSMessage defined by the user in the IDL file. + * @ingroup core_types + */ + class RTPSMessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RTPSMessage type; + + eProsima_user_DllExport RTPSMessagePubSubType(); + + eProsima_user_DllExport ~RTPSMessagePubSubType() override; + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() 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; + + }; + } // namespace core + } // namespace rtps + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_PUBSUBTYPES_H_ + diff --git a/test/blackbox/types/core/core_typesTypeObject.cxx b/test/blackbox/types/core/core_typesTypeObject.cxx new file mode 100644 index 00000000000..b6ffdedf5b0 --- /dev/null +++ b/test/blackbox/types/core/core_typesTypeObject.cxx @@ -0,0 +1,4909 @@ +// 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 core_typesTypeObject.cpp + * This source file contains the definition 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; } +#endif + +#include "core_types.h" +#include "core_typesTypeObject.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace eprosima::fastdds::rtps; + +void registercore_typesTypes() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + TypeObjectFactory *factory = TypeObjectFactory::get_instance(); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::EntityId_t", eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetEntityId_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::EntityId_t", eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetEntityId_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::ProtocolVersion_t", eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::ProtocolVersion_t", eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::VendorId_t", eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetVendorId_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::VendorId_t", eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetVendorId_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::GuidPrefix_t", eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::GuidPrefix_t", eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::GUID_t", eprosima::fastdds::rtps::core::detail::GetGUID_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetGUID_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::GUID_t", eprosima::fastdds::rtps::core::detail::GetGUID_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetGUID_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::SequenceNumber_t", eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::SequenceNumber_t", eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Count_t", eprosima::fastdds::rtps::core::detail::GetCount_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetCount_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Count_t", eprosima::fastdds::rtps::core::detail::GetCount_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetCount_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Time_t", eprosima::fastdds::rtps::core::detail::GetTime_tIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetTime_tObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Time_t", eprosima::fastdds::rtps::core::detail::GetTime_tIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetTime_tObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Timestamp", eprosima::fastdds::rtps::core::detail::GetTimestampIdentifier(true), + eprosima::fastdds::rtps::core::detail::GetTimestampObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::detail::Timestamp", eprosima::fastdds::rtps::core::detail::GetTimestampIdentifier(false), + eprosima::fastdds::rtps::core::detail::GetTimestampObject(false)); + + + + factory->add_type_object("eprosima::fastdds::rtps::core::Header", eprosima::fastdds::rtps::core::GetHeaderIdentifier(true), + eprosima::fastdds::rtps::core::GetHeaderObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::Header", eprosima::fastdds::rtps::core::GetHeaderIdentifier(false), + eprosima::fastdds::rtps::core::GetHeaderObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::SubmessageHeader", eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true), + eprosima::fastdds::rtps::core::GetSubmessageHeaderObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::SubmessageHeader", eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false), + eprosima::fastdds::rtps::core::GetSubmessageHeaderObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::SubmessageKind", eprosima::fastdds::rtps::core::GetSubmessageKindIdentifier(true), + eprosima::fastdds::rtps::core::GetSubmessageKindObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::SubmessageKind", eprosima::fastdds::rtps::core::GetSubmessageKindIdentifier(false), + eprosima::fastdds::rtps::core::GetSubmessageKindObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::HeartBeatSubmessage", eprosima::fastdds::rtps::core::GetHeartBeatSubmessageIdentifier(true), + eprosima::fastdds::rtps::core::GetHeartBeatSubmessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::HeartBeatSubmessage", eprosima::fastdds::rtps::core::GetHeartBeatSubmessageIdentifier(false), + eprosima::fastdds::rtps::core::GetHeartBeatSubmessageObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::InfoDestinationSubmessage", eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageIdentifier(true), + eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::InfoDestinationSubmessage", eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageIdentifier(false), + eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::InfoSourceSubmessage", eprosima::fastdds::rtps::core::GetInfoSourceSubmessageIdentifier(true), + eprosima::fastdds::rtps::core::GetInfoSourceSubmessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::InfoSourceSubmessage", eprosima::fastdds::rtps::core::GetInfoSourceSubmessageIdentifier(false), + eprosima::fastdds::rtps::core::GetInfoSourceSubmessageObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::InfoTimestampSubmessage", eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageIdentifier(true), + eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::InfoTimestampSubmessage", eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageIdentifier(false), + eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::Submessage", eprosima::fastdds::rtps::core::GetSubmessageIdentifier(true), + eprosima::fastdds::rtps::core::GetSubmessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::Submessage", eprosima::fastdds::rtps::core::GetSubmessageIdentifier(false), + eprosima::fastdds::rtps::core::GetSubmessageObject(false)); + + + factory->add_type_object("eprosima::fastdds::rtps::core::RTPSMessage", eprosima::fastdds::rtps::core::GetRTPSMessageIdentifier(true), + eprosima::fastdds::rtps::core::GetRTPSMessageObject(true)); + factory->add_type_object("eprosima::fastdds::rtps::core::RTPSMessage", eprosima::fastdds::rtps::core::GetRTPSMessageIdentifier(false), + eprosima::fastdds::rtps::core::GetRTPSMessageObject(false)); + + + + + + }); +} + +namespace eprosima { + namespace fastdds { + namespace rtps { + namespace core { + namespace detail { + + + const TypeIdentifier* GetEntityId_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("EntityId_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetEntityId_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("EntityId_t", complete); + } + + const TypeObject* GetEntityId_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EntityId_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteEntityId_tObject(); + } + //else + return GetMinimalEntityId_tObject(); + } + + const TypeObject* GetMinimalEntityId_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EntityId_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_value; + mst_value.common().member_id(memberId++); + mst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_value.common().member_flags().IS_OPTIONAL(false); + mst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_value.common().member_flags().IS_KEY(false); + mst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {4}, false)); + + MD5 value_hash("value"); + for(int i = 0; i < 4; ++i) + { + mst_value.detail().name_hash()[i] = value_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_value); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("EntityId_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("EntityId_t", false); + } + + const TypeObject* GetCompleteEntityId_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EntityId_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_value; + cst_value.common().member_id(memberId++); + cst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_value.common().member_flags().IS_OPTIONAL(false); + cst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_value.common().member_flags().IS_KEY(false); + cst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {4}, true)); + + cst_value.detail().name("value"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_value); + + + // Header + type_object->complete().struct_type().header().detail().type_name("EntityId_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("EntityId_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("EntityId_t", true); + } + + + + const TypeIdentifier* GetProtocolVersion_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ProtocolVersion_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetProtocolVersion_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("ProtocolVersion_t", complete); + } + + const TypeObject* GetProtocolVersion_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ProtocolVersion_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteProtocolVersion_tObject(); + } + //else + return GetMinimalProtocolVersion_tObject(); + } + + const TypeObject* GetMinimalProtocolVersion_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ProtocolVersion_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_major; + mst_major.common().member_id(memberId++); + mst_major.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_major.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_major.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_major.common().member_flags().IS_OPTIONAL(false); + mst_major.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_major.common().member_flags().IS_KEY(false); + mst_major.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_major.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + MD5 major_hash("major"); + for(int i = 0; i < 4; ++i) + { + mst_major.detail().name_hash()[i] = major_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_major); + + MinimalStructMember mst_minor; + mst_minor.common().member_id(memberId++); + mst_minor.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_minor.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_minor.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_minor.common().member_flags().IS_OPTIONAL(false); + mst_minor.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_minor.common().member_flags().IS_KEY(false); + mst_minor.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_minor.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + MD5 minor_hash("minor"); + for(int i = 0; i < 4; ++i) + { + mst_minor.detail().name_hash()[i] = minor_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_minor); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("ProtocolVersion_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("ProtocolVersion_t", false); + } + + const TypeObject* GetCompleteProtocolVersion_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ProtocolVersion_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_major; + cst_major.common().member_id(memberId++); + cst_major.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_major.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_major.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_major.common().member_flags().IS_OPTIONAL(false); + cst_major.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_major.common().member_flags().IS_KEY(false); + cst_major.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_major.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + cst_major.detail().name("major"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_major); + + CompleteStructMember cst_minor; + cst_minor.common().member_id(memberId++); + cst_minor.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_minor.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_minor.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_minor.common().member_flags().IS_OPTIONAL(false); + cst_minor.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_minor.common().member_flags().IS_KEY(false); + cst_minor.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_minor.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + cst_minor.detail().name("minor"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_minor); + + + // Header + type_object->complete().struct_type().header().detail().type_name("ProtocolVersion_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("ProtocolVersion_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("ProtocolVersion_t", true); + } + + + + const TypeIdentifier* GetVendorId_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("VendorId_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetVendorId_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("VendorId_t", complete); + } + + const TypeObject* GetVendorId_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("VendorId_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteVendorId_tObject(); + } + //else + return GetMinimalVendorId_tObject(); + } + + const TypeObject* GetMinimalVendorId_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("VendorId_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_vendorId; + mst_vendorId.common().member_id(memberId++); + mst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_vendorId.common().member_flags().IS_OPTIONAL(false); + mst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_vendorId.common().member_flags().IS_KEY(false); + mst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_vendorId.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, false)); + + MD5 vendorId_hash("vendorId"); + for(int i = 0; i < 4; ++i) + { + mst_vendorId.detail().name_hash()[i] = vendorId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_vendorId); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("VendorId_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("VendorId_t", false); + } + + const TypeObject* GetCompleteVendorId_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("VendorId_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_vendorId; + cst_vendorId.common().member_id(memberId++); + cst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_vendorId.common().member_flags().IS_OPTIONAL(false); + cst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_vendorId.common().member_flags().IS_KEY(false); + cst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_vendorId.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, true)); + + cst_vendorId.detail().name("vendorId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_vendorId); + + + // Header + type_object->complete().struct_type().header().detail().type_name("VendorId_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("VendorId_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("VendorId_t", true); + } + + + + const TypeIdentifier* GetGuidPrefix_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("GuidPrefix_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetGuidPrefix_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("GuidPrefix_t", complete); + } + + const TypeObject* GetGuidPrefix_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GuidPrefix_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteGuidPrefix_tObject(); + } + //else + return GetMinimalGuidPrefix_tObject(); + } + + const TypeObject* GetMinimalGuidPrefix_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GuidPrefix_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_value; + mst_value.common().member_id(memberId++); + mst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_value.common().member_flags().IS_OPTIONAL(false); + mst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_value.common().member_flags().IS_KEY(false); + mst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {12}, false)); + + MD5 value_hash("value"); + for(int i = 0; i < 4; ++i) + { + mst_value.detail().name_hash()[i] = value_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_value); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("GuidPrefix_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("GuidPrefix_t", false); + } + + const TypeObject* GetCompleteGuidPrefix_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GuidPrefix_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_value; + cst_value.common().member_id(memberId++); + cst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_value.common().member_flags().IS_OPTIONAL(false); + cst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_value.common().member_flags().IS_KEY(false); + cst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {12}, true)); + + cst_value.detail().name("value"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_value); + + + // Header + type_object->complete().struct_type().header().detail().type_name("GuidPrefix_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("GuidPrefix_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("GuidPrefix_t", true); + } + + + + const TypeIdentifier* GetGUID_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("GUID_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetGUID_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("GUID_t", complete); + } + + const TypeObject* GetGUID_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GUID_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteGUID_tObject(); + } + //else + return GetMinimalGUID_tObject(); + } + + const TypeObject* GetMinimalGUID_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GUID_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_guidPrefix; + mst_guidPrefix.common().member_id(memberId++); + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + mst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_guidPrefix.common().member_flags().IS_KEY(false); + mst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(false)); + + MD5 guidPrefix_hash("guidPrefix"); + for(int i = 0; i < 4; ++i) + { + mst_guidPrefix.detail().name_hash()[i] = guidPrefix_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_guidPrefix); + + MinimalStructMember mst_entityId; + mst_entityId.common().member_id(memberId++); + mst_entityId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_entityId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_entityId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_entityId.common().member_flags().IS_OPTIONAL(false); + mst_entityId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_entityId.common().member_flags().IS_KEY(false); + mst_entityId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_entityId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(false)); + + MD5 entityId_hash("entityId"); + for(int i = 0; i < 4; ++i) + { + mst_entityId.detail().name_hash()[i] = entityId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_entityId); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("GUID_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("GUID_t", false); + } + + const TypeObject* GetCompleteGUID_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("GUID_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_guidPrefix; + cst_guidPrefix.common().member_id(memberId++); + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + cst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_guidPrefix.common().member_flags().IS_KEY(false); + cst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(true)); + + cst_guidPrefix.detail().name("guidPrefix"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_guidPrefix); + + CompleteStructMember cst_entityId; + cst_entityId.common().member_id(memberId++); + cst_entityId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_entityId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_entityId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_entityId.common().member_flags().IS_OPTIONAL(false); + cst_entityId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_entityId.common().member_flags().IS_KEY(false); + cst_entityId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_entityId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(true)); + + cst_entityId.detail().name("entityId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_entityId); + + + // Header + type_object->complete().struct_type().header().detail().type_name("GUID_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("GUID_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("GUID_t", true); + } + + + + const TypeIdentifier* GetSequenceNumber_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceNumber_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetSequenceNumber_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("SequenceNumber_t", complete); + } + + const TypeObject* GetSequenceNumber_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceNumber_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteSequenceNumber_tObject(); + } + //else + return GetMinimalSequenceNumber_tObject(); + } + + const TypeObject* GetMinimalSequenceNumber_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceNumber_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_high; + mst_high.common().member_id(memberId++); + mst_high.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_high.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_high.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_high.common().member_flags().IS_OPTIONAL(false); + mst_high.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_high.common().member_flags().IS_KEY(false); + mst_high.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_high.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + MD5 high_hash("high"); + for(int i = 0; i < 4; ++i) + { + mst_high.detail().name_hash()[i] = high_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_high); + + MinimalStructMember mst_low; + mst_low.common().member_id(memberId++); + mst_low.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_low.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_low.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_low.common().member_flags().IS_OPTIONAL(false); + mst_low.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_low.common().member_flags().IS_KEY(false); + mst_low.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_low.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + MD5 low_hash("low"); + for(int i = 0; i < 4; ++i) + { + mst_low.detail().name_hash()[i] = low_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_low); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SequenceNumber_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SequenceNumber_t", false); + } + + const TypeObject* GetCompleteSequenceNumber_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceNumber_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_high; + cst_high.common().member_id(memberId++); + cst_high.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_high.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_high.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_high.common().member_flags().IS_OPTIONAL(false); + cst_high.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_high.common().member_flags().IS_KEY(false); + cst_high.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_high.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + cst_high.detail().name("high"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_high); + + CompleteStructMember cst_low; + cst_low.common().member_id(memberId++); + cst_low.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_low.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_low.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_low.common().member_flags().IS_OPTIONAL(false); + cst_low.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_low.common().member_flags().IS_KEY(false); + cst_low.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_low.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + cst_low.detail().name("low"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_low); + + + // Header + type_object->complete().struct_type().header().detail().type_name("SequenceNumber_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SequenceNumber_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SequenceNumber_t", true); + } + + + + const TypeIdentifier* GetCount_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Count_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetCount_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("Count_t", complete); + } + + const TypeObject* GetCount_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Count_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteCount_tObject(); + } + //else + return GetMinimalCount_tObject(); + } + + const TypeObject* GetMinimalCount_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Count_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_value; + mst_value.common().member_id(memberId++); + mst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_value.common().member_flags().IS_OPTIONAL(false); + mst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_value.common().member_flags().IS_KEY(false); + mst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + MD5 value_hash("value"); + for(int i = 0; i < 4; ++i) + { + mst_value.detail().name_hash()[i] = value_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_value); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Count_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Count_t", false); + } + + const TypeObject* GetCompleteCount_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Count_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_value; + cst_value.common().member_id(memberId++); + cst_value.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_value.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_value.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_value.common().member_flags().IS_OPTIONAL(false); + cst_value.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_value.common().member_flags().IS_KEY(false); + cst_value.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + cst_value.detail().name("value"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_value); + + + // Header + type_object->complete().struct_type().header().detail().type_name("Count_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Count_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Count_t", true); + } + + + + const TypeIdentifier* GetTime_tIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Time_t", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetTime_tObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("Time_t", complete); + } + + const TypeObject* GetTime_tObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Time_t", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteTime_tObject(); + } + //else + return GetMinimalTime_tObject(); + } + + const TypeObject* GetMinimalTime_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Time_t", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_seconds; + mst_seconds.common().member_id(memberId++); + mst_seconds.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_seconds.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_seconds.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_seconds.common().member_flags().IS_OPTIONAL(false); + mst_seconds.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_seconds.common().member_flags().IS_KEY(false); + mst_seconds.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_seconds.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + MD5 seconds_hash("seconds"); + for(int i = 0; i < 4; ++i) + { + mst_seconds.detail().name_hash()[i] = seconds_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_seconds); + + MinimalStructMember mst_fraction; + mst_fraction.common().member_id(memberId++); + mst_fraction.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_fraction.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_fraction.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_fraction.common().member_flags().IS_OPTIONAL(false); + mst_fraction.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_fraction.common().member_flags().IS_KEY(false); + mst_fraction.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_fraction.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + MD5 fraction_hash("fraction"); + for(int i = 0; i < 4; ++i) + { + mst_fraction.detail().name_hash()[i] = fraction_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_fraction); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Time_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Time_t", false); + } + + const TypeObject* GetCompleteTime_tObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Time_t", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_seconds; + cst_seconds.common().member_id(memberId++); + cst_seconds.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_seconds.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_seconds.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_seconds.common().member_flags().IS_OPTIONAL(false); + cst_seconds.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_seconds.common().member_flags().IS_KEY(false); + cst_seconds.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_seconds.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + cst_seconds.detail().name("seconds"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_seconds); + + CompleteStructMember cst_fraction; + cst_fraction.common().member_id(memberId++); + cst_fraction.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_fraction.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_fraction.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_fraction.common().member_flags().IS_OPTIONAL(false); + cst_fraction.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_fraction.common().member_flags().IS_KEY(false); + cst_fraction.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_fraction.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); + + + cst_fraction.detail().name("fraction"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_fraction); + + + // Header + type_object->complete().struct_type().header().detail().type_name("Time_t"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Time_t", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Time_t", true); + } + + const TypeIdentifier* GetTimestampIdentifier(bool complete) + { + const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Timestamp", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetTimestampObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("Timestamp", complete); + } + + const TypeObject* GetTimestampObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Timestamp", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteTimestampObject(); + } + else + { + return GetMinimalTimestampObject(); + } + } + + const TypeObject* GetMinimalTimestampObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Timestamp", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_ALIAS); + + // No flags apply + //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); + //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); + //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); + //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); + //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); + + // type_object->minimal().alias_type().header()... Is empty + + // No flags apply + //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); + //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); + //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); + //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); + //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); + //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); + //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); + + // Must be defined already, if don't, may be an recursive alias + const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("eprosima::fastdds::rtps::core::detail::Time_t", false); + + + if (relatedType != nullptr) + { + type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy + } + else + { + // Cannot determine base type + delete type_object; + return nullptr; + } + + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + // Don't add our TypeIdentifier but our alias + TypeObjectFactory::get_instance()->add_alias("Timestamp", "eprosima::fastdds::rtps::core::detail::Time_t"); + + TypeObjectFactory::get_instance()->add_type_object("Timestamp", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Timestamp", false); + } + + const TypeObject* GetCompleteTimestampObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Timestamp", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_ALIAS); + + // No flags apply + //type_object->complete().alias_type().alias_flags().IS_FINAL(false); + //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); + //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); + //type_object->complete().alias_type().alias_flags().IS_NESTED(false); + //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); + + //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); + //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); + //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); + //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); + type_object->complete().alias_type().header().detail().type_name("Timestamp"); + + // No flags apply + //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); + //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); + //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); + //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); + //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); + //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); + //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); + + //type_object->complete().alias_type().body().common().ann_builtin() + //type_object->complete().alias_type().body().common().ann_custom() + + // Must be defined already, if don't, may be an recursive alias + const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("eprosima::fastdds::rtps::core::detail::Time_t"); + + + if (relatedType != nullptr) + { + type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy + } + else + { + // Cannot determine base type + delete type_object; + return nullptr; + } + + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + // Don't add our TypeIdentifier but our alias + TypeObjectFactory::get_instance()->add_alias("Timestamp", "eprosima::fastdds::rtps::core::detail::Time_t"); + + TypeObjectFactory::get_instance()->add_type_object("Timestamp", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Timestamp", true); + } + + } // namespace detail + + + const TypeIdentifier* GetHeaderIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Header", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetHeaderObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("Header", complete); + } + + const TypeObject* GetHeaderObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Header", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteHeaderObject(); + } + //else + return GetMinimalHeaderObject(); + } + + const TypeObject* GetMinimalHeaderObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Header", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_prefix; + mst_prefix.common().member_id(memberId++); + mst_prefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_prefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_prefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_prefix.common().member_flags().IS_OPTIONAL(false); + mst_prefix.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_prefix.common().member_flags().IS_KEY(false); + mst_prefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_prefix.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {4}, false)); + + MD5 prefix_hash("prefix"); + for(int i = 0; i < 4; ++i) + { + mst_prefix.detail().name_hash()[i] = prefix_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_prefix); + + MinimalStructMember mst_version; + mst_version.common().member_id(memberId++); + mst_version.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_version.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_version.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_version.common().member_flags().IS_OPTIONAL(false); + mst_version.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_version.common().member_flags().IS_KEY(false); + mst_version.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_version.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(false)); + + MD5 version_hash("version"); + for(int i = 0; i < 4; ++i) + { + mst_version.detail().name_hash()[i] = version_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_version); + + MinimalStructMember mst_vendorId; + mst_vendorId.common().member_id(memberId++); + mst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_vendorId.common().member_flags().IS_OPTIONAL(false); + mst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_vendorId.common().member_flags().IS_KEY(false); + mst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_vendorId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(false)); + + MD5 vendorId_hash("vendorId"); + for(int i = 0; i < 4; ++i) + { + mst_vendorId.detail().name_hash()[i] = vendorId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_vendorId); + + MinimalStructMember mst_guidPrefix; + mst_guidPrefix.common().member_id(memberId++); + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + mst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_guidPrefix.common().member_flags().IS_KEY(false); + mst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(false)); + + MD5 guidPrefix_hash("guidPrefix"); + for(int i = 0; i < 4; ++i) + { + mst_guidPrefix.detail().name_hash()[i] = guidPrefix_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_guidPrefix); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Header", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Header", false); + } + + const TypeObject* GetCompleteHeaderObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Header", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_prefix; + cst_prefix.common().member_id(memberId++); + cst_prefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_prefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_prefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_prefix.common().member_flags().IS_OPTIONAL(false); + cst_prefix.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_prefix.common().member_flags().IS_KEY(false); + cst_prefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_prefix.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {4}, true)); + + cst_prefix.detail().name("prefix"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_prefix); + + CompleteStructMember cst_version; + cst_version.common().member_id(memberId++); + cst_version.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_version.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_version.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_version.common().member_flags().IS_OPTIONAL(false); + cst_version.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_version.common().member_flags().IS_KEY(false); + cst_version.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_version.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(true)); + + cst_version.detail().name("version"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_version); + + CompleteStructMember cst_vendorId; + cst_vendorId.common().member_id(memberId++); + cst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_vendorId.common().member_flags().IS_OPTIONAL(false); + cst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_vendorId.common().member_flags().IS_KEY(false); + cst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_vendorId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(true)); + + cst_vendorId.detail().name("vendorId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_vendorId); + + CompleteStructMember cst_guidPrefix; + cst_guidPrefix.common().member_id(memberId++); + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + cst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_guidPrefix.common().member_flags().IS_KEY(false); + cst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(true)); + + cst_guidPrefix.detail().name("guidPrefix"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_guidPrefix); + + + // Header + type_object->complete().struct_type().header().detail().type_name("Header"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Header", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("Header", true); + } + + + + const TypeIdentifier* GetSubmessageHeaderIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SubmessageHeader", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetSubmessageHeaderObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("SubmessageHeader", complete); + } + + const TypeObject* GetSubmessageHeaderObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageHeader", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteSubmessageHeaderObject(); + } + //else + return GetMinimalSubmessageHeaderObject(); + } + + const TypeObject* GetMinimalSubmessageHeaderObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageHeader", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_submessageId; + mst_submessageId.common().member_id(memberId++); + mst_submessageId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submessageId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submessageId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submessageId.common().member_flags().IS_OPTIONAL(false); + mst_submessageId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submessageId.common().member_flags().IS_KEY(false); + mst_submessageId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submessageId.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + MD5 submessageId_hash("submessageId"); + for(int i = 0; i < 4; ++i) + { + mst_submessageId.detail().name_hash()[i] = submessageId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submessageId); + + MinimalStructMember mst_flags; + mst_flags.common().member_id(memberId++); + mst_flags.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_flags.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_flags.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_flags.common().member_flags().IS_OPTIONAL(false); + mst_flags.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_flags.common().member_flags().IS_KEY(false); + mst_flags.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_flags.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + MD5 flags_hash("flags"); + for(int i = 0; i < 4; ++i) + { + mst_flags.detail().name_hash()[i] = flags_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_flags); + + MinimalStructMember mst_submessageLength; + mst_submessageLength.common().member_id(memberId++); + mst_submessageLength.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submessageLength.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submessageLength.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submessageLength.common().member_flags().IS_OPTIONAL(false); + mst_submessageLength.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submessageLength.common().member_flags().IS_KEY(false); + mst_submessageLength.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submessageLength.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); + + + MD5 submessageLength_hash("submessageLength"); + for(int i = 0; i < 4; ++i) + { + mst_submessageLength.detail().name_hash()[i] = submessageLength_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submessageLength); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SubmessageHeader", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SubmessageHeader", false); + } + + const TypeObject* GetCompleteSubmessageHeaderObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageHeader", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_submessageId; + cst_submessageId.common().member_id(memberId++); + cst_submessageId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submessageId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submessageId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submessageId.common().member_flags().IS_OPTIONAL(false); + cst_submessageId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submessageId.common().member_flags().IS_KEY(false); + cst_submessageId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submessageId.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + cst_submessageId.detail().name("submessageId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submessageId); + + CompleteStructMember cst_flags; + cst_flags.common().member_id(memberId++); + cst_flags.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_flags.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_flags.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_flags.common().member_flags().IS_OPTIONAL(false); + cst_flags.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_flags.common().member_flags().IS_KEY(false); + cst_flags.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_flags.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); + + + cst_flags.detail().name("flags"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_flags); + + CompleteStructMember cst_submessageLength; + cst_submessageLength.common().member_id(memberId++); + cst_submessageLength.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submessageLength.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submessageLength.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submessageLength.common().member_flags().IS_OPTIONAL(false); + cst_submessageLength.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submessageLength.common().member_flags().IS_KEY(false); + cst_submessageLength.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submessageLength.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); + + + cst_submessageLength.detail().name("submessageLength"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submessageLength); + + + // Header + type_object->complete().struct_type().header().detail().type_name("SubmessageHeader"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SubmessageHeader", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SubmessageHeader", true); + } + + const TypeIdentifier* GetSubmessageKindIdentifier(bool complete) + { + const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SubmessageKind", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetSubmessageKindObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("SubmessageKind", complete); + } + + const TypeObject* GetSubmessageKindObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageKind", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteSubmessageKindObject(); + } + // else + return GetMinimalSubmessageKindObject(); + } + + const TypeObject* GetMinimalSubmessageKindObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageKind", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_ENUM); + + // No flags apply + //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); + //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); + //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); + //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); + //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); + + type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? + + uint32_t value = 0; + MinimalEnumeratedLiteral mel_RTPS_HE; + mel_RTPS_HE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_RTPS_HE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_RTPS_HE.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_RTPS_HE.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_RTPS_HE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_RTPS_HE.common().flags().IS_KEY(false); // Doesn't apply + mel_RTPS_HE.common().flags().IS_DEFAULT(false); + mel_RTPS_HE.common().value(value++); + MD5 RTPS_HE_hash("RTPS_HE"); + for(int i = 0; i < 4; ++i) + { + mel_RTPS_HE.detail().name_hash()[i] = RTPS_HE_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_RTPS_HE); + + MinimalEnumeratedLiteral mel_PAD; + mel_PAD.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_PAD.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_PAD.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_PAD.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_PAD.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_PAD.common().flags().IS_KEY(false); // Doesn't apply + mel_PAD.common().flags().IS_DEFAULT(false); + mel_PAD.common().value(value++); + MD5 PAD_hash("PAD"); + for(int i = 0; i < 4; ++i) + { + mel_PAD.detail().name_hash()[i] = PAD_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_PAD); + + MinimalEnumeratedLiteral mel_ACKNACK; + mel_ACKNACK.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_ACKNACK.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_ACKNACK.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_ACKNACK.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_ACKNACK.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_ACKNACK.common().flags().IS_KEY(false); // Doesn't apply + mel_ACKNACK.common().flags().IS_DEFAULT(false); + mel_ACKNACK.common().value(value++); + MD5 ACKNACK_hash("ACKNACK"); + for(int i = 0; i < 4; ++i) + { + mel_ACKNACK.detail().name_hash()[i] = ACKNACK_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_ACKNACK); + + MinimalEnumeratedLiteral mel_HEARTBEAT; + mel_HEARTBEAT.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_HEARTBEAT.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_HEARTBEAT.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_HEARTBEAT.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_HEARTBEAT.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_HEARTBEAT.common().flags().IS_KEY(false); // Doesn't apply + mel_HEARTBEAT.common().flags().IS_DEFAULT(false); + mel_HEARTBEAT.common().value(value++); + MD5 HEARTBEAT_hash("HEARTBEAT"); + for(int i = 0; i < 4; ++i) + { + mel_HEARTBEAT.detail().name_hash()[i] = HEARTBEAT_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_HEARTBEAT); + + MinimalEnumeratedLiteral mel_GAP; + mel_GAP.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_GAP.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_GAP.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_GAP.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_GAP.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_GAP.common().flags().IS_KEY(false); // Doesn't apply + mel_GAP.common().flags().IS_DEFAULT(false); + mel_GAP.common().value(value++); + MD5 GAP_hash("GAP"); + for(int i = 0; i < 4; ++i) + { + mel_GAP.detail().name_hash()[i] = GAP_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_GAP); + + MinimalEnumeratedLiteral mel_INFO_TS; + mel_INFO_TS.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_INFO_TS.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_INFO_TS.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_INFO_TS.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_INFO_TS.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_INFO_TS.common().flags().IS_KEY(false); // Doesn't apply + mel_INFO_TS.common().flags().IS_DEFAULT(false); + mel_INFO_TS.common().value(value++); + MD5 INFO_TS_hash("INFO_TS"); + for(int i = 0; i < 4; ++i) + { + mel_INFO_TS.detail().name_hash()[i] = INFO_TS_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_INFO_TS); + + MinimalEnumeratedLiteral mel_INFO_SRC; + mel_INFO_SRC.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_INFO_SRC.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_INFO_SRC.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_INFO_SRC.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_INFO_SRC.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_INFO_SRC.common().flags().IS_KEY(false); // Doesn't apply + mel_INFO_SRC.common().flags().IS_DEFAULT(false); + mel_INFO_SRC.common().value(value++); + MD5 INFO_SRC_hash("INFO_SRC"); + for(int i = 0; i < 4; ++i) + { + mel_INFO_SRC.detail().name_hash()[i] = INFO_SRC_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_INFO_SRC); + + MinimalEnumeratedLiteral mel_INFO_REPLY_IP4; + mel_INFO_REPLY_IP4.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().IS_KEY(false); // Doesn't apply + mel_INFO_REPLY_IP4.common().flags().IS_DEFAULT(false); + mel_INFO_REPLY_IP4.common().value(value++); + MD5 INFO_REPLY_IP4_hash("INFO_REPLY_IP4"); + for(int i = 0; i < 4; ++i) + { + mel_INFO_REPLY_IP4.detail().name_hash()[i] = INFO_REPLY_IP4_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_INFO_REPLY_IP4); + + MinimalEnumeratedLiteral mel_INFO_DST; + mel_INFO_DST.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_INFO_DST.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_INFO_DST.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_INFO_DST.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_INFO_DST.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_INFO_DST.common().flags().IS_KEY(false); // Doesn't apply + mel_INFO_DST.common().flags().IS_DEFAULT(false); + mel_INFO_DST.common().value(value++); + MD5 INFO_DST_hash("INFO_DST"); + for(int i = 0; i < 4; ++i) + { + mel_INFO_DST.detail().name_hash()[i] = INFO_DST_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_INFO_DST); + + MinimalEnumeratedLiteral mel_INFO_REPLY; + mel_INFO_REPLY.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_INFO_REPLY.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_INFO_REPLY.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_INFO_REPLY.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_INFO_REPLY.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_INFO_REPLY.common().flags().IS_KEY(false); // Doesn't apply + mel_INFO_REPLY.common().flags().IS_DEFAULT(false); + mel_INFO_REPLY.common().value(value++); + MD5 INFO_REPLY_hash("INFO_REPLY"); + for(int i = 0; i < 4; ++i) + { + mel_INFO_REPLY.detail().name_hash()[i] = INFO_REPLY_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_INFO_REPLY); + + MinimalEnumeratedLiteral mel_NACK_FRAG; + mel_NACK_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_NACK_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_NACK_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_NACK_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_NACK_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_NACK_FRAG.common().flags().IS_KEY(false); // Doesn't apply + mel_NACK_FRAG.common().flags().IS_DEFAULT(false); + mel_NACK_FRAG.common().value(value++); + MD5 NACK_FRAG_hash("NACK_FRAG"); + for(int i = 0; i < 4; ++i) + { + mel_NACK_FRAG.detail().name_hash()[i] = NACK_FRAG_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_NACK_FRAG); + + MinimalEnumeratedLiteral mel_HEARTBEAT_FRAG; + mel_HEARTBEAT_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().IS_KEY(false); // Doesn't apply + mel_HEARTBEAT_FRAG.common().flags().IS_DEFAULT(false); + mel_HEARTBEAT_FRAG.common().value(value++); + MD5 HEARTBEAT_FRAG_hash("HEARTBEAT_FRAG"); + for(int i = 0; i < 4; ++i) + { + mel_HEARTBEAT_FRAG.detail().name_hash()[i] = HEARTBEAT_FRAG_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_HEARTBEAT_FRAG); + + MinimalEnumeratedLiteral mel_DATA; + mel_DATA.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_DATA.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_DATA.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_DATA.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_DATA.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_DATA.common().flags().IS_KEY(false); // Doesn't apply + mel_DATA.common().flags().IS_DEFAULT(false); + mel_DATA.common().value(value++); + MD5 DATA_hash("DATA"); + for(int i = 0; i < 4; ++i) + { + mel_DATA.detail().name_hash()[i] = DATA_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_DATA); + + MinimalEnumeratedLiteral mel_DATA_FRAG; + mel_DATA_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + mel_DATA_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + mel_DATA_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + mel_DATA_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + mel_DATA_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mel_DATA_FRAG.common().flags().IS_KEY(false); // Doesn't apply + mel_DATA_FRAG.common().flags().IS_DEFAULT(false); + mel_DATA_FRAG.common().value(value++); + MD5 DATA_FRAG_hash("DATA_FRAG"); + for(int i = 0; i < 4; ++i) + { + mel_DATA_FRAG.detail().name_hash()[i] = DATA_FRAG_hash.digest[i]; + } + type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_DATA_FRAG); + + + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SubmessageKind", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SubmessageKind", false); + } + + const TypeObject* GetCompleteSubmessageKindObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SubmessageKind", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_ENUM); + + // No flags apply + //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); + //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); + //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); + //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); + //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); + + type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? + type_object->complete().enumerated_type().header().detail().type_name("SubmessageKind"); + + uint32_t value = 0; + CompleteEnumeratedLiteral cel_RTPS_HE; + cel_RTPS_HE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_RTPS_HE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_RTPS_HE.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_RTPS_HE.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_RTPS_HE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_RTPS_HE.common().flags().IS_KEY(false); // Doesn't apply + cel_RTPS_HE.common().flags().IS_DEFAULT(false); + cel_RTPS_HE.common().value(value++); + cel_RTPS_HE.detail().name("RTPS_HE"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x00"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_RTPS_HE.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_RTPS_HE); + + CompleteEnumeratedLiteral cel_PAD; + cel_PAD.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_PAD.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_PAD.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_PAD.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_PAD.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_PAD.common().flags().IS_KEY(false); // Doesn't apply + cel_PAD.common().flags().IS_DEFAULT(false); + cel_PAD.common().value(value++); + cel_PAD.detail().name("PAD"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x01"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_PAD.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_PAD); + + CompleteEnumeratedLiteral cel_ACKNACK; + cel_ACKNACK.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_ACKNACK.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_ACKNACK.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_ACKNACK.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_ACKNACK.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_ACKNACK.common().flags().IS_KEY(false); // Doesn't apply + cel_ACKNACK.common().flags().IS_DEFAULT(false); + cel_ACKNACK.common().value(value++); + cel_ACKNACK.detail().name("ACKNACK"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x06"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_ACKNACK.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_ACKNACK); + + CompleteEnumeratedLiteral cel_HEARTBEAT; + cel_HEARTBEAT.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_HEARTBEAT.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_HEARTBEAT.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_HEARTBEAT.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_HEARTBEAT.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_HEARTBEAT.common().flags().IS_KEY(false); // Doesn't apply + cel_HEARTBEAT.common().flags().IS_DEFAULT(false); + cel_HEARTBEAT.common().value(value++); + cel_HEARTBEAT.detail().name("HEARTBEAT"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x07"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_HEARTBEAT.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_HEARTBEAT); + + CompleteEnumeratedLiteral cel_GAP; + cel_GAP.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_GAP.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_GAP.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_GAP.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_GAP.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_GAP.common().flags().IS_KEY(false); // Doesn't apply + cel_GAP.common().flags().IS_DEFAULT(false); + cel_GAP.common().value(value++); + cel_GAP.detail().name("GAP"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x08"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_GAP.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_GAP); + + CompleteEnumeratedLiteral cel_INFO_TS; + cel_INFO_TS.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_INFO_TS.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_INFO_TS.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_INFO_TS.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_INFO_TS.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_INFO_TS.common().flags().IS_KEY(false); // Doesn't apply + cel_INFO_TS.common().flags().IS_DEFAULT(false); + cel_INFO_TS.common().value(value++); + cel_INFO_TS.detail().name("INFO_TS"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x09"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_INFO_TS.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_INFO_TS); + + CompleteEnumeratedLiteral cel_INFO_SRC; + cel_INFO_SRC.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_INFO_SRC.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_INFO_SRC.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_INFO_SRC.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_INFO_SRC.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_INFO_SRC.common().flags().IS_KEY(false); // Doesn't apply + cel_INFO_SRC.common().flags().IS_DEFAULT(false); + cel_INFO_SRC.common().value(value++); + cel_INFO_SRC.detail().name("INFO_SRC"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x0c"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_INFO_SRC.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_INFO_SRC); + + CompleteEnumeratedLiteral cel_INFO_REPLY_IP4; + cel_INFO_REPLY_IP4.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().IS_KEY(false); // Doesn't apply + cel_INFO_REPLY_IP4.common().flags().IS_DEFAULT(false); + cel_INFO_REPLY_IP4.common().value(value++); + cel_INFO_REPLY_IP4.detail().name("INFO_REPLY_IP4"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x0d"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_INFO_REPLY_IP4.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_INFO_REPLY_IP4); + + CompleteEnumeratedLiteral cel_INFO_DST; + cel_INFO_DST.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_INFO_DST.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_INFO_DST.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_INFO_DST.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_INFO_DST.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_INFO_DST.common().flags().IS_KEY(false); // Doesn't apply + cel_INFO_DST.common().flags().IS_DEFAULT(false); + cel_INFO_DST.common().value(value++); + cel_INFO_DST.detail().name("INFO_DST"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x0e"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_INFO_DST.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_INFO_DST); + + CompleteEnumeratedLiteral cel_INFO_REPLY; + cel_INFO_REPLY.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_INFO_REPLY.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_INFO_REPLY.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_INFO_REPLY.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_INFO_REPLY.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_INFO_REPLY.common().flags().IS_KEY(false); // Doesn't apply + cel_INFO_REPLY.common().flags().IS_DEFAULT(false); + cel_INFO_REPLY.common().value(value++); + cel_INFO_REPLY.detail().name("INFO_REPLY"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x0f"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_INFO_REPLY.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_INFO_REPLY); + + CompleteEnumeratedLiteral cel_NACK_FRAG; + cel_NACK_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_NACK_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_NACK_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_NACK_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_NACK_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_NACK_FRAG.common().flags().IS_KEY(false); // Doesn't apply + cel_NACK_FRAG.common().flags().IS_DEFAULT(false); + cel_NACK_FRAG.common().value(value++); + cel_NACK_FRAG.detail().name("NACK_FRAG"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x12"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_NACK_FRAG.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_NACK_FRAG); + + CompleteEnumeratedLiteral cel_HEARTBEAT_FRAG; + cel_HEARTBEAT_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().IS_KEY(false); // Doesn't apply + cel_HEARTBEAT_FRAG.common().flags().IS_DEFAULT(false); + cel_HEARTBEAT_FRAG.common().value(value++); + cel_HEARTBEAT_FRAG.detail().name("HEARTBEAT_FRAG"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x13"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_HEARTBEAT_FRAG.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_HEARTBEAT_FRAG); + + CompleteEnumeratedLiteral cel_DATA; + cel_DATA.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_DATA.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_DATA.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_DATA.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_DATA.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_DATA.common().flags().IS_KEY(false); // Doesn't apply + cel_DATA.common().flags().IS_DEFAULT(false); + cel_DATA.common().value(value++); + cel_DATA.detail().name("DATA"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x15"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_DATA.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_DATA); + + CompleteEnumeratedLiteral cel_DATA_FRAG; + cel_DATA_FRAG.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply + cel_DATA_FRAG.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply + cel_DATA_FRAG.common().flags().IS_EXTERNAL(false); // Doesn't apply + cel_DATA_FRAG.common().flags().IS_OPTIONAL(false); // Doesn't apply + cel_DATA_FRAG.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cel_DATA_FRAG.common().flags().IS_KEY(false); // Doesn't apply + cel_DATA_FRAG.common().flags().IS_DEFAULT(false); + cel_DATA_FRAG.common().value(value++); + cel_DATA_FRAG.detail().name("DATA_FRAG"); + + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetvalueIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("value")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0x16"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cel_DATA_FRAG.detail().ann_custom().push_back(ann); + } + + + type_object->complete().enumerated_type().literal_seq().emplace_back(cel_DATA_FRAG); + + + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("SubmessageKind", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("SubmessageKind", true); + } + + + + const TypeIdentifier* GetHeartBeatSubmessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HeartBeatSubmessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetHeartBeatSubmessageObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("HeartBeatSubmessage", complete); + } + + const TypeObject* GetHeartBeatSubmessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HeartBeatSubmessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteHeartBeatSubmessageObject(); + } + //else + return GetMinimalHeartBeatSubmessageObject(); + } + + const TypeObject* GetMinimalHeartBeatSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HeartBeatSubmessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_submsgHeader; + mst_submsgHeader.common().member_id(memberId++); + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + mst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submsgHeader.common().member_flags().IS_KEY(false); + mst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false)); + + MD5 submsgHeader_hash("submsgHeader"); + for(int i = 0; i < 4; ++i) + { + mst_submsgHeader.detail().name_hash()[i] = submsgHeader_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submsgHeader); + + MinimalStructMember mst_readerId; + mst_readerId.common().member_id(memberId++); + mst_readerId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_readerId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_readerId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_readerId.common().member_flags().IS_OPTIONAL(false); + mst_readerId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_readerId.common().member_flags().IS_KEY(false); + mst_readerId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_readerId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(false)); + + MD5 readerId_hash("readerId"); + for(int i = 0; i < 4; ++i) + { + mst_readerId.detail().name_hash()[i] = readerId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_readerId); + + MinimalStructMember mst_writerId; + mst_writerId.common().member_id(memberId++); + mst_writerId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_writerId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_writerId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_writerId.common().member_flags().IS_OPTIONAL(false); + mst_writerId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_writerId.common().member_flags().IS_KEY(false); + mst_writerId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_writerId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(false)); + + MD5 writerId_hash("writerId"); + for(int i = 0; i < 4; ++i) + { + mst_writerId.detail().name_hash()[i] = writerId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_writerId); + + MinimalStructMember mst_firstSN; + mst_firstSN.common().member_id(memberId++); + mst_firstSN.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_firstSN.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_firstSN.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_firstSN.common().member_flags().IS_OPTIONAL(false); + mst_firstSN.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_firstSN.common().member_flags().IS_KEY(false); + mst_firstSN.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_firstSN.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(false)); + + MD5 firstSN_hash("firstSN"); + for(int i = 0; i < 4; ++i) + { + mst_firstSN.detail().name_hash()[i] = firstSN_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_firstSN); + + MinimalStructMember mst_lastSN; + mst_lastSN.common().member_id(memberId++); + mst_lastSN.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_lastSN.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_lastSN.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_lastSN.common().member_flags().IS_OPTIONAL(false); + mst_lastSN.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_lastSN.common().member_flags().IS_KEY(false); + mst_lastSN.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_lastSN.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(false)); + + MD5 lastSN_hash("lastSN"); + for(int i = 0; i < 4; ++i) + { + mst_lastSN.detail().name_hash()[i] = lastSN_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_lastSN); + + MinimalStructMember mst_count; + mst_count.common().member_id(memberId++); + mst_count.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_count.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_count.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_count.common().member_flags().IS_OPTIONAL(false); + mst_count.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_count.common().member_flags().IS_KEY(false); + mst_count.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_count.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetCount_tIdentifier(false)); + + MD5 count_hash("count"); + for(int i = 0; i < 4; ++i) + { + mst_count.detail().name_hash()[i] = count_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_count); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("HeartBeatSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("HeartBeatSubmessage", false); + } + + const TypeObject* GetCompleteHeartBeatSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HeartBeatSubmessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_submsgHeader; + cst_submsgHeader.common().member_id(memberId++); + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + cst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submsgHeader.common().member_flags().IS_KEY(false); + cst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true)); + + cst_submsgHeader.detail().name("submsgHeader"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submsgHeader); + + CompleteStructMember cst_readerId; + cst_readerId.common().member_id(memberId++); + cst_readerId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_readerId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_readerId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_readerId.common().member_flags().IS_OPTIONAL(false); + cst_readerId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_readerId.common().member_flags().IS_KEY(false); + cst_readerId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_readerId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(true)); + + cst_readerId.detail().name("readerId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_readerId); + + CompleteStructMember cst_writerId; + cst_writerId.common().member_id(memberId++); + cst_writerId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_writerId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_writerId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_writerId.common().member_flags().IS_OPTIONAL(false); + cst_writerId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_writerId.common().member_flags().IS_KEY(false); + cst_writerId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_writerId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetEntityId_tIdentifier(true)); + + cst_writerId.detail().name("writerId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_writerId); + + CompleteStructMember cst_firstSN; + cst_firstSN.common().member_id(memberId++); + cst_firstSN.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_firstSN.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_firstSN.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_firstSN.common().member_flags().IS_OPTIONAL(false); + cst_firstSN.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_firstSN.common().member_flags().IS_KEY(false); + cst_firstSN.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_firstSN.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(true)); + + cst_firstSN.detail().name("firstSN"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_firstSN); + + CompleteStructMember cst_lastSN; + cst_lastSN.common().member_id(memberId++); + cst_lastSN.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_lastSN.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_lastSN.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_lastSN.common().member_flags().IS_OPTIONAL(false); + cst_lastSN.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_lastSN.common().member_flags().IS_KEY(false); + cst_lastSN.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_lastSN.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetSequenceNumber_tIdentifier(true)); + + cst_lastSN.detail().name("lastSN"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_lastSN); + + CompleteStructMember cst_count; + cst_count.common().member_id(memberId++); + cst_count.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_count.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_count.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_count.common().member_flags().IS_OPTIONAL(false); + cst_count.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_count.common().member_flags().IS_KEY(false); + cst_count.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_count.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetCount_tIdentifier(true)); + + cst_count.detail().name("count"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_count); + + + // Header + type_object->complete().struct_type().header().detail().type_name("HeartBeatSubmessage"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("HeartBeatSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("HeartBeatSubmessage", true); + } + + + + const TypeIdentifier* GetInfoDestinationSubmessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("InfoDestinationSubmessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetInfoDestinationSubmessageObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("InfoDestinationSubmessage", complete); + } + + const TypeObject* GetInfoDestinationSubmessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoDestinationSubmessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteInfoDestinationSubmessageObject(); + } + //else + return GetMinimalInfoDestinationSubmessageObject(); + } + + const TypeObject* GetMinimalInfoDestinationSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoDestinationSubmessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_submsgHeader; + mst_submsgHeader.common().member_id(memberId++); + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + mst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submsgHeader.common().member_flags().IS_KEY(false); + mst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false)); + + MD5 submsgHeader_hash("submsgHeader"); + for(int i = 0; i < 4; ++i) + { + mst_submsgHeader.detail().name_hash()[i] = submsgHeader_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submsgHeader); + + MinimalStructMember mst_guidPrefix; + mst_guidPrefix.common().member_id(memberId++); + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + mst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_guidPrefix.common().member_flags().IS_KEY(false); + mst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(false)); + + MD5 guidPrefix_hash("guidPrefix"); + for(int i = 0; i < 4; ++i) + { + mst_guidPrefix.detail().name_hash()[i] = guidPrefix_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_guidPrefix); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoDestinationSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoDestinationSubmessage", false); + } + + const TypeObject* GetCompleteInfoDestinationSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoDestinationSubmessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_submsgHeader; + cst_submsgHeader.common().member_id(memberId++); + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + cst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submsgHeader.common().member_flags().IS_KEY(false); + cst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true)); + + cst_submsgHeader.detail().name("submsgHeader"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submsgHeader); + + CompleteStructMember cst_guidPrefix; + cst_guidPrefix.common().member_id(memberId++); + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + cst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_guidPrefix.common().member_flags().IS_KEY(false); + cst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(true)); + + cst_guidPrefix.detail().name("guidPrefix"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_guidPrefix); + + + // Header + type_object->complete().struct_type().header().detail().type_name("InfoDestinationSubmessage"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoDestinationSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoDestinationSubmessage", true); + } + + + + const TypeIdentifier* GetInfoSourceSubmessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("InfoSourceSubmessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetInfoSourceSubmessageObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("InfoSourceSubmessage", complete); + } + + const TypeObject* GetInfoSourceSubmessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoSourceSubmessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteInfoSourceSubmessageObject(); + } + //else + return GetMinimalInfoSourceSubmessageObject(); + } + + const TypeObject* GetMinimalInfoSourceSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoSourceSubmessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_submsgHeader; + mst_submsgHeader.common().member_id(memberId++); + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + mst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submsgHeader.common().member_flags().IS_KEY(false); + mst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false)); + + MD5 submsgHeader_hash("submsgHeader"); + for(int i = 0; i < 4; ++i) + { + mst_submsgHeader.detail().name_hash()[i] = submsgHeader_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submsgHeader); + + MinimalStructMember mst_unused; + mst_unused.common().member_id(memberId++); + mst_unused.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_unused.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_unused.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_unused.common().member_flags().IS_OPTIONAL(false); + mst_unused.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_unused.common().member_flags().IS_KEY(false); + mst_unused.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_unused.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + MD5 unused_hash("unused"); + for(int i = 0; i < 4; ++i) + { + mst_unused.detail().name_hash()[i] = unused_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_unused); + + MinimalStructMember mst_version; + mst_version.common().member_id(memberId++); + mst_version.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_version.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_version.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_version.common().member_flags().IS_OPTIONAL(false); + mst_version.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_version.common().member_flags().IS_KEY(false); + mst_version.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_version.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(false)); + + MD5 version_hash("version"); + for(int i = 0; i < 4; ++i) + { + mst_version.detail().name_hash()[i] = version_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_version); + + MinimalStructMember mst_vendorId; + mst_vendorId.common().member_id(memberId++); + mst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_vendorId.common().member_flags().IS_OPTIONAL(false); + mst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_vendorId.common().member_flags().IS_KEY(false); + mst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_vendorId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(false)); + + MD5 vendorId_hash("vendorId"); + for(int i = 0; i < 4; ++i) + { + mst_vendorId.detail().name_hash()[i] = vendorId_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_vendorId); + + MinimalStructMember mst_guidPrefix; + mst_guidPrefix.common().member_id(memberId++); + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + mst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_guidPrefix.common().member_flags().IS_KEY(false); + mst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(false)); + + MD5 guidPrefix_hash("guidPrefix"); + for(int i = 0; i < 4; ++i) + { + mst_guidPrefix.detail().name_hash()[i] = guidPrefix_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_guidPrefix); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoSourceSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoSourceSubmessage", false); + } + + const TypeObject* GetCompleteInfoSourceSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoSourceSubmessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_submsgHeader; + cst_submsgHeader.common().member_id(memberId++); + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + cst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submsgHeader.common().member_flags().IS_KEY(false); + cst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true)); + + cst_submsgHeader.detail().name("submsgHeader"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submsgHeader); + + CompleteStructMember cst_unused; + cst_unused.common().member_id(memberId++); + cst_unused.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_unused.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_unused.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_unused.common().member_flags().IS_OPTIONAL(false); + cst_unused.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_unused.common().member_flags().IS_KEY(false); + cst_unused.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_unused.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); + + + cst_unused.detail().name("unused"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_unused); + + CompleteStructMember cst_version; + cst_version.common().member_id(memberId++); + cst_version.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_version.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_version.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_version.common().member_flags().IS_OPTIONAL(false); + cst_version.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_version.common().member_flags().IS_KEY(false); + cst_version.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_version.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetProtocolVersion_tIdentifier(true)); + + cst_version.detail().name("version"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_version); + + CompleteStructMember cst_vendorId; + cst_vendorId.common().member_id(memberId++); + cst_vendorId.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_vendorId.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_vendorId.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_vendorId.common().member_flags().IS_OPTIONAL(false); + cst_vendorId.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_vendorId.common().member_flags().IS_KEY(false); + cst_vendorId.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_vendorId.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetVendorId_tIdentifier(true)); + + cst_vendorId.detail().name("vendorId"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_vendorId); + + CompleteStructMember cst_guidPrefix; + cst_guidPrefix.common().member_id(memberId++); + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_guidPrefix.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_guidPrefix.common().member_flags().IS_OPTIONAL(false); + cst_guidPrefix.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_guidPrefix.common().member_flags().IS_KEY(false); + cst_guidPrefix.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_guidPrefix.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetGuidPrefix_tIdentifier(true)); + + cst_guidPrefix.detail().name("guidPrefix"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_guidPrefix); + + + // Header + type_object->complete().struct_type().header().detail().type_name("InfoSourceSubmessage"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoSourceSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoSourceSubmessage", true); + } + + + + const TypeIdentifier* GetInfoTimestampSubmessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("InfoTimestampSubmessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetInfoTimestampSubmessageObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("InfoTimestampSubmessage", complete); + } + + const TypeObject* GetInfoTimestampSubmessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoTimestampSubmessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteInfoTimestampSubmessageObject(); + } + //else + return GetMinimalInfoTimestampSubmessageObject(); + } + + const TypeObject* GetMinimalInfoTimestampSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoTimestampSubmessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_submsgHeader; + mst_submsgHeader.common().member_id(memberId++); + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + mst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submsgHeader.common().member_flags().IS_KEY(false); + mst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false)); + + MD5 submsgHeader_hash("submsgHeader"); + for(int i = 0; i < 4; ++i) + { + mst_submsgHeader.detail().name_hash()[i] = submsgHeader_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submsgHeader); + + MinimalStructMember mst_timestamp; + mst_timestamp.common().member_id(memberId++); + mst_timestamp.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_timestamp.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_timestamp.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_timestamp.common().member_flags().IS_OPTIONAL(false); + mst_timestamp.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_timestamp.common().member_flags().IS_KEY(false); + mst_timestamp.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_timestamp.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetTimestampIdentifier(false)); + + MD5 timestamp_hash("timestamp"); + for(int i = 0; i < 4; ++i) + { + mst_timestamp.detail().name_hash()[i] = timestamp_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_timestamp); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoTimestampSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoTimestampSubmessage", false); + } + + const TypeObject* GetCompleteInfoTimestampSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("InfoTimestampSubmessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_submsgHeader; + cst_submsgHeader.common().member_id(memberId++); + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submsgHeader.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submsgHeader.common().member_flags().IS_OPTIONAL(false); + cst_submsgHeader.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submsgHeader.common().member_flags().IS_KEY(false); + cst_submsgHeader.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submsgHeader.common().member_type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true)); + + cst_submsgHeader.detail().name("submsgHeader"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submsgHeader); + + CompleteStructMember cst_timestamp; + cst_timestamp.common().member_id(memberId++); + cst_timestamp.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_timestamp.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_timestamp.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_timestamp.common().member_flags().IS_OPTIONAL(false); + cst_timestamp.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_timestamp.common().member_flags().IS_KEY(false); + cst_timestamp.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_timestamp.common().member_type_id(*eprosima::fastdds::rtps::core::detail::GetTimestampIdentifier(true)); + + cst_timestamp.detail().name("timestamp"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_timestamp); + + + // Header + type_object->complete().struct_type().header().detail().type_name("InfoTimestampSubmessage"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("InfoTimestampSubmessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("InfoTimestampSubmessage", true); + } + + + + const TypeIdentifier* GetSubmessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Submessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetSubmessageObject(complete); + return TypeObjectFactory::get_instance()->get_type_identifier("Submessage", complete); + } + + const TypeObject* GetSubmessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Submessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteSubmessageObject(); + } + // else + return GetMinimalSubmessageObject(); + } + + const TypeObject* GetMinimalSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Submessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_UNION); + + type_object->minimal().union_type().union_flags().IS_FINAL(false); + type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); + type_object->minimal().union_type().union_flags().IS_MUTABLE(false); + type_object->minimal().union_type().union_flags().IS_NESTED(false); + type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported + + type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply + type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply + type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported + type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply + + type_object->minimal().union_type().discriminator().common().type_id(*GetSubmessageKindIdentifier(false)); + + MemberId memberId = 0; + MinimalUnionMember mst_heartbeat_submsg; + mst_heartbeat_submsg.common().member_id(memberId++); + mst_heartbeat_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_heartbeat_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_heartbeat_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_heartbeat_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + mst_heartbeat_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mst_heartbeat_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + mst_heartbeat_submsg.common().member_flags().IS_DEFAULT(false); + mst_heartbeat_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetHeartBeatSubmessageIdentifier(false)); + + mst_heartbeat_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::HEARTBEAT); + + MD5 heartbeat_submsg_hash("heartbeat_submsg"); + for(int i = 0; i < 4; ++i) + { + mst_heartbeat_submsg.detail().name_hash()[i] = heartbeat_submsg_hash.digest[i]; + } + type_object->minimal().union_type().member_seq().emplace_back(mst_heartbeat_submsg); + + MinimalUnionMember mst_info_ts_submsg; + mst_info_ts_submsg.common().member_id(memberId++); + mst_info_ts_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_info_ts_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_info_ts_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_info_ts_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + mst_info_ts_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mst_info_ts_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + mst_info_ts_submsg.common().member_flags().IS_DEFAULT(false); + mst_info_ts_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageIdentifier(false)); + + mst_info_ts_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_TS); + + MD5 info_ts_submsg_hash("info_ts_submsg"); + for(int i = 0; i < 4; ++i) + { + mst_info_ts_submsg.detail().name_hash()[i] = info_ts_submsg_hash.digest[i]; + } + type_object->minimal().union_type().member_seq().emplace_back(mst_info_ts_submsg); + + MinimalUnionMember mst_info_src_submsg; + mst_info_src_submsg.common().member_id(memberId++); + mst_info_src_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_info_src_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_info_src_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_info_src_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + mst_info_src_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mst_info_src_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + mst_info_src_submsg.common().member_flags().IS_DEFAULT(false); + mst_info_src_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoSourceSubmessageIdentifier(false)); + + mst_info_src_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_SRC); + + MD5 info_src_submsg_hash("info_src_submsg"); + for(int i = 0; i < 4; ++i) + { + mst_info_src_submsg.detail().name_hash()[i] = info_src_submsg_hash.digest[i]; + } + type_object->minimal().union_type().member_seq().emplace_back(mst_info_src_submsg); + + MinimalUnionMember mst_info_dst_submsg; + mst_info_dst_submsg.common().member_id(memberId++); + mst_info_dst_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_info_dst_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_info_dst_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_info_dst_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + mst_info_dst_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mst_info_dst_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + mst_info_dst_submsg.common().member_flags().IS_DEFAULT(false); + mst_info_dst_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageIdentifier(false)); + + mst_info_dst_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_DST); + + MD5 info_dst_submsg_hash("info_dst_submsg"); + for(int i = 0; i < 4; ++i) + { + mst_info_dst_submsg.detail().name_hash()[i] = info_dst_submsg_hash.digest[i]; + } + type_object->minimal().union_type().member_seq().emplace_back(mst_info_dst_submsg); + + MinimalUnionMember mst_unknown_submsg; + mst_unknown_submsg.common().member_id(memberId++); + mst_unknown_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_unknown_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_unknown_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_unknown_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + mst_unknown_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + mst_unknown_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + mst_unknown_submsg.common().member_flags().IS_DEFAULT(false); + mst_unknown_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(false)); + + MD5 unknown_submsg_hash("unknown_submsg"); + for(int i = 0; i < 4; ++i) + { + mst_unknown_submsg.detail().name_hash()[i] = unknown_submsg_hash.digest[i]; + } + type_object->minimal().union_type().member_seq().emplace_back(mst_unknown_submsg); + + + // Header + //type_object->minimal().union_type().header().detail()... // Empty + + TypeIdentifier* identifier = new TypeIdentifier(); + identifier->_d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier->equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Submessage", identifier, type_object); + delete type_object; + delete identifier; + return TypeObjectFactory::get_instance()->get_type_object("Submessage", false); + } + + const TypeObject* GetCompleteSubmessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Submessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_UNION); + + type_object->complete().union_type().union_flags().IS_FINAL(false); + type_object->complete().union_type().union_flags().IS_APPENDABLE(false); + type_object->complete().union_type().union_flags().IS_MUTABLE(false); + type_object->complete().union_type().union_flags().IS_NESTED(false); + type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported + + type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply + type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply + type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported + type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply + + type_object->complete().union_type().discriminator().common().type_id(*GetSubmessageKindIdentifier(true)); + + MemberId memberId = 0; + CompleteUnionMember cst_heartbeat_submsg; + cst_heartbeat_submsg.common().member_id(memberId++); + cst_heartbeat_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_heartbeat_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_heartbeat_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_heartbeat_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + cst_heartbeat_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cst_heartbeat_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + cst_heartbeat_submsg.common().member_flags().IS_DEFAULT(false); + cst_heartbeat_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetHeartBeatSubmessageIdentifier(true)); + cst_heartbeat_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::HEARTBEAT); + + + cst_heartbeat_submsg.detail().name("heartbeat_submsg"); + + type_object->complete().union_type().member_seq().emplace_back(cst_heartbeat_submsg); + + CompleteUnionMember cst_info_ts_submsg; + cst_info_ts_submsg.common().member_id(memberId++); + cst_info_ts_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_info_ts_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_info_ts_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_info_ts_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + cst_info_ts_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cst_info_ts_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + cst_info_ts_submsg.common().member_flags().IS_DEFAULT(false); + cst_info_ts_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoTimestampSubmessageIdentifier(true)); + cst_info_ts_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_TS); + + + cst_info_ts_submsg.detail().name("info_ts_submsg"); + + type_object->complete().union_type().member_seq().emplace_back(cst_info_ts_submsg); + + CompleteUnionMember cst_info_src_submsg; + cst_info_src_submsg.common().member_id(memberId++); + cst_info_src_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_info_src_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_info_src_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_info_src_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + cst_info_src_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cst_info_src_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + cst_info_src_submsg.common().member_flags().IS_DEFAULT(false); + cst_info_src_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoSourceSubmessageIdentifier(true)); + cst_info_src_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_SRC); + + + cst_info_src_submsg.detail().name("info_src_submsg"); + + type_object->complete().union_type().member_seq().emplace_back(cst_info_src_submsg); + + CompleteUnionMember cst_info_dst_submsg; + cst_info_dst_submsg.common().member_id(memberId++); + cst_info_dst_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_info_dst_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_info_dst_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_info_dst_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + cst_info_dst_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cst_info_dst_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + cst_info_dst_submsg.common().member_flags().IS_DEFAULT(false); + cst_info_dst_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetInfoDestinationSubmessageIdentifier(true)); + cst_info_dst_submsg.common().label_seq().emplace_back(eprosima::fastdds::rtps::core::INFO_DST); + + + cst_info_dst_submsg.detail().name("info_dst_submsg"); + + type_object->complete().union_type().member_seq().emplace_back(cst_info_dst_submsg); + + CompleteUnionMember cst_unknown_submsg; + cst_unknown_submsg.common().member_id(memberId++); + cst_unknown_submsg.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_unknown_submsg.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_unknown_submsg.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_unknown_submsg.common().member_flags().IS_OPTIONAL(false); // Doesn't apply + cst_unknown_submsg.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply + cst_unknown_submsg.common().member_flags().IS_KEY(false); // Doesn't apply + cst_unknown_submsg.common().member_flags().IS_DEFAULT(false); + cst_unknown_submsg.common().type_id(*eprosima::fastdds::rtps::core::GetSubmessageHeaderIdentifier(true)); + + cst_unknown_submsg.detail().name("unknown_submsg"); + + type_object->complete().union_type().member_seq().emplace_back(cst_unknown_submsg); + + + // Header + type_object->complete().union_type().header().detail().type_name("Submessage"); + + TypeIdentifier* identifier = new TypeIdentifier(); + identifier->_d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier->equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("Submessage", identifier, type_object); + delete type_object; + delete identifier; + return TypeObjectFactory::get_instance()->get_type_object("Submessage", true); + } + + + + + + const TypeIdentifier* GetRTPSMessageIdentifier(bool complete) + { + const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("RTPSMessage", complete); + if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) + { + return c_identifier; + } + + GetRTPSMessageObject(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("RTPSMessage", complete); + } + + const TypeObject* GetRTPSMessageObject(bool complete) + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("RTPSMessage", complete); + if (c_type_object != nullptr) + { + return c_type_object; + } + else if (complete) + { + return GetCompleteRTPSMessageObject(); + } + //else + return GetMinimalRTPSMessageObject(); + } + + const TypeObject* GetMinimalRTPSMessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("RTPSMessage", false); + if (c_type_object != nullptr) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_MINIMAL); + type_object->minimal()._d(TK_STRUCTURE); + + type_object->minimal().struct_type().struct_flags().IS_FINAL(false); + type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); + type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + MinimalStructMember mst_msg_header; + mst_msg_header.common().member_id(memberId++); + mst_msg_header.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_msg_header.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_msg_header.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_msg_header.common().member_flags().IS_OPTIONAL(false); + mst_msg_header.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_msg_header.common().member_flags().IS_KEY(false); + mst_msg_header.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_msg_header.common().member_type_id(*eprosima::fastdds::rtps::core::GetHeaderIdentifier(false)); + + MD5 msg_header_hash("msg_header"); + for(int i = 0; i < 4; ++i) + { + mst_msg_header.detail().name_hash()[i] = msg_header_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_msg_header); + + MinimalStructMember mst_submessages; + mst_submessages.common().member_id(memberId++); + mst_submessages.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + mst_submessages.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + mst_submessages.common().member_flags().IS_EXTERNAL(false); // Unsupported + mst_submessages.common().member_flags().IS_OPTIONAL(false); + mst_submessages.common().member_flags().IS_MUST_UNDERSTAND(false); + mst_submessages.common().member_flags().IS_KEY(false); + mst_submessages.common().member_flags().IS_DEFAULT(false); // Doesn't apply + mst_submessages.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("eprosima::fastdds::rtps::core::Submessage", 100, false)); + + MD5 submessages_hash("submessages"); + for(int i = 0; i < 4; ++i) + { + mst_submessages.detail().name_hash()[i] = submessages_hash.digest[i]; + } + type_object->minimal().struct_type().member_seq().emplace_back(mst_submessages); + + + // Header + // TODO Inheritance + //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); + //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; + TypeIdentifier identifier; + identifier._d(EK_MINIMAL); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("RTPSMessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("RTPSMessage", false); + } + + const TypeObject* GetCompleteRTPSMessageObject() + { + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("RTPSMessage", true); + if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) + { + return c_type_object; + } + + TypeObject *type_object = new TypeObject(); + type_object->_d(EK_COMPLETE); + type_object->complete()._d(TK_STRUCTURE); + + type_object->complete().struct_type().struct_flags().IS_FINAL(false); + type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); + type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); + type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported + + MemberId memberId = 0; + CompleteStructMember cst_msg_header; + cst_msg_header.common().member_id(memberId++); + cst_msg_header.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_msg_header.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_msg_header.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_msg_header.common().member_flags().IS_OPTIONAL(false); + cst_msg_header.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_msg_header.common().member_flags().IS_KEY(false); + cst_msg_header.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_msg_header.common().member_type_id(*eprosima::fastdds::rtps::core::GetHeaderIdentifier(true)); + + cst_msg_header.detail().name("msg_header"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_msg_header); + + CompleteStructMember cst_submessages; + cst_submessages.common().member_id(memberId++); + cst_submessages.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported + cst_submessages.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported + cst_submessages.common().member_flags().IS_EXTERNAL(false); // Unsupported + cst_submessages.common().member_flags().IS_OPTIONAL(false); + cst_submessages.common().member_flags().IS_MUST_UNDERSTAND(false); + cst_submessages.common().member_flags().IS_KEY(false); + cst_submessages.common().member_flags().IS_DEFAULT(false); // Doesn't apply + cst_submessages.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("eprosima::fastdds::rtps::core::Submessage", 100, true)); + + cst_submessages.detail().name("submessages"); + + type_object->complete().struct_type().member_seq().emplace_back(cst_submessages); + + + // Header + type_object->complete().struct_type().header().detail().type_name("RTPSMessage"); + // TODO inheritance + TypeIdentifier identifier; + identifier._d(EK_COMPLETE); + + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + size_t current_alignment {0}; + SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); + eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); + // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) + eprosima::fastcdr::Cdr ser( + fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else + payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 + MD5 objectHash; + objectHash.update((char*)payload.data, payload.length); + objectHash.finalize(); + for(int i = 0; i < 14; ++i) + { + identifier.equivalence_hash()[i] = objectHash.digest[i]; + } + + TypeObjectFactory::get_instance()->add_type_object("RTPSMessage", &identifier, type_object); + delete type_object; + return TypeObjectFactory::get_instance()->get_type_object("RTPSMessage", true); + } + + } // namespace core + } // namespace rtps + } // namespace fastdds +} // namespace eprosima \ No newline at end of file diff --git a/test/blackbox/types/core/core_typesTypeObject.h b/test/blackbox/types/core/core_typesTypeObject.h new file mode 100644 index 00000000000..89611ededc0 --- /dev/null +++ b/test/blackbox/types/core/core_typesTypeObject.h @@ -0,0 +1,192 @@ +// 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 core_typesTypeObject.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_H_ + + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif +#else +#define eProsima_user_DllExport +#endif + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(core_types_SOURCE) +#define core_types_DllAPI __declspec( dllexport ) +#else +#define core_types_DllAPI __declspec( dllimport ) +#endif // core_types_SOURCE +#else +#define core_types_DllAPI +#endif +#else +#define core_types_DllAPI +#endif // _WIN32 + +using namespace eprosima::fastdds::types; + +eProsima_user_DllExport void registercore_typesTypes(); + +namespace eprosima { + namespace fastdds { + namespace rtps { + namespace core { + namespace detail { + + + eProsima_user_DllExport const TypeIdentifier* GetEntityId_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetEntityId_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalEntityId_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteEntityId_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetProtocolVersion_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetProtocolVersion_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalProtocolVersion_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteProtocolVersion_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetVendorId_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetVendorId_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalVendorId_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteVendorId_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetGuidPrefix_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetGuidPrefix_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalGuidPrefix_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteGuidPrefix_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetGUID_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetGUID_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalGUID_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteGUID_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceNumber_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetSequenceNumber_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalSequenceNumber_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteSequenceNumber_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetCount_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetCount_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalCount_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteCount_tObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetTime_tIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetTime_tObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalTime_tObject(); + eProsima_user_DllExport const TypeObject* GetCompleteTime_tObject(); + + eProsima_user_DllExport const TypeIdentifier* GetTimestampIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetTimestampObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalTimestampObject(); + eProsima_user_DllExport const TypeObject* GetCompleteTimestampObject(); + + } // namespace detail + + + eProsima_user_DllExport const TypeIdentifier* GetHeaderIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetHeaderObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalHeaderObject(); + eProsima_user_DllExport const TypeObject* GetCompleteHeaderObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSubmessageHeaderIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetSubmessageHeaderObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalSubmessageHeaderObject(); + eProsima_user_DllExport const TypeObject* GetCompleteSubmessageHeaderObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSubmessageKindIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetSubmessageKindObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalSubmessageKindObject(); + eProsima_user_DllExport const TypeObject* GetCompleteSubmessageKindObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetHeartBeatSubmessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetHeartBeatSubmessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalHeartBeatSubmessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteHeartBeatSubmessageObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetInfoDestinationSubmessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetInfoDestinationSubmessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalInfoDestinationSubmessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteInfoDestinationSubmessageObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetInfoSourceSubmessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetInfoSourceSubmessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalInfoSourceSubmessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteInfoSourceSubmessageObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetInfoTimestampSubmessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetInfoTimestampSubmessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalInfoTimestampSubmessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteInfoTimestampSubmessageObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSubmessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetSubmessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalSubmessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteSubmessageObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetRTPSMessageIdentifier(bool complete = false); + eProsima_user_DllExport const TypeObject* GetRTPSMessageObject(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimalRTPSMessageObject(); + eProsima_user_DllExport const TypeObject* GetCompleteRTPSMessageObject(); + + } // namespace core + } // namespace rtps + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/blackbox/types/core/core_typesTypeObjectSupport.cxx b/test/blackbox/types/core/core_typesTypeObjectSupport.cxx new file mode 100644 index 00000000000..33007e15d57 --- /dev/null +++ b/test/blackbox/types/core/core_typesTypeObjectSupport.cxx @@ -0,0 +1,2870 @@ +// 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 core_typesTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "core_typesTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core_types.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +namespace eprosima { +namespace fastdds { +namespace rtps { +namespace core { +namespace detail { +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_EntityId_t_type_identifier( + TypeIdentifierPair& type_ids_EntityId_t) +{ + + ReturnCode_t return_code_EntityId_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_EntityId_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_EntityId_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_EntityId_t) + { + StructTypeFlag struct_flags_EntityId_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_EntityId_t = "eprosima::fastdds::rtps::core::detail::EntityId_t"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_t; + eprosima::fastcdr::optional ann_custom_EntityId_t; + CompleteTypeDetail detail_EntityId_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_t, ann_custom_EntityId_t, type_name_EntityId_t.to_string()); + CompleteStructHeader header_EntityId_t; + header_EntityId_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_t); + CompleteStructMemberSeq member_seq_EntityId_t; + { + TypeIdentifierPair type_ids_value; + ReturnCode_t return_code_value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_4_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, element_identifier_anonymous_array_uint8_t_4_ec))}; + if (!element_identifier_anonymous_array_uint8_t_4_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_value.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4", type_ids_value)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_value = 0x00000000; + bool common_value_ec {false}; + CommonStructMember common_value {TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, common_value_ec))}; + if (!common_value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_t.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_t); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_t, member_value); + } + CompleteStructType struct_type_EntityId_t = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_t, header_EntityId_t, member_seq_EntityId_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_t, type_name_EntityId_t.to_string(), type_ids_EntityId_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::EntityId_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_ProtocolVersion_t_type_identifier( + TypeIdentifierPair& type_ids_ProtocolVersion_t) +{ + + ReturnCode_t return_code_ProtocolVersion_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_ProtocolVersion_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::ProtocolVersion_t", type_ids_ProtocolVersion_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_ProtocolVersion_t) + { + StructTypeFlag struct_flags_ProtocolVersion_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_ProtocolVersion_t = "eprosima::fastdds::rtps::core::detail::ProtocolVersion_t"; + eprosima::fastcdr::optional type_ann_builtin_ProtocolVersion_t; + eprosima::fastcdr::optional ann_custom_ProtocolVersion_t; + CompleteTypeDetail detail_ProtocolVersion_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ProtocolVersion_t, ann_custom_ProtocolVersion_t, type_name_ProtocolVersion_t.to_string()); + CompleteStructHeader header_ProtocolVersion_t; + header_ProtocolVersion_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ProtocolVersion_t); + CompleteStructMemberSeq member_seq_ProtocolVersion_t; + { + TypeIdentifierPair type_ids_major; + ReturnCode_t return_code_major {eprosima::fastdds::dds::RETCODE_OK}; + return_code_major = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_major); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_major) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "major Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_major = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_major = 0x00000000; + bool common_major_ec {false}; + CommonStructMember common_major {TypeObjectUtils::build_common_struct_member(member_id_major, member_flags_major, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_major, common_major_ec))}; + if (!common_major_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure major member TypeIdentifier inconsistent."); + return; + } + MemberName name_major = "major"; + eprosima::fastcdr::optional member_ann_builtin_major; + ann_custom_ProtocolVersion_t.reset(); + CompleteMemberDetail detail_major = TypeObjectUtils::build_complete_member_detail(name_major, member_ann_builtin_major, ann_custom_ProtocolVersion_t); + CompleteStructMember member_major = TypeObjectUtils::build_complete_struct_member(common_major, detail_major); + TypeObjectUtils::add_complete_struct_member(member_seq_ProtocolVersion_t, member_major); + } + { + TypeIdentifierPair type_ids_minor; + ReturnCode_t return_code_minor {eprosima::fastdds::dds::RETCODE_OK}; + return_code_minor = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_minor); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_minor) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "minor Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_minor = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_minor = 0x00000001; + bool common_minor_ec {false}; + CommonStructMember common_minor {TypeObjectUtils::build_common_struct_member(member_id_minor, member_flags_minor, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_minor, common_minor_ec))}; + if (!common_minor_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure minor member TypeIdentifier inconsistent."); + return; + } + MemberName name_minor = "minor"; + eprosima::fastcdr::optional member_ann_builtin_minor; + ann_custom_ProtocolVersion_t.reset(); + CompleteMemberDetail detail_minor = TypeObjectUtils::build_complete_member_detail(name_minor, member_ann_builtin_minor, ann_custom_ProtocolVersion_t); + CompleteStructMember member_minor = TypeObjectUtils::build_complete_struct_member(common_minor, detail_minor); + TypeObjectUtils::add_complete_struct_member(member_seq_ProtocolVersion_t, member_minor); + } + CompleteStructType struct_type_ProtocolVersion_t = TypeObjectUtils::build_complete_struct_type(struct_flags_ProtocolVersion_t, header_ProtocolVersion_t, member_seq_ProtocolVersion_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ProtocolVersion_t, type_name_ProtocolVersion_t.to_string(), type_ids_ProtocolVersion_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::ProtocolVersion_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_VendorId_t_type_identifier( + TypeIdentifierPair& type_ids_VendorId_t) +{ + + ReturnCode_t return_code_VendorId_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_VendorId_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::VendorId_t", type_ids_VendorId_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_VendorId_t) + { + StructTypeFlag struct_flags_VendorId_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_VendorId_t = "eprosima::fastdds::rtps::core::detail::VendorId_t"; + eprosima::fastcdr::optional type_ann_builtin_VendorId_t; + eprosima::fastcdr::optional ann_custom_VendorId_t; + CompleteTypeDetail detail_VendorId_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_VendorId_t, ann_custom_VendorId_t, type_name_VendorId_t.to_string()); + CompleteStructHeader header_VendorId_t; + header_VendorId_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_VendorId_t); + CompleteStructMemberSeq member_seq_VendorId_t; + { + TypeIdentifierPair type_ids_vendorId; + ReturnCode_t return_code_vendorId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_vendorId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_2", type_ids_vendorId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_vendorId) + { + return_code_vendorId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_vendorId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_vendorId) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_2_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_2 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_vendorId, element_identifier_anonymous_array_uint8_t_2_ec))}; + if (!element_identifier_anonymous_array_uint8_t_2_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_2 = EK_COMPLETE; + if (TK_NONE == type_ids_vendorId.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_2 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_2 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_2, element_flags_anonymous_array_uint8_t_2); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_2, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_2)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_2", type_ids_vendorId)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_2 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_vendorId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_vendorId = 0x00000000; + bool common_vendorId_ec {false}; + CommonStructMember common_vendorId {TypeObjectUtils::build_common_struct_member(member_id_vendorId, member_flags_vendorId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_vendorId, common_vendorId_ec))}; + if (!common_vendorId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure vendorId member TypeIdentifier inconsistent."); + return; + } + MemberName name_vendorId = "vendorId"; + eprosima::fastcdr::optional member_ann_builtin_vendorId; + ann_custom_VendorId_t.reset(); + CompleteMemberDetail detail_vendorId = TypeObjectUtils::build_complete_member_detail(name_vendorId, member_ann_builtin_vendorId, ann_custom_VendorId_t); + CompleteStructMember member_vendorId = TypeObjectUtils::build_complete_struct_member(common_vendorId, detail_vendorId); + TypeObjectUtils::add_complete_struct_member(member_seq_VendorId_t, member_vendorId); + } + CompleteStructType struct_type_VendorId_t = TypeObjectUtils::build_complete_struct_type(struct_flags_VendorId_t, header_VendorId_t, member_seq_VendorId_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_VendorId_t, type_name_VendorId_t.to_string(), type_ids_VendorId_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::VendorId_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_GuidPrefix_t_type_identifier( + TypeIdentifierPair& type_ids_GuidPrefix_t) +{ + + ReturnCode_t return_code_GuidPrefix_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GuidPrefix_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t", type_ids_GuidPrefix_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GuidPrefix_t) + { + StructTypeFlag struct_flags_GuidPrefix_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_GuidPrefix_t = "eprosima::fastdds::rtps::core::detail::GuidPrefix_t"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_t; + eprosima::fastcdr::optional ann_custom_GuidPrefix_t; + CompleteTypeDetail detail_GuidPrefix_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_t, ann_custom_GuidPrefix_t, type_name_GuidPrefix_t.to_string()); + CompleteStructHeader header_GuidPrefix_t; + header_GuidPrefix_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_t); + CompleteStructMemberSeq member_seq_GuidPrefix_t; + { + TypeIdentifierPair type_ids_value; + ReturnCode_t return_code_value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_12_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, element_identifier_anonymous_array_uint8_t_12_ec))}; + if (!element_identifier_anonymous_array_uint8_t_12_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_value.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12", type_ids_value)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_value = 0x00000000; + bool common_value_ec {false}; + CommonStructMember common_value {TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, common_value_ec))}; + if (!common_value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_t.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_t); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_t, member_value); + } + CompleteStructType struct_type_GuidPrefix_t = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_t, header_GuidPrefix_t, member_seq_GuidPrefix_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_t, type_name_GuidPrefix_t.to_string(), type_ids_GuidPrefix_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_GUID_t_type_identifier( + TypeIdentifierPair& type_ids_GUID_t) +{ + + ReturnCode_t return_code_GUID_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GUID_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GUID_t", type_ids_GUID_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GUID_t) + { + StructTypeFlag struct_flags_GUID_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_GUID_t = "eprosima::fastdds::rtps::core::detail::GUID_t"; + eprosima::fastcdr::optional type_ann_builtin_GUID_t; + eprosima::fastcdr::optional ann_custom_GUID_t; + CompleteTypeDetail detail_GUID_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_t, ann_custom_GUID_t, type_name_GUID_t.to_string()); + CompleteStructHeader header_GUID_t; + header_GUID_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_t); + CompleteStructMemberSeq member_seq_GUID_t; + { + TypeIdentifierPair type_ids_guidPrefix; + ReturnCode_t return_code_guidPrefix {eprosima::fastdds::dds::RETCODE_OK}; + return_code_guidPrefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t", type_ids_guidPrefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_guidPrefix) + { + eprosima::fastdds::rtps::core::detail::register_GuidPrefix_t_type_identifier(type_ids_guidPrefix); + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_guidPrefix = 0x00000000; + bool common_guidPrefix_ec {false}; + CommonStructMember common_guidPrefix {TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_guidPrefix, common_guidPrefix_ec))}; + if (!common_guidPrefix_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_t.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_t); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_t, member_guidPrefix); + } + { + TypeIdentifierPair type_ids_entityId; + ReturnCode_t return_code_entityId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_entityId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_entityId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_entityId) + { + eprosima::fastdds::rtps::core::detail::register_EntityId_t_type_identifier(type_ids_entityId); + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_entityId = 0x00000001; + bool common_entityId_ec {false}; + CommonStructMember common_entityId {TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_entityId, common_entityId_ec))}; + if (!common_entityId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_t.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_t); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_t, member_entityId); + } + CompleteStructType struct_type_GUID_t = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_t, header_GUID_t, member_seq_GUID_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_t, type_name_GUID_t.to_string(), type_ids_GUID_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::GUID_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_SequenceNumber_t_type_identifier( + TypeIdentifierPair& type_ids_SequenceNumber_t) +{ + + ReturnCode_t return_code_SequenceNumber_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_SequenceNumber_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumber_t", type_ids_SequenceNumber_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_SequenceNumber_t) + { + StructTypeFlag struct_flags_SequenceNumber_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_SequenceNumber_t = "eprosima::fastdds::rtps::core::detail::SequenceNumber_t"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_t; + eprosima::fastcdr::optional ann_custom_SequenceNumber_t; + CompleteTypeDetail detail_SequenceNumber_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_t, ann_custom_SequenceNumber_t, type_name_SequenceNumber_t.to_string()); + CompleteStructHeader header_SequenceNumber_t; + header_SequenceNumber_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_t); + CompleteStructMemberSeq member_seq_SequenceNumber_t; + { + TypeIdentifierPair type_ids_high; + ReturnCode_t return_code_high {eprosima::fastdds::dds::RETCODE_OK}; + return_code_high = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_high); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_high) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_high = 0x00000000; + bool common_high_ec {false}; + CommonStructMember common_high {TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_high, common_high_ec))}; + if (!common_high_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_t.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_t); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_t, member_high); + } + { + TypeIdentifierPair type_ids_low; + ReturnCode_t return_code_low {eprosima::fastdds::dds::RETCODE_OK}; + return_code_low = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_low); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_low) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_low = 0x00000001; + bool common_low_ec {false}; + CommonStructMember common_low {TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_low, common_low_ec))}; + if (!common_low_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_t.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_t); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_t, member_low); + } + CompleteStructType struct_type_SequenceNumber_t = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_t, header_SequenceNumber_t, member_seq_SequenceNumber_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_t, type_name_SequenceNumber_t.to_string(), type_ids_SequenceNumber_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::SequenceNumber_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Count_t_type_identifier( + TypeIdentifierPair& type_ids_Count_t) +{ + + ReturnCode_t return_code_Count_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Count_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Count_t", type_ids_Count_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Count_t) + { + StructTypeFlag struct_flags_Count_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Count_t = "eprosima::fastdds::rtps::core::detail::Count_t"; + eprosima::fastcdr::optional type_ann_builtin_Count_t; + eprosima::fastcdr::optional ann_custom_Count_t; + CompleteTypeDetail detail_Count_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Count_t, ann_custom_Count_t, type_name_Count_t.to_string()); + CompleteStructHeader header_Count_t; + header_Count_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Count_t); + CompleteStructMemberSeq member_seq_Count_t; + { + TypeIdentifierPair type_ids_value; + ReturnCode_t return_code_value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_value = 0x00000000; + bool common_value_ec {false}; + CommonStructMember common_value {TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, common_value_ec))}; + if (!common_value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_Count_t.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_Count_t); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_Count_t, member_value); + } + CompleteStructType struct_type_Count_t = TypeObjectUtils::build_complete_struct_type(struct_flags_Count_t, header_Count_t, member_seq_Count_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Count_t, type_name_Count_t.to_string(), type_ids_Count_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::Count_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Time_t_type_identifier( + TypeIdentifierPair& type_ids_Time_t) +{ + + ReturnCode_t return_code_Time_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Time_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Time_t", type_ids_Time_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Time_t) + { + StructTypeFlag struct_flags_Time_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Time_t = "eprosima::fastdds::rtps::core::detail::Time_t"; + eprosima::fastcdr::optional type_ann_builtin_Time_t; + eprosima::fastcdr::optional ann_custom_Time_t; + CompleteTypeDetail detail_Time_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Time_t, ann_custom_Time_t, type_name_Time_t.to_string()); + CompleteStructHeader header_Time_t; + header_Time_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Time_t); + CompleteStructMemberSeq member_seq_Time_t; + { + TypeIdentifierPair type_ids_seconds; + ReturnCode_t return_code_seconds {eprosima::fastdds::dds::RETCODE_OK}; + return_code_seconds = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_seconds); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_seconds) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "seconds Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_seconds = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_seconds = 0x00000000; + bool common_seconds_ec {false}; + CommonStructMember common_seconds {TypeObjectUtils::build_common_struct_member(member_id_seconds, member_flags_seconds, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_seconds, common_seconds_ec))}; + if (!common_seconds_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure seconds member TypeIdentifier inconsistent."); + return; + } + MemberName name_seconds = "seconds"; + eprosima::fastcdr::optional member_ann_builtin_seconds; + ann_custom_Time_t.reset(); + CompleteMemberDetail detail_seconds = TypeObjectUtils::build_complete_member_detail(name_seconds, member_ann_builtin_seconds, ann_custom_Time_t); + CompleteStructMember member_seconds = TypeObjectUtils::build_complete_struct_member(common_seconds, detail_seconds); + TypeObjectUtils::add_complete_struct_member(member_seq_Time_t, member_seconds); + } + { + TypeIdentifierPair type_ids_fraction; + ReturnCode_t return_code_fraction {eprosima::fastdds::dds::RETCODE_OK}; + return_code_fraction = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_fraction); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_fraction) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "fraction Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_fraction = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_fraction = 0x00000001; + bool common_fraction_ec {false}; + CommonStructMember common_fraction {TypeObjectUtils::build_common_struct_member(member_id_fraction, member_flags_fraction, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_fraction, common_fraction_ec))}; + if (!common_fraction_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure fraction member TypeIdentifier inconsistent."); + return; + } + MemberName name_fraction = "fraction"; + eprosima::fastcdr::optional member_ann_builtin_fraction; + ann_custom_Time_t.reset(); + CompleteMemberDetail detail_fraction = TypeObjectUtils::build_complete_member_detail(name_fraction, member_ann_builtin_fraction, ann_custom_Time_t); + CompleteStructMember member_fraction = TypeObjectUtils::build_complete_struct_member(common_fraction, detail_fraction); + TypeObjectUtils::add_complete_struct_member(member_seq_Time_t, member_fraction); + } + CompleteStructType struct_type_Time_t = TypeObjectUtils::build_complete_struct_type(struct_flags_Time_t, header_Time_t, member_seq_Time_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Time_t, type_name_Time_t.to_string(), type_ids_Time_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::Time_t already registered in TypeObjectRegistry for a different type."); + } + } +} +void register_Timestamp_type_identifier( + TypeIdentifierPair& type_ids_Timestamp) +{ + ReturnCode_t return_code_Timestamp {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Timestamp = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Timestamp", type_ids_Timestamp); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Timestamp) + { + AliasTypeFlag alias_flags_Timestamp = 0; + QualifiedTypeName type_name_Timestamp = "eprosima::fastdds::rtps::core::detail::Timestamp"; + eprosima::fastcdr::optional type_ann_builtin_Timestamp; + eprosima::fastcdr::optional ann_custom_Timestamp; + CompleteTypeDetail detail_Timestamp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Timestamp, ann_custom_Timestamp, type_name_Timestamp.to_string()); + CompleteAliasHeader header_Timestamp = TypeObjectUtils::build_complete_alias_header(detail_Timestamp); + AliasMemberFlag related_flags_Timestamp = 0; + return_code_Timestamp = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Time_t", type_ids_Timestamp); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Timestamp) + { + eprosima::fastdds::rtps::core::detail::register_Time_t_type_identifier(type_ids_Timestamp); + } + bool common_Timestamp_ec {false}; + CommonAliasBody common_Timestamp {TypeObjectUtils::build_common_alias_body(related_flags_Timestamp, + TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Timestamp, common_Timestamp_ec))}; + if (!common_Timestamp_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "eprosima::fastdds::rtps::core::detail::Timestamp related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_Timestamp; + ann_custom_Timestamp.reset(); + CompleteAliasBody body_Timestamp = TypeObjectUtils::build_complete_alias_body(common_Timestamp, + member_ann_builtin_Timestamp, ann_custom_Timestamp); + CompleteAliasType alias_type_Timestamp = TypeObjectUtils::build_complete_alias_type(alias_flags_Timestamp, + header_Timestamp, body_Timestamp); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_Timestamp, + type_name_Timestamp.to_string(), type_ids_Timestamp)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::Timestamp already registered in TypeObjectRegistry for a different type."); + } + } +} + +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_SequenceNumberSet_type_identifier( + TypeIdentifierPair& type_ids_SequenceNumberSet) +{ + + ReturnCode_t return_code_SequenceNumberSet {eprosima::fastdds::dds::RETCODE_OK}; + return_code_SequenceNumberSet = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumberSet", type_ids_SequenceNumberSet); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_SequenceNumberSet) + { + StructTypeFlag struct_flags_SequenceNumberSet = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_SequenceNumberSet = "eprosima::fastdds::rtps::core::detail::SequenceNumberSet"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumberSet; + eprosima::fastcdr::optional ann_custom_SequenceNumberSet; + CompleteTypeDetail detail_SequenceNumberSet = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumberSet, ann_custom_SequenceNumberSet, type_name_SequenceNumberSet.to_string()); + CompleteStructHeader header_SequenceNumberSet; + header_SequenceNumberSet = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumberSet); + CompleteStructMemberSeq member_seq_SequenceNumberSet; + { + TypeIdentifierPair type_ids_bitmapBase; + ReturnCode_t return_code_bitmapBase {eprosima::fastdds::dds::RETCODE_OK}; + return_code_bitmapBase = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumber_t", type_ids_bitmapBase); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_bitmapBase) + { + eprosima::fastdds::rtps::core::detail::register_SequenceNumber_t_type_identifier(type_ids_bitmapBase); + } + StructMemberFlag member_flags_bitmapBase = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_bitmapBase = 0x00000000; + bool common_bitmapBase_ec {false}; + CommonStructMember common_bitmapBase {TypeObjectUtils::build_common_struct_member(member_id_bitmapBase, member_flags_bitmapBase, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_bitmapBase, common_bitmapBase_ec))}; + if (!common_bitmapBase_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure bitmapBase member TypeIdentifier inconsistent."); + return; + } + MemberName name_bitmapBase = "bitmapBase"; + eprosima::fastcdr::optional member_ann_builtin_bitmapBase; + ann_custom_SequenceNumberSet.reset(); + CompleteMemberDetail detail_bitmapBase = TypeObjectUtils::build_complete_member_detail(name_bitmapBase, member_ann_builtin_bitmapBase, ann_custom_SequenceNumberSet); + CompleteStructMember member_bitmapBase = TypeObjectUtils::build_complete_struct_member(common_bitmapBase, detail_bitmapBase); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumberSet, member_bitmapBase); + } + { + TypeIdentifierPair type_ids_numBits; + ReturnCode_t return_code_numBits {eprosima::fastdds::dds::RETCODE_OK}; + return_code_numBits = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_numBits); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_numBits) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "numBits Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_numBits = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_numBits = 0x00000001; + bool common_numBits_ec {false}; + CommonStructMember common_numBits {TypeObjectUtils::build_common_struct_member(member_id_numBits, member_flags_numBits, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_numBits, common_numBits_ec))}; + if (!common_numBits_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure numBits member TypeIdentifier inconsistent."); + return; + } + MemberName name_numBits = "numBits"; + eprosima::fastcdr::optional member_ann_builtin_numBits; + ann_custom_SequenceNumberSet.reset(); + CompleteMemberDetail detail_numBits = TypeObjectUtils::build_complete_member_detail(name_numBits, member_ann_builtin_numBits, ann_custom_SequenceNumberSet); + CompleteStructMember member_numBits = TypeObjectUtils::build_complete_struct_member(common_numBits, detail_numBits); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumberSet, member_numBits); + } + { + TypeIdentifierPair type_ids_bitmap; + ReturnCode_t return_code_bitmap {eprosima::fastdds::dds::RETCODE_OK}; + return_code_bitmap = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_8", type_ids_bitmap); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_bitmap) + { + return_code_bitmap = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_bitmap); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_bitmap) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_8_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_8 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_bitmap, element_identifier_anonymous_array_uint8_t_8_ec))}; + if (!element_identifier_anonymous_array_uint8_t_8_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_8 = EK_COMPLETE; + if (TK_NONE == type_ids_bitmap.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_8 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_8 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_8 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_8, element_flags_anonymous_array_uint8_t_8); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(8)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_8, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_8)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_8", type_ids_bitmap)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_8 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_bitmap = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_bitmap = 0x00000002; + bool common_bitmap_ec {false}; + CommonStructMember common_bitmap {TypeObjectUtils::build_common_struct_member(member_id_bitmap, member_flags_bitmap, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_bitmap, common_bitmap_ec))}; + if (!common_bitmap_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure bitmap member TypeIdentifier inconsistent."); + return; + } + MemberName name_bitmap = "bitmap"; + eprosima::fastcdr::optional member_ann_builtin_bitmap; + ann_custom_SequenceNumberSet.reset(); + CompleteMemberDetail detail_bitmap = TypeObjectUtils::build_complete_member_detail(name_bitmap, member_ann_builtin_bitmap, ann_custom_SequenceNumberSet); + CompleteStructMember member_bitmap = TypeObjectUtils::build_complete_struct_member(common_bitmap, detail_bitmap); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumberSet, member_bitmap); + } + CompleteStructType struct_type_SequenceNumberSet = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumberSet, header_SequenceNumberSet, member_seq_SequenceNumberSet); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumberSet, type_name_SequenceNumberSet.to_string(), type_ids_SequenceNumberSet)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::SequenceNumberSet already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Locator_t_type_identifier( + TypeIdentifierPair& type_ids_Locator_t) +{ + + ReturnCode_t return_code_Locator_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Locator_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Locator_t", type_ids_Locator_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Locator_t) + { + StructTypeFlag struct_flags_Locator_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Locator_t = "eprosima::fastdds::rtps::core::detail::Locator_t"; + eprosima::fastcdr::optional type_ann_builtin_Locator_t; + eprosima::fastcdr::optional ann_custom_Locator_t; + CompleteTypeDetail detail_Locator_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_t, ann_custom_Locator_t, type_name_Locator_t.to_string()); + CompleteStructHeader header_Locator_t; + header_Locator_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_t); + CompleteStructMemberSeq member_seq_Locator_t; + { + TypeIdentifierPair type_ids_kind; + ReturnCode_t return_code_kind {eprosima::fastdds::dds::RETCODE_OK}; + return_code_kind = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_kind); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_kind) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_kind = 0x00000000; + bool common_kind_ec {false}; + CommonStructMember common_kind {TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_kind, common_kind_ec))}; + if (!common_kind_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_t.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_t); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_t, member_kind); + } + { + TypeIdentifierPair type_ids_port; + ReturnCode_t return_code_port {eprosima::fastdds::dds::RETCODE_OK}; + return_code_port = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_port); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_port) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_port = 0x00000001; + bool common_port_ec {false}; + CommonStructMember common_port {TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_port, common_port_ec))}; + if (!common_port_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_t.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_t); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_t, member_port); + } + { + TypeIdentifierPair type_ids_address; + ReturnCode_t return_code_address {eprosima::fastdds::dds::RETCODE_OK}; + return_code_address = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_address); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_address) + { + return_code_address = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_address); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_address) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_16_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_address, element_identifier_anonymous_array_uint8_t_16_ec))}; + if (!element_identifier_anonymous_array_uint8_t_16_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_address.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16", type_ids_address)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_address = 0x00000002; + bool common_address_ec {false}; + CommonStructMember common_address {TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_address, common_address_ec))}; + if (!common_address_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_t.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_t); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_t, member_address); + } + CompleteStructType struct_type_Locator_t = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_t, header_Locator_t, member_seq_Locator_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_t, type_name_Locator_t.to_string(), type_ids_Locator_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::Locator_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Duration_t_type_identifier( + TypeIdentifierPair& type_ids_Duration_t) +{ + + ReturnCode_t return_code_Duration_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Duration_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Duration_t", type_ids_Duration_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Duration_t) + { + StructTypeFlag struct_flags_Duration_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Duration_t = "eprosima::fastdds::rtps::core::detail::Duration_t"; + eprosima::fastcdr::optional type_ann_builtin_Duration_t; + eprosima::fastcdr::optional ann_custom_Duration_t; + CompleteTypeDetail detail_Duration_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Duration_t, ann_custom_Duration_t, type_name_Duration_t.to_string()); + CompleteStructHeader header_Duration_t; + header_Duration_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Duration_t); + CompleteStructMemberSeq member_seq_Duration_t; + { + TypeIdentifierPair type_ids_seconds; + ReturnCode_t return_code_seconds {eprosima::fastdds::dds::RETCODE_OK}; + return_code_seconds = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_seconds); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_seconds) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "seconds Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_seconds = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_seconds = 0x00000000; + bool common_seconds_ec {false}; + CommonStructMember common_seconds {TypeObjectUtils::build_common_struct_member(member_id_seconds, member_flags_seconds, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_seconds, common_seconds_ec))}; + if (!common_seconds_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure seconds member TypeIdentifier inconsistent."); + return; + } + MemberName name_seconds = "seconds"; + eprosima::fastcdr::optional member_ann_builtin_seconds; + ann_custom_Duration_t.reset(); + CompleteMemberDetail detail_seconds = TypeObjectUtils::build_complete_member_detail(name_seconds, member_ann_builtin_seconds, ann_custom_Duration_t); + CompleteStructMember member_seconds = TypeObjectUtils::build_complete_struct_member(common_seconds, detail_seconds); + TypeObjectUtils::add_complete_struct_member(member_seq_Duration_t, member_seconds); + } + { + TypeIdentifierPair type_ids_fraction; + ReturnCode_t return_code_fraction {eprosima::fastdds::dds::RETCODE_OK}; + return_code_fraction = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_fraction); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_fraction) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "fraction Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_fraction = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_fraction = 0x00000001; + bool common_fraction_ec {false}; + CommonStructMember common_fraction {TypeObjectUtils::build_common_struct_member(member_id_fraction, member_flags_fraction, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_fraction, common_fraction_ec))}; + if (!common_fraction_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure fraction member TypeIdentifier inconsistent."); + return; + } + MemberName name_fraction = "fraction"; + eprosima::fastcdr::optional member_ann_builtin_fraction; + ann_custom_Duration_t.reset(); + CompleteMemberDetail detail_fraction = TypeObjectUtils::build_complete_member_detail(name_fraction, member_ann_builtin_fraction, ann_custom_Duration_t); + CompleteStructMember member_fraction = TypeObjectUtils::build_complete_struct_member(common_fraction, detail_fraction); + TypeObjectUtils::add_complete_struct_member(member_seq_Duration_t, member_fraction); + } + CompleteStructType struct_type_Duration_t = TypeObjectUtils::build_complete_struct_type(struct_flags_Duration_t, header_Duration_t, member_seq_Duration_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Duration_t, type_name_Duration_t.to_string(), type_ids_Duration_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::Duration_t already registered in TypeObjectRegistry for a different type."); + } + } +} +void register_DomainId_t_type_identifier( + TypeIdentifierPair& type_ids_DomainId_t) +{ + ReturnCode_t return_code_DomainId_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_DomainId_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::DomainId_t", type_ids_DomainId_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_DomainId_t) + { + AliasTypeFlag alias_flags_DomainId_t = 0; + QualifiedTypeName type_name_DomainId_t = "eprosima::fastdds::rtps::core::detail::DomainId_t"; + eprosima::fastcdr::optional type_ann_builtin_DomainId_t; + eprosima::fastcdr::optional ann_custom_DomainId_t; + CompleteTypeDetail detail_DomainId_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DomainId_t, ann_custom_DomainId_t, type_name_DomainId_t.to_string()); + CompleteAliasHeader header_DomainId_t = TypeObjectUtils::build_complete_alias_header(detail_DomainId_t); + AliasMemberFlag related_flags_DomainId_t = 0; + return_code_DomainId_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DomainId_t); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_DomainId_t) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::DomainId_t related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool common_DomainId_t_ec {false}; + CommonAliasBody common_DomainId_t {TypeObjectUtils::build_common_alias_body(related_flags_DomainId_t, + TypeObjectUtils::retrieve_complete_type_identifier(type_ids_DomainId_t, common_DomainId_t_ec))}; + if (!common_DomainId_t_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "eprosima::fastdds::rtps::core::detail::DomainId_t related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_DomainId_t; + ann_custom_DomainId_t.reset(); + CompleteAliasBody body_DomainId_t = TypeObjectUtils::build_complete_alias_body(common_DomainId_t, + member_ann_builtin_DomainId_t, ann_custom_DomainId_t); + CompleteAliasType alias_type_DomainId_t = TypeObjectUtils::build_complete_alias_type(alias_flags_DomainId_t, + header_DomainId_t, body_DomainId_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_DomainId_t, + type_name_DomainId_t.to_string(), type_ids_DomainId_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::DomainId_t already registered in TypeObjectRegistry for a different type."); + } + } +} + +void register_BuiltinEndpointQos_t_type_identifier( + TypeIdentifierPair& type_ids_BuiltinEndpointQos_t) +{ + ReturnCode_t return_code_BuiltinEndpointQos_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BuiltinEndpointQos_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::BuiltinEndpointQos_t", type_ids_BuiltinEndpointQos_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BuiltinEndpointQos_t) + { + AliasTypeFlag alias_flags_BuiltinEndpointQos_t = 0; + QualifiedTypeName type_name_BuiltinEndpointQos_t = "eprosima::fastdds::rtps::core::detail::BuiltinEndpointQos_t"; + eprosima::fastcdr::optional type_ann_builtin_BuiltinEndpointQos_t; + eprosima::fastcdr::optional ann_custom_BuiltinEndpointQos_t; + CompleteTypeDetail detail_BuiltinEndpointQos_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BuiltinEndpointQos_t, ann_custom_BuiltinEndpointQos_t, type_name_BuiltinEndpointQos_t.to_string()); + CompleteAliasHeader header_BuiltinEndpointQos_t = TypeObjectUtils::build_complete_alias_header(detail_BuiltinEndpointQos_t); + AliasMemberFlag related_flags_BuiltinEndpointQos_t = 0; + return_code_BuiltinEndpointQos_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BuiltinEndpointQos_t); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BuiltinEndpointQos_t) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::BuiltinEndpointQos_t related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool common_BuiltinEndpointQos_t_ec {false}; + CommonAliasBody common_BuiltinEndpointQos_t {TypeObjectUtils::build_common_alias_body(related_flags_BuiltinEndpointQos_t, + TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BuiltinEndpointQos_t, common_BuiltinEndpointQos_t_ec))}; + if (!common_BuiltinEndpointQos_t_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "eprosima::fastdds::rtps::core::detail::BuiltinEndpointQos_t related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_BuiltinEndpointQos_t; + ann_custom_BuiltinEndpointQos_t.reset(); + CompleteAliasBody body_BuiltinEndpointQos_t = TypeObjectUtils::build_complete_alias_body(common_BuiltinEndpointQos_t, + member_ann_builtin_BuiltinEndpointQos_t, ann_custom_BuiltinEndpointQos_t); + CompleteAliasType alias_type_BuiltinEndpointQos_t = TypeObjectUtils::build_complete_alias_type(alias_flags_BuiltinEndpointQos_t, + header_BuiltinEndpointQos_t, body_BuiltinEndpointQos_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_BuiltinEndpointQos_t, + type_name_BuiltinEndpointQos_t.to_string(), type_ids_BuiltinEndpointQos_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::BuiltinEndpointQos_t already registered in TypeObjectRegistry for a different type."); + } + } +} + +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_StatusInfo_t_type_identifier( + TypeIdentifierPair& type_ids_StatusInfo_t) +{ + + ReturnCode_t return_code_StatusInfo_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_StatusInfo_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::StatusInfo_t", type_ids_StatusInfo_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_StatusInfo_t) + { + StructTypeFlag struct_flags_StatusInfo_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_StatusInfo_t = "eprosima::fastdds::rtps::core::detail::StatusInfo_t"; + eprosima::fastcdr::optional type_ann_builtin_StatusInfo_t; + eprosima::fastcdr::optional ann_custom_StatusInfo_t; + CompleteTypeDetail detail_StatusInfo_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusInfo_t, ann_custom_StatusInfo_t, type_name_StatusInfo_t.to_string()); + CompleteStructHeader header_StatusInfo_t; + header_StatusInfo_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StatusInfo_t); + CompleteStructMemberSeq member_seq_StatusInfo_t; + { + TypeIdentifierPair type_ids_value; + ReturnCode_t return_code_value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_4_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, element_identifier_anonymous_array_uint8_t_4_ec))}; + if (!element_identifier_anonymous_array_uint8_t_4_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_value.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4", type_ids_value)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_value = 0x00000000; + bool common_value_ec {false}; + CommonStructMember common_value {TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, common_value_ec))}; + if (!common_value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_StatusInfo_t.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_StatusInfo_t); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_StatusInfo_t, member_value); + } + CompleteStructType struct_type_StatusInfo_t = TypeObjectUtils::build_complete_struct_type(struct_flags_StatusInfo_t, header_StatusInfo_t, member_seq_StatusInfo_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StatusInfo_t, type_name_StatusInfo_t.to_string(), type_ids_StatusInfo_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::StatusInfo_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_KeyHash_t_type_identifier( + TypeIdentifierPair& type_ids_KeyHash_t) +{ + + ReturnCode_t return_code_KeyHash_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_KeyHash_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::KeyHash_t", type_ids_KeyHash_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_KeyHash_t) + { + StructTypeFlag struct_flags_KeyHash_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_KeyHash_t = "eprosima::fastdds::rtps::core::detail::KeyHash_t"; + eprosima::fastcdr::optional type_ann_builtin_KeyHash_t; + eprosima::fastcdr::optional ann_custom_KeyHash_t; + CompleteTypeDetail detail_KeyHash_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_KeyHash_t, ann_custom_KeyHash_t, type_name_KeyHash_t.to_string()); + CompleteStructHeader header_KeyHash_t; + header_KeyHash_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_KeyHash_t); + CompleteStructMemberSeq member_seq_KeyHash_t; + { + TypeIdentifierPair type_ids_value; + ReturnCode_t return_code_value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + return_code_value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_16_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, element_identifier_anonymous_array_uint8_t_16_ec))}; + if (!element_identifier_anonymous_array_uint8_t_16_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_value.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16", type_ids_value)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_value = 0x00000000; + bool common_value_ec {false}; + CommonStructMember common_value {TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_value, common_value_ec))}; + if (!common_value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_KeyHash_t.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_KeyHash_t); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyHash_t, member_value); + } + CompleteStructType struct_type_KeyHash_t = TypeObjectUtils::build_complete_struct_type(struct_flags_KeyHash_t, header_KeyHash_t, member_seq_KeyHash_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_KeyHash_t, type_name_KeyHash_t.to_string(), type_ids_KeyHash_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::KeyHash_t already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_EntityName_t_type_identifier( + TypeIdentifierPair& type_ids_EntityName_t) +{ + + ReturnCode_t return_code_EntityName_t {eprosima::fastdds::dds::RETCODE_OK}; + return_code_EntityName_t = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityName_t", type_ids_EntityName_t); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_EntityName_t) + { + StructTypeFlag struct_flags_EntityName_t = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_EntityName_t = "eprosima::fastdds::rtps::core::detail::EntityName_t"; + eprosima::fastcdr::optional type_ann_builtin_EntityName_t; + eprosima::fastcdr::optional ann_custom_EntityName_t; + CompleteTypeDetail detail_EntityName_t = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityName_t, ann_custom_EntityName_t, type_name_EntityName_t.to_string()); + CompleteStructHeader header_EntityName_t; + header_EntityName_t = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityName_t); + CompleteStructMemberSeq member_seq_EntityName_t; + { + TypeIdentifierPair type_ids_name; + ReturnCode_t return_code_name {eprosima::fastdds::dds::RETCODE_OK}; + return_code_name = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_name); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_name) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_name)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_name = 0x00000000; + bool common_name_ec {false}; + CommonStructMember common_name {TypeObjectUtils::build_common_struct_member(member_id_name, member_flags_name, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_name, common_name_ec))}; + if (!common_name_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure name member TypeIdentifier inconsistent."); + return; + } + MemberName name_name = "name"; + eprosima::fastcdr::optional member_ann_builtin_name; + ann_custom_EntityName_t.reset(); + CompleteMemberDetail detail_name = TypeObjectUtils::build_complete_member_detail(name_name, member_ann_builtin_name, ann_custom_EntityName_t); + CompleteStructMember member_name = TypeObjectUtils::build_complete_struct_member(common_name, detail_name); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityName_t, member_name); + } + CompleteStructType struct_type_EntityName_t = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityName_t, header_EntityName_t, member_seq_EntityName_t); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityName_t, type_name_EntityName_t.to_string(), type_ids_EntityName_t)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::detail::EntityName_t already registered in TypeObjectRegistry for a different type."); + } + } +} + +} // namespace detail +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Header_type_identifier( + TypeIdentifierPair& type_ids_Header) +{ + + ReturnCode_t return_code_Header {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Header = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::Header", type_ids_Header); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Header) + { + StructTypeFlag struct_flags_Header = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Header = "eprosima::fastdds::rtps::core::Header"; + eprosima::fastcdr::optional type_ann_builtin_Header; + eprosima::fastcdr::optional ann_custom_Header; + CompleteTypeDetail detail_Header = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Header, ann_custom_Header, type_name_Header.to_string()); + CompleteStructHeader header_Header; + header_Header = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Header); + CompleteStructMemberSeq member_seq_Header; + { + TypeIdentifierPair type_ids_prefix; + ReturnCode_t return_code_prefix {eprosima::fastdds::dds::RETCODE_OK}; + return_code_prefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_prefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_prefix) + { + return_code_prefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_prefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_prefix) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + bool element_identifier_anonymous_array_uint8_t_4_ec {false}; + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_prefix, element_identifier_anonymous_array_uint8_t_4_ec))}; + if (!element_identifier_anonymous_array_uint8_t_4_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_prefix.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4", type_ids_prefix)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_prefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_prefix = 0x00000000; + bool common_prefix_ec {false}; + CommonStructMember common_prefix {TypeObjectUtils::build_common_struct_member(member_id_prefix, member_flags_prefix, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_prefix, common_prefix_ec))}; + if (!common_prefix_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure prefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_prefix = "prefix"; + eprosima::fastcdr::optional member_ann_builtin_prefix; + ann_custom_Header.reset(); + CompleteMemberDetail detail_prefix = TypeObjectUtils::build_complete_member_detail(name_prefix, member_ann_builtin_prefix, ann_custom_Header); + CompleteStructMember member_prefix = TypeObjectUtils::build_complete_struct_member(common_prefix, detail_prefix); + TypeObjectUtils::add_complete_struct_member(member_seq_Header, member_prefix); + } + { + TypeIdentifierPair type_ids_version; + ReturnCode_t return_code_version {eprosima::fastdds::dds::RETCODE_OK}; + return_code_version = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::ProtocolVersion_t", type_ids_version); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_version) + { + eprosima::fastdds::rtps::core::detail::register_ProtocolVersion_t_type_identifier(type_ids_version); + } + StructMemberFlag member_flags_version = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_version = 0x00000001; + bool common_version_ec {false}; + CommonStructMember common_version {TypeObjectUtils::build_common_struct_member(member_id_version, member_flags_version, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_version, common_version_ec))}; + if (!common_version_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure version member TypeIdentifier inconsistent."); + return; + } + MemberName name_version = "version"; + eprosima::fastcdr::optional member_ann_builtin_version; + ann_custom_Header.reset(); + CompleteMemberDetail detail_version = TypeObjectUtils::build_complete_member_detail(name_version, member_ann_builtin_version, ann_custom_Header); + CompleteStructMember member_version = TypeObjectUtils::build_complete_struct_member(common_version, detail_version); + TypeObjectUtils::add_complete_struct_member(member_seq_Header, member_version); + } + { + TypeIdentifierPair type_ids_vendorId; + ReturnCode_t return_code_vendorId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_vendorId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::VendorId_t", type_ids_vendorId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_vendorId) + { + eprosima::fastdds::rtps::core::detail::register_VendorId_t_type_identifier(type_ids_vendorId); + } + StructMemberFlag member_flags_vendorId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_vendorId = 0x00000002; + bool common_vendorId_ec {false}; + CommonStructMember common_vendorId {TypeObjectUtils::build_common_struct_member(member_id_vendorId, member_flags_vendorId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_vendorId, common_vendorId_ec))}; + if (!common_vendorId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure vendorId member TypeIdentifier inconsistent."); + return; + } + MemberName name_vendorId = "vendorId"; + eprosima::fastcdr::optional member_ann_builtin_vendorId; + ann_custom_Header.reset(); + CompleteMemberDetail detail_vendorId = TypeObjectUtils::build_complete_member_detail(name_vendorId, member_ann_builtin_vendorId, ann_custom_Header); + CompleteStructMember member_vendorId = TypeObjectUtils::build_complete_struct_member(common_vendorId, detail_vendorId); + TypeObjectUtils::add_complete_struct_member(member_seq_Header, member_vendorId); + } + { + TypeIdentifierPair type_ids_guidPrefix; + ReturnCode_t return_code_guidPrefix {eprosima::fastdds::dds::RETCODE_OK}; + return_code_guidPrefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t", type_ids_guidPrefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_guidPrefix) + { + eprosima::fastdds::rtps::core::detail::register_GuidPrefix_t_type_identifier(type_ids_guidPrefix); + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_guidPrefix = 0x00000003; + bool common_guidPrefix_ec {false}; + CommonStructMember common_guidPrefix {TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_guidPrefix, common_guidPrefix_ec))}; + if (!common_guidPrefix_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_Header.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_Header); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_Header, member_guidPrefix); + } + CompleteStructType struct_type_Header = TypeObjectUtils::build_complete_struct_type(struct_flags_Header, header_Header, member_seq_Header); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Header, type_name_Header.to_string(), type_ids_Header)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::Header already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_SubmessageHeader_type_identifier( + TypeIdentifierPair& type_ids_SubmessageHeader) +{ + + ReturnCode_t return_code_SubmessageHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_SubmessageHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_SubmessageHeader); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_SubmessageHeader) + { + StructTypeFlag struct_flags_SubmessageHeader = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_SubmessageHeader = "eprosima::fastdds::rtps::core::SubmessageHeader"; + eprosima::fastcdr::optional type_ann_builtin_SubmessageHeader; + eprosima::fastcdr::optional ann_custom_SubmessageHeader; + CompleteTypeDetail detail_SubmessageHeader = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SubmessageHeader, ann_custom_SubmessageHeader, type_name_SubmessageHeader.to_string()); + CompleteStructHeader header_SubmessageHeader; + header_SubmessageHeader = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SubmessageHeader); + CompleteStructMemberSeq member_seq_SubmessageHeader; + { + TypeIdentifierPair type_ids_submessageId; + ReturnCode_t return_code_submessageId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submessageId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_submessageId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submessageId) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "submessageId Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_submessageId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submessageId = 0x00000000; + bool common_submessageId_ec {false}; + CommonStructMember common_submessageId {TypeObjectUtils::build_common_struct_member(member_id_submessageId, member_flags_submessageId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submessageId, common_submessageId_ec))}; + if (!common_submessageId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submessageId member TypeIdentifier inconsistent."); + return; + } + MemberName name_submessageId = "submessageId"; + eprosima::fastcdr::optional member_ann_builtin_submessageId; + ann_custom_SubmessageHeader.reset(); + CompleteMemberDetail detail_submessageId = TypeObjectUtils::build_complete_member_detail(name_submessageId, member_ann_builtin_submessageId, ann_custom_SubmessageHeader); + CompleteStructMember member_submessageId = TypeObjectUtils::build_complete_struct_member(common_submessageId, detail_submessageId); + TypeObjectUtils::add_complete_struct_member(member_seq_SubmessageHeader, member_submessageId); + } + { + TypeIdentifierPair type_ids_flags; + ReturnCode_t return_code_flags {eprosima::fastdds::dds::RETCODE_OK}; + return_code_flags = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_flags); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_flags) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "flags Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_flags = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_flags = 0x00000001; + bool common_flags_ec {false}; + CommonStructMember common_flags {TypeObjectUtils::build_common_struct_member(member_id_flags, member_flags_flags, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_flags, common_flags_ec))}; + if (!common_flags_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure flags member TypeIdentifier inconsistent."); + return; + } + MemberName name_flags = "flags"; + eprosima::fastcdr::optional member_ann_builtin_flags; + ann_custom_SubmessageHeader.reset(); + CompleteMemberDetail detail_flags = TypeObjectUtils::build_complete_member_detail(name_flags, member_ann_builtin_flags, ann_custom_SubmessageHeader); + CompleteStructMember member_flags = TypeObjectUtils::build_complete_struct_member(common_flags, detail_flags); + TypeObjectUtils::add_complete_struct_member(member_seq_SubmessageHeader, member_flags); + } + { + TypeIdentifierPair type_ids_submessageLength; + ReturnCode_t return_code_submessageLength {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submessageLength = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_submessageLength); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submessageLength) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "submessageLength Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_submessageLength = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submessageLength = 0x00000002; + bool common_submessageLength_ec {false}; + CommonStructMember common_submessageLength {TypeObjectUtils::build_common_struct_member(member_id_submessageLength, member_flags_submessageLength, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submessageLength, common_submessageLength_ec))}; + if (!common_submessageLength_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submessageLength member TypeIdentifier inconsistent."); + return; + } + MemberName name_submessageLength = "submessageLength"; + eprosima::fastcdr::optional member_ann_builtin_submessageLength; + ann_custom_SubmessageHeader.reset(); + CompleteMemberDetail detail_submessageLength = TypeObjectUtils::build_complete_member_detail(name_submessageLength, member_ann_builtin_submessageLength, ann_custom_SubmessageHeader); + CompleteStructMember member_submessageLength = TypeObjectUtils::build_complete_struct_member(common_submessageLength, detail_submessageLength); + TypeObjectUtils::add_complete_struct_member(member_seq_SubmessageHeader, member_submessageLength); + } + CompleteStructType struct_type_SubmessageHeader = TypeObjectUtils::build_complete_struct_type(struct_flags_SubmessageHeader, header_SubmessageHeader, member_seq_SubmessageHeader); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SubmessageHeader, type_name_SubmessageHeader.to_string(), type_ids_SubmessageHeader)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::SubmessageHeader already registered in TypeObjectRegistry for a different type."); + } + } +} +namespace SubmessageKind { +} // namespace SubmessageKind +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_AckNackSubmessage_type_identifier( + TypeIdentifierPair& type_ids_AckNackSubmessage) +{ + + ReturnCode_t return_code_AckNackSubmessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_AckNackSubmessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::AckNackSubmessage", type_ids_AckNackSubmessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_AckNackSubmessage) + { + StructTypeFlag struct_flags_AckNackSubmessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_AckNackSubmessage = "eprosima::fastdds::rtps::core::AckNackSubmessage"; + eprosima::fastcdr::optional type_ann_builtin_AckNackSubmessage; + eprosima::fastcdr::optional ann_custom_AckNackSubmessage; + CompleteTypeDetail detail_AckNackSubmessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AckNackSubmessage, ann_custom_AckNackSubmessage, type_name_AckNackSubmessage.to_string()); + CompleteStructHeader header_AckNackSubmessage; + header_AckNackSubmessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AckNackSubmessage); + CompleteStructMemberSeq member_seq_AckNackSubmessage; + { + TypeIdentifierPair type_ids_submsgHeader; + ReturnCode_t return_code_submsgHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submsgHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_submsgHeader); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submsgHeader) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_submsgHeader); + } + StructMemberFlag member_flags_submsgHeader = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submsgHeader = 0x00000000; + bool common_submsgHeader_ec {false}; + CommonStructMember common_submsgHeader {TypeObjectUtils::build_common_struct_member(member_id_submsgHeader, member_flags_submsgHeader, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submsgHeader, common_submsgHeader_ec))}; + if (!common_submsgHeader_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submsgHeader member TypeIdentifier inconsistent."); + return; + } + MemberName name_submsgHeader = "submsgHeader"; + eprosima::fastcdr::optional member_ann_builtin_submsgHeader; + ann_custom_AckNackSubmessage.reset(); + CompleteMemberDetail detail_submsgHeader = TypeObjectUtils::build_complete_member_detail(name_submsgHeader, member_ann_builtin_submsgHeader, ann_custom_AckNackSubmessage); + CompleteStructMember member_submsgHeader = TypeObjectUtils::build_complete_struct_member(common_submsgHeader, detail_submsgHeader); + TypeObjectUtils::add_complete_struct_member(member_seq_AckNackSubmessage, member_submsgHeader); + } + { + TypeIdentifierPair type_ids_readerId; + ReturnCode_t return_code_readerId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_readerId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_readerId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_readerId) + { + eprosima::fastdds::rtps::core::detail::register_EntityId_t_type_identifier(type_ids_readerId); + } + StructMemberFlag member_flags_readerId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_readerId = 0x00000001; + bool common_readerId_ec {false}; + CommonStructMember common_readerId {TypeObjectUtils::build_common_struct_member(member_id_readerId, member_flags_readerId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_readerId, common_readerId_ec))}; + if (!common_readerId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure readerId member TypeIdentifier inconsistent."); + return; + } + MemberName name_readerId = "readerId"; + eprosima::fastcdr::optional member_ann_builtin_readerId; + ann_custom_AckNackSubmessage.reset(); + CompleteMemberDetail detail_readerId = TypeObjectUtils::build_complete_member_detail(name_readerId, member_ann_builtin_readerId, ann_custom_AckNackSubmessage); + CompleteStructMember member_readerId = TypeObjectUtils::build_complete_struct_member(common_readerId, detail_readerId); + TypeObjectUtils::add_complete_struct_member(member_seq_AckNackSubmessage, member_readerId); + } + { + TypeIdentifierPair type_ids_writerId; + ReturnCode_t return_code_writerId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_writerId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_writerId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_writerId) + { + eprosima::fastdds::rtps::core::detail::register_EntityId_t_type_identifier(type_ids_writerId); + } + StructMemberFlag member_flags_writerId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_writerId = 0x00000002; + bool common_writerId_ec {false}; + CommonStructMember common_writerId {TypeObjectUtils::build_common_struct_member(member_id_writerId, member_flags_writerId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_writerId, common_writerId_ec))}; + if (!common_writerId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure writerId member TypeIdentifier inconsistent."); + return; + } + MemberName name_writerId = "writerId"; + eprosima::fastcdr::optional member_ann_builtin_writerId; + ann_custom_AckNackSubmessage.reset(); + CompleteMemberDetail detail_writerId = TypeObjectUtils::build_complete_member_detail(name_writerId, member_ann_builtin_writerId, ann_custom_AckNackSubmessage); + CompleteStructMember member_writerId = TypeObjectUtils::build_complete_struct_member(common_writerId, detail_writerId); + TypeObjectUtils::add_complete_struct_member(member_seq_AckNackSubmessage, member_writerId); + } + { + TypeIdentifierPair type_ids_readerSNState; + ReturnCode_t return_code_readerSNState {eprosima::fastdds::dds::RETCODE_OK}; + return_code_readerSNState = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumberSet", type_ids_readerSNState); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_readerSNState) + { + eprosima::fastdds::rtps::core::detail::register_SequenceNumberSet_type_identifier(type_ids_readerSNState); + } + StructMemberFlag member_flags_readerSNState = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_readerSNState = 0x00000003; + bool common_readerSNState_ec {false}; + CommonStructMember common_readerSNState {TypeObjectUtils::build_common_struct_member(member_id_readerSNState, member_flags_readerSNState, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_readerSNState, common_readerSNState_ec))}; + if (!common_readerSNState_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure readerSNState member TypeIdentifier inconsistent."); + return; + } + MemberName name_readerSNState = "readerSNState"; + eprosima::fastcdr::optional member_ann_builtin_readerSNState; + ann_custom_AckNackSubmessage.reset(); + CompleteMemberDetail detail_readerSNState = TypeObjectUtils::build_complete_member_detail(name_readerSNState, member_ann_builtin_readerSNState, ann_custom_AckNackSubmessage); + CompleteStructMember member_readerSNState = TypeObjectUtils::build_complete_struct_member(common_readerSNState, detail_readerSNState); + TypeObjectUtils::add_complete_struct_member(member_seq_AckNackSubmessage, member_readerSNState); + } + { + TypeIdentifierPair type_ids_count; + ReturnCode_t return_code_count {eprosima::fastdds::dds::RETCODE_OK}; + return_code_count = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Count_t", type_ids_count); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_count) + { + eprosima::fastdds::rtps::core::detail::register_Count_t_type_identifier(type_ids_count); + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_count = 0x00000004; + bool common_count_ec {false}; + CommonStructMember common_count {TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_count, common_count_ec))}; + if (!common_count_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_AckNackSubmessage.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_AckNackSubmessage); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_AckNackSubmessage, member_count); + } + CompleteStructType struct_type_AckNackSubmessage = TypeObjectUtils::build_complete_struct_type(struct_flags_AckNackSubmessage, header_AckNackSubmessage, member_seq_AckNackSubmessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_AckNackSubmessage, type_name_AckNackSubmessage.to_string(), type_ids_AckNackSubmessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::AckNackSubmessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_HeartBeatSubmessage_type_identifier( + TypeIdentifierPair& type_ids_HeartBeatSubmessage) +{ + + ReturnCode_t return_code_HeartBeatSubmessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_HeartBeatSubmessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::HeartBeatSubmessage", type_ids_HeartBeatSubmessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_HeartBeatSubmessage) + { + StructTypeFlag struct_flags_HeartBeatSubmessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_HeartBeatSubmessage = "eprosima::fastdds::rtps::core::HeartBeatSubmessage"; + eprosima::fastcdr::optional type_ann_builtin_HeartBeatSubmessage; + eprosima::fastcdr::optional ann_custom_HeartBeatSubmessage; + CompleteTypeDetail detail_HeartBeatSubmessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HeartBeatSubmessage, ann_custom_HeartBeatSubmessage, type_name_HeartBeatSubmessage.to_string()); + CompleteStructHeader header_HeartBeatSubmessage; + header_HeartBeatSubmessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HeartBeatSubmessage); + CompleteStructMemberSeq member_seq_HeartBeatSubmessage; + { + TypeIdentifierPair type_ids_submsgHeader; + ReturnCode_t return_code_submsgHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submsgHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_submsgHeader); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submsgHeader) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_submsgHeader); + } + StructMemberFlag member_flags_submsgHeader = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submsgHeader = 0x00000000; + bool common_submsgHeader_ec {false}; + CommonStructMember common_submsgHeader {TypeObjectUtils::build_common_struct_member(member_id_submsgHeader, member_flags_submsgHeader, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submsgHeader, common_submsgHeader_ec))}; + if (!common_submsgHeader_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submsgHeader member TypeIdentifier inconsistent."); + return; + } + MemberName name_submsgHeader = "submsgHeader"; + eprosima::fastcdr::optional member_ann_builtin_submsgHeader; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_submsgHeader = TypeObjectUtils::build_complete_member_detail(name_submsgHeader, member_ann_builtin_submsgHeader, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_submsgHeader = TypeObjectUtils::build_complete_struct_member(common_submsgHeader, detail_submsgHeader); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_submsgHeader); + } + { + TypeIdentifierPair type_ids_readerId; + ReturnCode_t return_code_readerId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_readerId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_readerId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_readerId) + { + eprosima::fastdds::rtps::core::detail::register_EntityId_t_type_identifier(type_ids_readerId); + } + StructMemberFlag member_flags_readerId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_readerId = 0x00000001; + bool common_readerId_ec {false}; + CommonStructMember common_readerId {TypeObjectUtils::build_common_struct_member(member_id_readerId, member_flags_readerId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_readerId, common_readerId_ec))}; + if (!common_readerId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure readerId member TypeIdentifier inconsistent."); + return; + } + MemberName name_readerId = "readerId"; + eprosima::fastcdr::optional member_ann_builtin_readerId; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_readerId = TypeObjectUtils::build_complete_member_detail(name_readerId, member_ann_builtin_readerId, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_readerId = TypeObjectUtils::build_complete_struct_member(common_readerId, detail_readerId); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_readerId); + } + { + TypeIdentifierPair type_ids_writerId; + ReturnCode_t return_code_writerId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_writerId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::EntityId_t", type_ids_writerId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_writerId) + { + eprosima::fastdds::rtps::core::detail::register_EntityId_t_type_identifier(type_ids_writerId); + } + StructMemberFlag member_flags_writerId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_writerId = 0x00000002; + bool common_writerId_ec {false}; + CommonStructMember common_writerId {TypeObjectUtils::build_common_struct_member(member_id_writerId, member_flags_writerId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_writerId, common_writerId_ec))}; + if (!common_writerId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure writerId member TypeIdentifier inconsistent."); + return; + } + MemberName name_writerId = "writerId"; + eprosima::fastcdr::optional member_ann_builtin_writerId; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_writerId = TypeObjectUtils::build_complete_member_detail(name_writerId, member_ann_builtin_writerId, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_writerId = TypeObjectUtils::build_complete_struct_member(common_writerId, detail_writerId); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_writerId); + } + { + TypeIdentifierPair type_ids_firstSN; + ReturnCode_t return_code_firstSN {eprosima::fastdds::dds::RETCODE_OK}; + return_code_firstSN = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumber_t", type_ids_firstSN); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_firstSN) + { + eprosima::fastdds::rtps::core::detail::register_SequenceNumber_t_type_identifier(type_ids_firstSN); + } + StructMemberFlag member_flags_firstSN = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_firstSN = 0x00000003; + bool common_firstSN_ec {false}; + CommonStructMember common_firstSN {TypeObjectUtils::build_common_struct_member(member_id_firstSN, member_flags_firstSN, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_firstSN, common_firstSN_ec))}; + if (!common_firstSN_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure firstSN member TypeIdentifier inconsistent."); + return; + } + MemberName name_firstSN = "firstSN"; + eprosima::fastcdr::optional member_ann_builtin_firstSN; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_firstSN = TypeObjectUtils::build_complete_member_detail(name_firstSN, member_ann_builtin_firstSN, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_firstSN = TypeObjectUtils::build_complete_struct_member(common_firstSN, detail_firstSN); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_firstSN); + } + { + TypeIdentifierPair type_ids_lastSN; + ReturnCode_t return_code_lastSN {eprosima::fastdds::dds::RETCODE_OK}; + return_code_lastSN = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::SequenceNumber_t", type_ids_lastSN); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_lastSN) + { + eprosima::fastdds::rtps::core::detail::register_SequenceNumber_t_type_identifier(type_ids_lastSN); + } + StructMemberFlag member_flags_lastSN = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_lastSN = 0x00000004; + bool common_lastSN_ec {false}; + CommonStructMember common_lastSN {TypeObjectUtils::build_common_struct_member(member_id_lastSN, member_flags_lastSN, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_lastSN, common_lastSN_ec))}; + if (!common_lastSN_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure lastSN member TypeIdentifier inconsistent."); + return; + } + MemberName name_lastSN = "lastSN"; + eprosima::fastcdr::optional member_ann_builtin_lastSN; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_lastSN = TypeObjectUtils::build_complete_member_detail(name_lastSN, member_ann_builtin_lastSN, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_lastSN = TypeObjectUtils::build_complete_struct_member(common_lastSN, detail_lastSN); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_lastSN); + } + { + TypeIdentifierPair type_ids_count; + ReturnCode_t return_code_count {eprosima::fastdds::dds::RETCODE_OK}; + return_code_count = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Count_t", type_ids_count); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_count) + { + eprosima::fastdds::rtps::core::detail::register_Count_t_type_identifier(type_ids_count); + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_count = 0x00000005; + bool common_count_ec {false}; + CommonStructMember common_count {TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_count, common_count_ec))}; + if (!common_count_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_HeartBeatSubmessage.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_HeartBeatSubmessage); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_HeartBeatSubmessage, member_count); + } + CompleteStructType struct_type_HeartBeatSubmessage = TypeObjectUtils::build_complete_struct_type(struct_flags_HeartBeatSubmessage, header_HeartBeatSubmessage, member_seq_HeartBeatSubmessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HeartBeatSubmessage, type_name_HeartBeatSubmessage.to_string(), type_ids_HeartBeatSubmessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::HeartBeatSubmessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_InfoDestinationSubmessage_type_identifier( + TypeIdentifierPair& type_ids_InfoDestinationSubmessage) +{ + + ReturnCode_t return_code_InfoDestinationSubmessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_InfoDestinationSubmessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoDestinationSubmessage", type_ids_InfoDestinationSubmessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_InfoDestinationSubmessage) + { + StructTypeFlag struct_flags_InfoDestinationSubmessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_InfoDestinationSubmessage = "eprosima::fastdds::rtps::core::InfoDestinationSubmessage"; + eprosima::fastcdr::optional type_ann_builtin_InfoDestinationSubmessage; + eprosima::fastcdr::optional ann_custom_InfoDestinationSubmessage; + CompleteTypeDetail detail_InfoDestinationSubmessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InfoDestinationSubmessage, ann_custom_InfoDestinationSubmessage, type_name_InfoDestinationSubmessage.to_string()); + CompleteStructHeader header_InfoDestinationSubmessage; + header_InfoDestinationSubmessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_InfoDestinationSubmessage); + CompleteStructMemberSeq member_seq_InfoDestinationSubmessage; + { + TypeIdentifierPair type_ids_submsgHeader; + ReturnCode_t return_code_submsgHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submsgHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_submsgHeader); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submsgHeader) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_submsgHeader); + } + StructMemberFlag member_flags_submsgHeader = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submsgHeader = 0x00000000; + bool common_submsgHeader_ec {false}; + CommonStructMember common_submsgHeader {TypeObjectUtils::build_common_struct_member(member_id_submsgHeader, member_flags_submsgHeader, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submsgHeader, common_submsgHeader_ec))}; + if (!common_submsgHeader_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submsgHeader member TypeIdentifier inconsistent."); + return; + } + MemberName name_submsgHeader = "submsgHeader"; + eprosima::fastcdr::optional member_ann_builtin_submsgHeader; + ann_custom_InfoDestinationSubmessage.reset(); + CompleteMemberDetail detail_submsgHeader = TypeObjectUtils::build_complete_member_detail(name_submsgHeader, member_ann_builtin_submsgHeader, ann_custom_InfoDestinationSubmessage); + CompleteStructMember member_submsgHeader = TypeObjectUtils::build_complete_struct_member(common_submsgHeader, detail_submsgHeader); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoDestinationSubmessage, member_submsgHeader); + } + { + TypeIdentifierPair type_ids_guidPrefix; + ReturnCode_t return_code_guidPrefix {eprosima::fastdds::dds::RETCODE_OK}; + return_code_guidPrefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t", type_ids_guidPrefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_guidPrefix) + { + eprosima::fastdds::rtps::core::detail::register_GuidPrefix_t_type_identifier(type_ids_guidPrefix); + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_guidPrefix = 0x00000001; + bool common_guidPrefix_ec {false}; + CommonStructMember common_guidPrefix {TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_guidPrefix, common_guidPrefix_ec))}; + if (!common_guidPrefix_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_InfoDestinationSubmessage.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_InfoDestinationSubmessage); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoDestinationSubmessage, member_guidPrefix); + } + CompleteStructType struct_type_InfoDestinationSubmessage = TypeObjectUtils::build_complete_struct_type(struct_flags_InfoDestinationSubmessage, header_InfoDestinationSubmessage, member_seq_InfoDestinationSubmessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_InfoDestinationSubmessage, type_name_InfoDestinationSubmessage.to_string(), type_ids_InfoDestinationSubmessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::InfoDestinationSubmessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_InfoSourceSubmessage_type_identifier( + TypeIdentifierPair& type_ids_InfoSourceSubmessage) +{ + + ReturnCode_t return_code_InfoSourceSubmessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_InfoSourceSubmessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoSourceSubmessage", type_ids_InfoSourceSubmessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_InfoSourceSubmessage) + { + StructTypeFlag struct_flags_InfoSourceSubmessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_InfoSourceSubmessage = "eprosima::fastdds::rtps::core::InfoSourceSubmessage"; + eprosima::fastcdr::optional type_ann_builtin_InfoSourceSubmessage; + eprosima::fastcdr::optional ann_custom_InfoSourceSubmessage; + CompleteTypeDetail detail_InfoSourceSubmessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InfoSourceSubmessage, ann_custom_InfoSourceSubmessage, type_name_InfoSourceSubmessage.to_string()); + CompleteStructHeader header_InfoSourceSubmessage; + header_InfoSourceSubmessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_InfoSourceSubmessage); + CompleteStructMemberSeq member_seq_InfoSourceSubmessage; + { + TypeIdentifierPair type_ids_submsgHeader; + ReturnCode_t return_code_submsgHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submsgHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_submsgHeader); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submsgHeader) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_submsgHeader); + } + StructMemberFlag member_flags_submsgHeader = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submsgHeader = 0x00000000; + bool common_submsgHeader_ec {false}; + CommonStructMember common_submsgHeader {TypeObjectUtils::build_common_struct_member(member_id_submsgHeader, member_flags_submsgHeader, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submsgHeader, common_submsgHeader_ec))}; + if (!common_submsgHeader_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submsgHeader member TypeIdentifier inconsistent."); + return; + } + MemberName name_submsgHeader = "submsgHeader"; + eprosima::fastcdr::optional member_ann_builtin_submsgHeader; + ann_custom_InfoSourceSubmessage.reset(); + CompleteMemberDetail detail_submsgHeader = TypeObjectUtils::build_complete_member_detail(name_submsgHeader, member_ann_builtin_submsgHeader, ann_custom_InfoSourceSubmessage); + CompleteStructMember member_submsgHeader = TypeObjectUtils::build_complete_struct_member(common_submsgHeader, detail_submsgHeader); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoSourceSubmessage, member_submsgHeader); + } + { + TypeIdentifierPair type_ids_unused; + ReturnCode_t return_code_unused {eprosima::fastdds::dds::RETCODE_OK}; + return_code_unused = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_unused); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_unused) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "unused Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_unused = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_unused = 0x00000001; + bool common_unused_ec {false}; + CommonStructMember common_unused {TypeObjectUtils::build_common_struct_member(member_id_unused, member_flags_unused, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_unused, common_unused_ec))}; + if (!common_unused_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure unused member TypeIdentifier inconsistent."); + return; + } + MemberName name_unused = "unused"; + eprosima::fastcdr::optional member_ann_builtin_unused; + ann_custom_InfoSourceSubmessage.reset(); + CompleteMemberDetail detail_unused = TypeObjectUtils::build_complete_member_detail(name_unused, member_ann_builtin_unused, ann_custom_InfoSourceSubmessage); + CompleteStructMember member_unused = TypeObjectUtils::build_complete_struct_member(common_unused, detail_unused); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoSourceSubmessage, member_unused); + } + { + TypeIdentifierPair type_ids_version; + ReturnCode_t return_code_version {eprosima::fastdds::dds::RETCODE_OK}; + return_code_version = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::ProtocolVersion_t", type_ids_version); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_version) + { + eprosima::fastdds::rtps::core::detail::register_ProtocolVersion_t_type_identifier(type_ids_version); + } + StructMemberFlag member_flags_version = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_version = 0x00000002; + bool common_version_ec {false}; + CommonStructMember common_version {TypeObjectUtils::build_common_struct_member(member_id_version, member_flags_version, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_version, common_version_ec))}; + if (!common_version_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure version member TypeIdentifier inconsistent."); + return; + } + MemberName name_version = "version"; + eprosima::fastcdr::optional member_ann_builtin_version; + ann_custom_InfoSourceSubmessage.reset(); + CompleteMemberDetail detail_version = TypeObjectUtils::build_complete_member_detail(name_version, member_ann_builtin_version, ann_custom_InfoSourceSubmessage); + CompleteStructMember member_version = TypeObjectUtils::build_complete_struct_member(common_version, detail_version); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoSourceSubmessage, member_version); + } + { + TypeIdentifierPair type_ids_vendorId; + ReturnCode_t return_code_vendorId {eprosima::fastdds::dds::RETCODE_OK}; + return_code_vendorId = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::VendorId_t", type_ids_vendorId); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_vendorId) + { + eprosima::fastdds::rtps::core::detail::register_VendorId_t_type_identifier(type_ids_vendorId); + } + StructMemberFlag member_flags_vendorId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_vendorId = 0x00000003; + bool common_vendorId_ec {false}; + CommonStructMember common_vendorId {TypeObjectUtils::build_common_struct_member(member_id_vendorId, member_flags_vendorId, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_vendorId, common_vendorId_ec))}; + if (!common_vendorId_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure vendorId member TypeIdentifier inconsistent."); + return; + } + MemberName name_vendorId = "vendorId"; + eprosima::fastcdr::optional member_ann_builtin_vendorId; + ann_custom_InfoSourceSubmessage.reset(); + CompleteMemberDetail detail_vendorId = TypeObjectUtils::build_complete_member_detail(name_vendorId, member_ann_builtin_vendorId, ann_custom_InfoSourceSubmessage); + CompleteStructMember member_vendorId = TypeObjectUtils::build_complete_struct_member(common_vendorId, detail_vendorId); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoSourceSubmessage, member_vendorId); + } + { + TypeIdentifierPair type_ids_guidPrefix; + ReturnCode_t return_code_guidPrefix {eprosima::fastdds::dds::RETCODE_OK}; + return_code_guidPrefix = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::GuidPrefix_t", type_ids_guidPrefix); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_guidPrefix) + { + eprosima::fastdds::rtps::core::detail::register_GuidPrefix_t_type_identifier(type_ids_guidPrefix); + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_guidPrefix = 0x00000004; + bool common_guidPrefix_ec {false}; + CommonStructMember common_guidPrefix {TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_guidPrefix, common_guidPrefix_ec))}; + if (!common_guidPrefix_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_InfoSourceSubmessage.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_InfoSourceSubmessage); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoSourceSubmessage, member_guidPrefix); + } + CompleteStructType struct_type_InfoSourceSubmessage = TypeObjectUtils::build_complete_struct_type(struct_flags_InfoSourceSubmessage, header_InfoSourceSubmessage, member_seq_InfoSourceSubmessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_InfoSourceSubmessage, type_name_InfoSourceSubmessage.to_string(), type_ids_InfoSourceSubmessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::InfoSourceSubmessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_InfoTimestampSubmessage_type_identifier( + TypeIdentifierPair& type_ids_InfoTimestampSubmessage) +{ + + ReturnCode_t return_code_InfoTimestampSubmessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_InfoTimestampSubmessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoTimestampSubmessage", type_ids_InfoTimestampSubmessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_InfoTimestampSubmessage) + { + StructTypeFlag struct_flags_InfoTimestampSubmessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_InfoTimestampSubmessage = "eprosima::fastdds::rtps::core::InfoTimestampSubmessage"; + eprosima::fastcdr::optional type_ann_builtin_InfoTimestampSubmessage; + eprosima::fastcdr::optional ann_custom_InfoTimestampSubmessage; + CompleteTypeDetail detail_InfoTimestampSubmessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InfoTimestampSubmessage, ann_custom_InfoTimestampSubmessage, type_name_InfoTimestampSubmessage.to_string()); + CompleteStructHeader header_InfoTimestampSubmessage; + header_InfoTimestampSubmessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_InfoTimestampSubmessage); + CompleteStructMemberSeq member_seq_InfoTimestampSubmessage; + { + TypeIdentifierPair type_ids_submsgHeader; + ReturnCode_t return_code_submsgHeader {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submsgHeader = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_submsgHeader); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submsgHeader) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_submsgHeader); + } + StructMemberFlag member_flags_submsgHeader = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submsgHeader = 0x00000000; + bool common_submsgHeader_ec {false}; + CommonStructMember common_submsgHeader {TypeObjectUtils::build_common_struct_member(member_id_submsgHeader, member_flags_submsgHeader, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submsgHeader, common_submsgHeader_ec))}; + if (!common_submsgHeader_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submsgHeader member TypeIdentifier inconsistent."); + return; + } + MemberName name_submsgHeader = "submsgHeader"; + eprosima::fastcdr::optional member_ann_builtin_submsgHeader; + ann_custom_InfoTimestampSubmessage.reset(); + CompleteMemberDetail detail_submsgHeader = TypeObjectUtils::build_complete_member_detail(name_submsgHeader, member_ann_builtin_submsgHeader, ann_custom_InfoTimestampSubmessage); + CompleteStructMember member_submsgHeader = TypeObjectUtils::build_complete_struct_member(common_submsgHeader, detail_submsgHeader); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoTimestampSubmessage, member_submsgHeader); + } + { + TypeIdentifierPair type_ids_timestamp; + ReturnCode_t return_code_timestamp {eprosima::fastdds::dds::RETCODE_OK}; + return_code_timestamp = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::detail::Timestamp", type_ids_timestamp); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_timestamp) + { + eprosima::fastdds::rtps::core::detail::register_Timestamp_type_identifier(type_ids_timestamp); + } + StructMemberFlag member_flags_timestamp = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_timestamp = 0x00000001; + bool common_timestamp_ec {false}; + CommonStructMember common_timestamp {TypeObjectUtils::build_common_struct_member(member_id_timestamp, member_flags_timestamp, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_timestamp, common_timestamp_ec))}; + if (!common_timestamp_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure timestamp member TypeIdentifier inconsistent."); + return; + } + MemberName name_timestamp = "timestamp"; + eprosima::fastcdr::optional member_ann_builtin_timestamp; + ann_custom_InfoTimestampSubmessage.reset(); + CompleteMemberDetail detail_timestamp = TypeObjectUtils::build_complete_member_detail(name_timestamp, member_ann_builtin_timestamp, ann_custom_InfoTimestampSubmessage); + CompleteStructMember member_timestamp = TypeObjectUtils::build_complete_struct_member(common_timestamp, detail_timestamp); + TypeObjectUtils::add_complete_struct_member(member_seq_InfoTimestampSubmessage, member_timestamp); + } + CompleteStructType struct_type_InfoTimestampSubmessage = TypeObjectUtils::build_complete_struct_type(struct_flags_InfoTimestampSubmessage, header_InfoTimestampSubmessage, member_seq_InfoTimestampSubmessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_InfoTimestampSubmessage, type_name_InfoTimestampSubmessage.to_string(), type_ids_InfoTimestampSubmessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::InfoTimestampSubmessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_Submessage_type_identifier( + TypeIdentifierPair& type_ids_Submessage) +{ + ReturnCode_t return_code_Submessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::Submessage", type_ids_Submessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + UnionTypeFlag union_flags_Submessage = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_Submessage = "eprosima::fastdds::rtps::core::Submessage"; + eprosima::fastcdr::optional type_ann_builtin_Submessage; + eprosima::fastcdr::optional ann_custom_Submessage; + CompleteTypeDetail detail_Submessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Submessage, ann_custom_Submessage, type_name_Submessage.to_string()); + CompleteUnionHeader header_Submessage = TypeObjectUtils::build_complete_union_header(detail_Submessage); + UnionDiscriminatorFlag member_flags_Submessage = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false); + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_Submessage); + + if (return_code_Submessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonDiscriminatorMember common_Submessage; + if (EK_COMPLETE == type_ids_Submessage.type_identifier1()._d() || TK_NONE == type_ids_Submessage.type_identifier2()._d()) + { + common_Submessage = TypeObjectUtils::build_common_discriminator_member(member_flags_Submessage, type_ids_Submessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Submessage.type_identifier2()._d()) + { + common_Submessage = TypeObjectUtils::build_common_discriminator_member(member_flags_Submessage, type_ids_Submessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::Submessage discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_Submessage.reset(); + ann_custom_Submessage.reset(); + CompleteDiscriminatorMember discriminator_Submessage = TypeObjectUtils::build_complete_discriminator_member(common_Submessage, + type_ann_builtin_Submessage, ann_custom_Submessage); + CompleteUnionMemberSeq member_seq_Submessage; + { + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::HeartBeatSubmessage", type_ids_Submessage); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + eprosima::fastdds::rtps::core::register_HeartBeatSubmessage_type_identifier(type_ids_Submessage); + } + UnionMemberFlag member_flags_heartbeat_submsg = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false); + UnionCaseLabelSeq label_seq_heartbeat_submsg; + TypeObjectUtils::add_union_case_label(label_seq_heartbeat_submsg, static_cast(SubmessageKind::HEARTBEAT)); + MemberId member_id_heartbeat_submsg = 0x00000001; + bool common_heartbeat_submsg_ec {false}; + CommonUnionMember common_heartbeat_submsg {TypeObjectUtils::build_common_union_member(member_id_heartbeat_submsg, + member_flags_heartbeat_submsg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Submessage, + common_heartbeat_submsg_ec), label_seq_heartbeat_submsg)}; + if (!common_heartbeat_submsg_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Union heartbeat_submsg member TypeIdentifier inconsistent."); + return; + } + MemberName name_heartbeat_submsg = "heartbeat_submsg"; + eprosima::fastcdr::optional member_ann_builtin_heartbeat_submsg; + ann_custom_Submessage.reset(); + CompleteMemberDetail detail_heartbeat_submsg = TypeObjectUtils::build_complete_member_detail(name_heartbeat_submsg, member_ann_builtin_heartbeat_submsg, ann_custom_Submessage); + CompleteUnionMember member_heartbeat_submsg = TypeObjectUtils::build_complete_union_member(common_heartbeat_submsg, detail_heartbeat_submsg); + TypeObjectUtils::add_complete_union_member(member_seq_Submessage, member_heartbeat_submsg); + } + { + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoTimestampSubmessage", type_ids_Submessage); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + eprosima::fastdds::rtps::core::register_InfoTimestampSubmessage_type_identifier(type_ids_Submessage); + } + UnionMemberFlag member_flags_info_ts_submsg = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false); + UnionCaseLabelSeq label_seq_info_ts_submsg; + TypeObjectUtils::add_union_case_label(label_seq_info_ts_submsg, static_cast(SubmessageKind::INFO_TS)); + MemberId member_id_info_ts_submsg = 0x00000002; + bool common_info_ts_submsg_ec {false}; + CommonUnionMember common_info_ts_submsg {TypeObjectUtils::build_common_union_member(member_id_info_ts_submsg, + member_flags_info_ts_submsg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Submessage, + common_info_ts_submsg_ec), label_seq_info_ts_submsg)}; + if (!common_info_ts_submsg_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Union info_ts_submsg member TypeIdentifier inconsistent."); + return; + } + MemberName name_info_ts_submsg = "info_ts_submsg"; + eprosima::fastcdr::optional member_ann_builtin_info_ts_submsg; + ann_custom_Submessage.reset(); + CompleteMemberDetail detail_info_ts_submsg = TypeObjectUtils::build_complete_member_detail(name_info_ts_submsg, member_ann_builtin_info_ts_submsg, ann_custom_Submessage); + CompleteUnionMember member_info_ts_submsg = TypeObjectUtils::build_complete_union_member(common_info_ts_submsg, detail_info_ts_submsg); + TypeObjectUtils::add_complete_union_member(member_seq_Submessage, member_info_ts_submsg); + } + { + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoSourceSubmessage", type_ids_Submessage); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + eprosima::fastdds::rtps::core::register_InfoSourceSubmessage_type_identifier(type_ids_Submessage); + } + UnionMemberFlag member_flags_info_src_submsg = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false); + UnionCaseLabelSeq label_seq_info_src_submsg; + TypeObjectUtils::add_union_case_label(label_seq_info_src_submsg, static_cast(SubmessageKind::INFO_SRC)); + MemberId member_id_info_src_submsg = 0x00000003; + bool common_info_src_submsg_ec {false}; + CommonUnionMember common_info_src_submsg {TypeObjectUtils::build_common_union_member(member_id_info_src_submsg, + member_flags_info_src_submsg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Submessage, + common_info_src_submsg_ec), label_seq_info_src_submsg)}; + if (!common_info_src_submsg_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Union info_src_submsg member TypeIdentifier inconsistent."); + return; + } + MemberName name_info_src_submsg = "info_src_submsg"; + eprosima::fastcdr::optional member_ann_builtin_info_src_submsg; + ann_custom_Submessage.reset(); + CompleteMemberDetail detail_info_src_submsg = TypeObjectUtils::build_complete_member_detail(name_info_src_submsg, member_ann_builtin_info_src_submsg, ann_custom_Submessage); + CompleteUnionMember member_info_src_submsg = TypeObjectUtils::build_complete_union_member(common_info_src_submsg, detail_info_src_submsg); + TypeObjectUtils::add_complete_union_member(member_seq_Submessage, member_info_src_submsg); + } + { + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::InfoDestinationSubmessage", type_ids_Submessage); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + eprosima::fastdds::rtps::core::register_InfoDestinationSubmessage_type_identifier(type_ids_Submessage); + } + UnionMemberFlag member_flags_info_dst_submsg = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false); + UnionCaseLabelSeq label_seq_info_dst_submsg; + TypeObjectUtils::add_union_case_label(label_seq_info_dst_submsg, static_cast(SubmessageKind::INFO_DST)); + MemberId member_id_info_dst_submsg = 0x00000004; + bool common_info_dst_submsg_ec {false}; + CommonUnionMember common_info_dst_submsg {TypeObjectUtils::build_common_union_member(member_id_info_dst_submsg, + member_flags_info_dst_submsg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Submessage, + common_info_dst_submsg_ec), label_seq_info_dst_submsg)}; + if (!common_info_dst_submsg_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Union info_dst_submsg member TypeIdentifier inconsistent."); + return; + } + MemberName name_info_dst_submsg = "info_dst_submsg"; + eprosima::fastcdr::optional member_ann_builtin_info_dst_submsg; + ann_custom_Submessage.reset(); + CompleteMemberDetail detail_info_dst_submsg = TypeObjectUtils::build_complete_member_detail(name_info_dst_submsg, member_ann_builtin_info_dst_submsg, ann_custom_Submessage); + CompleteUnionMember member_info_dst_submsg = TypeObjectUtils::build_complete_union_member(common_info_dst_submsg, detail_info_dst_submsg); + TypeObjectUtils::add_complete_union_member(member_seq_Submessage, member_info_dst_submsg); + } + { + return_code_Submessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::SubmessageHeader", type_ids_Submessage); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Submessage) + { + eprosima::fastdds::rtps::core::register_SubmessageHeader_type_identifier(type_ids_Submessage); + } + UnionMemberFlag member_flags_unknown_submsg = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + true, false); + UnionCaseLabelSeq label_seq_unknown_submsg; + MemberId member_id_unknown_submsg = 0x00000005; + bool common_unknown_submsg_ec {false}; + CommonUnionMember common_unknown_submsg {TypeObjectUtils::build_common_union_member(member_id_unknown_submsg, + member_flags_unknown_submsg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Submessage, + common_unknown_submsg_ec), label_seq_unknown_submsg)}; + if (!common_unknown_submsg_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Union unknown_submsg member TypeIdentifier inconsistent."); + return; + } + MemberName name_unknown_submsg = "unknown_submsg"; + eprosima::fastcdr::optional member_ann_builtin_unknown_submsg; + ann_custom_Submessage.reset(); + CompleteMemberDetail detail_unknown_submsg = TypeObjectUtils::build_complete_member_detail(name_unknown_submsg, member_ann_builtin_unknown_submsg, ann_custom_Submessage); + CompleteUnionMember member_unknown_submsg = TypeObjectUtils::build_complete_union_member(common_unknown_submsg, detail_unknown_submsg); + TypeObjectUtils::add_complete_union_member(member_seq_Submessage, member_unknown_submsg); + } + CompleteUnionType union_type_Submessage = TypeObjectUtils::build_complete_union_type(union_flags_Submessage, header_Submessage, discriminator_Submessage, + member_seq_Submessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_Submessage, type_name_Submessage.to_string(), type_ids_Submessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::Submessage already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_RTPSMessage_type_identifier( + TypeIdentifierPair& type_ids_RTPSMessage) +{ + + ReturnCode_t return_code_RTPSMessage {eprosima::fastdds::dds::RETCODE_OK}; + return_code_RTPSMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::RTPSMessage", type_ids_RTPSMessage); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_RTPSMessage) + { + StructTypeFlag struct_flags_RTPSMessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_RTPSMessage = "eprosima::fastdds::rtps::core::RTPSMessage"; + eprosima::fastcdr::optional type_ann_builtin_RTPSMessage; + eprosima::fastcdr::optional ann_custom_RTPSMessage; + CompleteTypeDetail detail_RTPSMessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_RTPSMessage, ann_custom_RTPSMessage, type_name_RTPSMessage.to_string()); + CompleteStructHeader header_RTPSMessage; + header_RTPSMessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_RTPSMessage); + CompleteStructMemberSeq member_seq_RTPSMessage; + { + TypeIdentifierPair type_ids_msg_header; + ReturnCode_t return_code_msg_header {eprosima::fastdds::dds::RETCODE_OK}; + return_code_msg_header = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::Header", type_ids_msg_header); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg_header) + { + eprosima::fastdds::rtps::core::register_Header_type_identifier(type_ids_msg_header); + } + StructMemberFlag member_flags_msg_header = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_msg_header = 0x00000000; + bool common_msg_header_ec {false}; + CommonStructMember common_msg_header {TypeObjectUtils::build_common_struct_member(member_id_msg_header, member_flags_msg_header, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg_header, common_msg_header_ec))}; + if (!common_msg_header_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msg_header member TypeIdentifier inconsistent."); + return; + } + MemberName name_msg_header = "msg_header"; + eprosima::fastcdr::optional member_ann_builtin_msg_header; + ann_custom_RTPSMessage.reset(); + CompleteMemberDetail detail_msg_header = TypeObjectUtils::build_complete_member_detail(name_msg_header, member_ann_builtin_msg_header, ann_custom_RTPSMessage); + CompleteStructMember member_msg_header = TypeObjectUtils::build_complete_struct_member(common_msg_header, detail_msg_header); + TypeObjectUtils::add_complete_struct_member(member_seq_RTPSMessage, member_msg_header); + } + { + TypeIdentifierPair type_ids_submessages; + ReturnCode_t return_code_submessages {eprosima::fastdds::dds::RETCODE_OK}; + return_code_submessages = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded", type_ids_submessages); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submessages) + { + return_code_submessages = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::rtps::core::Submessage", type_ids_submessages); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_submessages) + { + eprosima::fastdds::rtps::core::register_Submessage_type_identifier(type_ids_submessages); + } + bool element_identifier_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded_ec {false}; + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submessages, element_identifier_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded_ec))}; + if (!element_identifier_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_submessages.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded); + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded", type_ids_submessages)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_rtps_core_Submessage_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_submessages = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_submessages = 0x00000001; + bool common_submessages_ec {false}; + CommonStructMember common_submessages {TypeObjectUtils::build_common_struct_member(member_id_submessages, member_flags_submessages, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_submessages, common_submessages_ec))}; + if (!common_submessages_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure submessages member TypeIdentifier inconsistent."); + return; + } + MemberName name_submessages = "submessages"; + eprosima::fastcdr::optional member_ann_builtin_submessages; + ann_custom_RTPSMessage.reset(); + CompleteMemberDetail detail_submessages = TypeObjectUtils::build_complete_member_detail(name_submessages, member_ann_builtin_submessages, ann_custom_RTPSMessage); + CompleteStructMember member_submessages = TypeObjectUtils::build_complete_struct_member(common_submessages, detail_submessages); + TypeObjectUtils::add_complete_struct_member(member_seq_RTPSMessage, member_submessages); + } + CompleteStructType struct_type_RTPSMessage = TypeObjectUtils::build_complete_struct_type(struct_flags_RTPSMessage, header_RTPSMessage, member_seq_RTPSMessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_RTPSMessage, type_name_RTPSMessage.to_string(), type_ids_RTPSMessage)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::rtps::core::RTPSMessage already registered in TypeObjectRegistry for a different type."); + } + } +} + +} // namespace core + +} // namespace rtps + +} // namespace fastdds + +} // namespace eprosima + diff --git a/test/blackbox/types/core/core_typesTypeObjectSupport.hpp b/test/blackbox/types/core/core_typesTypeObjectSupport.hpp new file mode 100644 index 00000000000..7e44c3f8d6b --- /dev/null +++ b/test/blackbox/types/core/core_typesTypeObjectSupport.hpp @@ -0,0 +1,405 @@ +// 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 core_typesTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ + +#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 + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace eprosima { +namespace fastdds { +namespace rtps { +namespace core { +namespace detail { +/** + * @brief Register EntityId_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_EntityId_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register ProtocolVersion_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_ProtocolVersion_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register VendorId_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_VendorId_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register GuidPrefix_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_GuidPrefix_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register GUID_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_GUID_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register SequenceNumber_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_SequenceNumber_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Count_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Count_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Time_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Time_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Timestamp related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Timestamp_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + + + +/** + * @brief Register SequenceNumberSet related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_SequenceNumberSet_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Locator_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Locator_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Duration_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Duration_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register DomainId_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_DomainId_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + + + +/** + * @brief Register BuiltinEndpointQos_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_BuiltinEndpointQos_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + + + +/** + * @brief Register StatusInfo_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_StatusInfo_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register KeyHash_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_KeyHash_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register EntityName_t related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_EntityName_t_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +} // namespace detail + +/** + * @brief Register Header related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Header_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register SubmessageHeader related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_SubmessageHeader_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +namespace SubmessageKind { +} // namespace SubmessageKind + +/** + * @brief Register AckNackSubmessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_AckNackSubmessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register HeartBeatSubmessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_HeartBeatSubmessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register InfoDestinationSubmessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_InfoDestinationSubmessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register InfoSourceSubmessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_InfoSourceSubmessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register InfoTimestampSubmessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_InfoTimestampSubmessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Submessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Submessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register RTPSMessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_RTPSMessage_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +} // namespace core + +} // namespace rtps + +} // namespace fastdds + +} // namespace eprosima + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_RTPS_CORE_CORE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/utils/filter_helpers.hpp b/test/blackbox/utils/filter_helpers.hpp new file mode 100644 index 00000000000..1aea5e3aef4 --- /dev/null +++ b/test/blackbox/utils/filter_helpers.hpp @@ -0,0 +1,93 @@ +// Copyright 2019, 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 "../types/core/core_typesPubSubTypes.h" + +namespace eprosima { +namespace fastdds { +namespace helpers { + +inline rtps::core::HeartBeatSubmessage cdr_parse_heartbeat_submsg( + char* serialized_buffer, + size_t length) +{ + eprosima::fastdds::rtps::core::HeartBeatSubmessage hb_submsg; + eprosima::fastcdr::FastBuffer buffer(serialized_buffer, length); + eprosima::fastcdr::Cdr cdr(buffer, + eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::XCDRv1); + cdr >> hb_submsg; + return hb_submsg; +} + +inline rtps::core::AckNackSubmessage cdr_parse_acknack_submsg( + char* serialized_buffer, + size_t length) +{ + eprosima::fastdds::rtps::core::AckNackSubmessage acknack_submsg; + eprosima::fastcdr::FastBuffer buffer(serialized_buffer, length); + eprosima::fastcdr::Cdr cdr(buffer, + eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::XCDRv1); + cdr >> acknack_submsg; + return acknack_submsg; +} + +inline uint16_t cdr_parse_u16( + char* serialized_buffer) +{ + uint16_t u16; + eprosima::fastcdr::FastBuffer buffer(serialized_buffer, 2); + eprosima::fastcdr::Cdr cdr(buffer, + eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::XCDRv1); + cdr >> u16; + return u16; +} + +inline uint32_t cdr_parse_u32( + char* serialized_buffer) +{ + uint32_t u32; + eprosima::fastcdr::FastBuffer buffer(serialized_buffer, 4); + eprosima::fastcdr::Cdr cdr(buffer, + eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::XCDRv1); + cdr >> u32; + return u32; +} + +inline fastdds::rtps::EntityId_t cdr_parse_entity_id( + char* serialized_buffer) +{ + fastdds::rtps::EntityId_t entity_id; + eprosima::fastcdr::FastBuffer buffer(serialized_buffer, 4); + eprosima::fastcdr::Cdr cdr(buffer, + eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::XCDRv1); + std::array array; + cdr >> array; + memcpy(entity_id.value, array.data(), 4); + return entity_id; +} + +} // namespace helpers +} // namespace fastdds +} // namespace eprosima diff --git a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp index cb370da8654..241429e361c 100644 --- a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp +++ b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp @@ -203,6 +203,7 @@ class RTPSStatisticsTestsImpl fastdds::rtps::RTPSParticipant* participant_ = nullptr; fastdds::rtps::RTPSWriter* writer_ = nullptr; fastdds::rtps::RTPSReader* reader_ = nullptr; + std::shared_ptr test_transport_descriptor_; // Getters and setters for the transport filter using filter = fastdds::rtps::test_UDPv4TransportDescriptor::filter; @@ -239,17 +240,17 @@ class RTPSStatisticsTestsImpl // use leaky transport // as filter use a fixture provided functor - auto descriptor = std::make_shared(); + test_transport_descriptor_ = std::make_shared(); // initialize filters - descriptor->drop_data_messages_filter_ = std::ref(filters_[DATA]); - descriptor->drop_heartbeat_messages_filter_ = std::ref(filters_[HEARTBEAT]); - descriptor->drop_ack_nack_messages_filter_ = std::ref(filters_[ACKNACK]); - descriptor->drop_gap_messages_filter_ = std::ref(filters_[GAP]); - descriptor->drop_data_frag_messages_filter_ = std::ref(filters_[DATA_FRAG]); + test_transport_descriptor_->drop_data_messages_filter_ = std::ref(filters_[DATA]); + test_transport_descriptor_->drop_heartbeat_messages_filter_ = std::ref(filters_[HEARTBEAT]); + test_transport_descriptor_->drop_ack_nack_messages_filter_ = std::ref(filters_[ACKNACK]); + test_transport_descriptor_->drop_gap_messages_filter_ = std::ref(filters_[GAP]); + test_transport_descriptor_->drop_data_frag_messages_filter_ = std::ref(filters_[DATA_FRAG]); p_attr.useBuiltinTransports = false; - p_attr.userTransports.push_back(descriptor); + p_attr.userTransports.push_back(test_transport_descriptor_); // random domain_id #if defined(__cplusplus_winrt) @@ -1283,8 +1284,6 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_unordered_datagrams) using namespace fastdds::rtps; using namespace std; - using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; - constexpr uint16_t num_messages = 10; constexpr std::array message_order { 2, 5, 1, 3, 4, 7, 8, 6, 9, 0 @@ -1310,7 +1309,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_unordered_datagrams) }; // A filter to add the first `num_messages` user DATA_FRAG into `user_data` - test_UDPv4Transport::test_UDPv4Transport_DropLogLength = num_messages; + test_transport_descriptor_->test_transport_options->test_UDPv4Transport_DropLogLength = num_messages; set_transport_filter( DATA_FRAG, [](fastdds::rtps::CDRMessage_t& msg)-> bool @@ -1375,7 +1374,8 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_unordered_datagrams) // Send messages in different order for (size_t idx : message_order) { - const std::vector& msg = test_UDPv4Transport::test_UDPv4Transport_DropLog[idx]; + const std::vector& msg = + test_transport_descriptor_->test_transport_options->test_UDPv4Transport_DropLog[idx]; EXPECT_EQ(msg.size(), sender.send_to(asio::buffer(msg.data(), msg.size()), destination, 0, ec)) << ec; } diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh index 71e7868bfb2..3ad1063362e 100755 --- a/utils/scripts/update_generated_code_from_idl.sh +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -41,6 +41,7 @@ files_needing_output_dir=( './thirdparty/dds-types-test/IDL/strings.idl|../../../test/dds-types-test' './thirdparty/dds-types-test/IDL/structures.idl|../../../test/dds-types-test' './thirdparty/dds-types-test/IDL/unions.idl|../../../test/dds-types-test' + './test/blackbox/types/core/core_types.idl|.' ) files_needing_no_typesupport=( diff --git a/versions.md b/versions.md index 455d062c479..fdc01095e6b 100644 --- a/versions.md +++ b/versions.md @@ -61,6 +61,8 @@ Forthcoming * Migrate fastrtps `ResourceManagement` API from `rtps/resources` to `rtps/attributes`. * `const` qualify all data related inputs in DataWriter APIs * New `DomainParticipantExtendedQos` that includes both `DomainId` and `DomainParticipantQos` (extends `DomainParticipantFactory` API). +* Make Blackbox tests not include any private API. +* Remove all the private API include from Blackbox tests. Version 2.14.0 --------------