From 1ffe2361200f968645fd9b1cdd130babff15784a Mon Sep 17 00:00:00 2001 From: JLBuenoLopez-eProsima Date: Wed, 13 Sep 2023 14:24:48 +0200 Subject: [PATCH 1/3] Refs #19453: regenerate types using Fast DDS-Gen v3.0.0. Fix types related with Bitmask Signed-off-by: JLBuenoLopez-eProsima --- examples/cpp/HelloWorldExample/HelloWorld.cxx | 81 +- examples/cpp/HelloWorldExample/HelloWorld.h | 78 +- .../HelloWorldExample/HelloWorldCdrAux.hpp | 45 + .../HelloWorldExample/HelloWorldCdrAux.ipp | 126 + .../HelloWorldPubSubTypes.cxx | 57 +- .../HelloWorldExample/HelloWorldPubSubTypes.h | 42 +- src/cpp/database/database_queue.hpp | 2 +- src/cpp/topic_types/types.cxx | 2290 +++++------------ src/cpp/topic_types/types.h | 944 +------ src/cpp/topic_types/typesCdrAux.hpp | 144 ++ src/cpp/topic_types/typesCdrAux.ipp | 1561 +++++++++++ src/cpp/topic_types/typesPubSubTypes.cxx | 733 ++++-- src/cpp/topic_types/typesPubSubTypes.h | 1097 +++++--- test/TrafficInjector/TrafficInjector.h | 2 +- .../fastdds/dds/subscriber/DataReader.hpp | 2 +- .../DatabaseQueue/DatabaseQueueTests.cpp | 94 +- .../StatisticsReaderListenerTests.cpp | 34 +- 17 files changed, 3907 insertions(+), 3425 deletions(-) create mode 100644 examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp create mode 100644 examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp create mode 100644 src/cpp/topic_types/typesCdrAux.hpp create mode 100644 src/cpp/topic_types/typesCdrAux.ipp diff --git a/examples/cpp/HelloWorldExample/HelloWorld.cxx b/examples/cpp/HelloWorldExample/HelloWorld.cxx index ab32433c3..bcda56fb4 100644 --- a/examples/cpp/HelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/HelloWorldExample/HelloWorld.cxx @@ -14,9 +14,9 @@ /*! * @file HelloWorld.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifdef _WIN32 @@ -29,27 +29,20 @@ char dummy; #include "HelloWorld.h" #include + #include using namespace eprosima::fastcdr::exception; #include -#define HelloWorld_max_cdr_typesize 264ULL; -#define HelloWorld_max_key_cdr_typesize 0ULL; HelloWorld::HelloWorld() { - // unsigned long m_index - m_index = 0; - // string m_message - m_message =""; } HelloWorld::~HelloWorld() { - - } HelloWorld::HelloWorld( @@ -60,7 +53,7 @@ HelloWorld::HelloWorld( } HelloWorld::HelloWorld( - HelloWorld&& x) noexcept + HelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -89,8 +82,8 @@ HelloWorld& HelloWorld::operator =( bool HelloWorld::operator ==( const HelloWorld& x) const { - - return (m_index == x.m_index && m_message == x.m_message); + return (m_index == x.m_index && + m_message == x.m_message); } bool HelloWorld::operator !=( @@ -99,47 +92,6 @@ bool HelloWorld::operator !=( return !(*this == x); } -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_index; - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_index; - dcdr >> m_message; -} - /*! * @brief This function sets a value in member index * @param _index New value for member index @@ -168,6 +120,7 @@ uint32_t& HelloWorld::index() return m_index; } + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message @@ -207,21 +160,5 @@ std::string& HelloWorld::message() } -size_t HelloWorld::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_key_cdr_typesize; -} - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/HelloWorldExample/HelloWorld.h b/examples/cpp/HelloWorldExample/HelloWorld.h index f26341d40..0c6d09801 100644 --- a/examples/cpp/HelloWorldExample/HelloWorld.h +++ b/examples/cpp/HelloWorldExample/HelloWorld.h @@ -16,21 +16,23 @@ * @file HelloWorld.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,10 +61,12 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -142,6 +146,7 @@ class HelloWorld */ eProsima_user_DllExport uint32_t& index(); + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message @@ -168,66 +173,9 @@ class HelloWorld */ eProsima_user_DllExport std::string& message(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - uint32_t m_index; + uint32_t m_index{0}; std::string m_message; }; diff --git a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp new file mode 100644 index 000000000..cf39bf783 --- /dev/null +++ b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp @@ -0,0 +1,45 @@ +// 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 HelloWorldCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + +#include "HelloWorld.h" + +constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; +constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file diff --git a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp new file mode 100644 index 000000000..b9461ff5b --- /dev/null +++ b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp @@ -0,0 +1,126 @@ +// 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 HelloWorldCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + +#include "HelloWorldCdrAux.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 HelloWorld& data, + size_t& current_alignment) +{ + 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.index(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message(), 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 HelloWorld& data) +{ + 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.index() + << eprosima::fastcdr::MemberId(1) << data.message() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + HelloWorld& data) +{ + 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.index(); + break; + + case 1: + dcdr >> data.message(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data) +{ + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file diff --git a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx index c2a00dd2a..f4a5ef511 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -16,27 +16,29 @@ * @file HelloWorldPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #include #include +#include #include "HelloWorldPubSubTypes.h" +#include "HelloWorldCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - auto type_size = HelloWorld::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HelloWorld::isKeyDefined(); - size_t keyLength = HelloWorld::getKeyMaxCdrSerializedSize() > 16 ? - HelloWorld::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = HelloWorld_max_cdr_typesize; + 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 = HelloWorld_max_key_cdr_typesize > 16 ? HelloWorld_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -51,22 +53,29 @@ HelloWorldPubSubType::~HelloWorldPubSubType() bool HelloWorldPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { HelloWorld* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -74,7 +83,7 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -91,14 +100,14 @@ bool HelloWorldPubSubType::deserialize( 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -109,12 +118,18 @@ bool HelloWorldPubSubType::deserialize( } std::function HelloWorldPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -143,15 +158,15 @@ bool HelloWorldPubSubType::getKey( // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HelloWorld::getKeyMaxCdrSerializedSize()); + HelloWorld_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HelloWorld::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h index 43d91da18..5b325dd1c 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h @@ -16,20 +16,23 @@ * @file HelloWorldPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ +#include #include +#include +#include #include #include "HelloWorld.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HelloWorld is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER @@ -47,27 +50,42 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport HelloWorldPubSubType(); - eProsima_user_DllExport virtual ~HelloWorldPubSubType() override; + eProsima_user_DllExport ~HelloWorldPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -90,7 +108,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } diff --git a/src/cpp/database/database_queue.hpp b/src/cpp/database/database_queue.hpp index 92352059a..d3f2cf445 100644 --- a/src/cpp/database/database_queue.hpp +++ b/src/cpp/database/database_queue.hpp @@ -55,7 +55,7 @@ class DatabaseQueue public: using StatisticsData = eprosima::fastdds::statistics::Data; - using StatisticsEventKind = eprosima::fastdds::statistics::EventKind; + using StatisticsEventKind = eprosima::fastdds::statistics::EventKindBits; using StatisticsWriterReaderData = eprosima::fastdds::statistics::WriterReaderData; using StatisticsLocator2LocatorData = eprosima::fastdds::statistics::Locator2LocatorData; diff --git a/src/cpp/topic_types/types.cxx b/src/cpp/topic_types/types.cxx index e30983aa5..bf6b1c9ee 100644 --- a/src/cpp/topic_types/types.cxx +++ b/src/cpp/topic_types/types.cxx @@ -14,9 +14,9 @@ /*! * @file types.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifdef _WIN32 @@ -29,48 +29,15 @@ char dummy; #include "types.h" #include + #include using namespace eprosima::fastcdr::exception; #include -#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 820ULL; -#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 796ULL; - -#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 24ULL; - -#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 12ULL; -#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 24ULL; -#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 20ULL; -#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 58ULL; -#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 4ULL; -#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 24ULL; -#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 36ULL; -#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 32ULL; -#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 52ULL; -#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 8ULL; -#define eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize 32ULL; -#define eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize 16ULL; - -#define eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize 0ULL; - -#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize 0ULL; -#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize 0ULL; -#define eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize 40ULL; -#define eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize 0ULL; -#define eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize 32ULL; -#define eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize 24ULL; -#define eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize 48ULL; -#define eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize 0ULL; -#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize 0ULL; eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s() { - // octet m_value - memset(&m_value, 0, (4) * 1); } @@ -85,7 +52,7 @@ eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( } eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( - EntityId_s&& x) noexcept + EntityId_s&& x) noexcept { m_value = std::move(x.m_value); } @@ -111,7 +78,6 @@ eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics bool eprosima::fastdds::statistics::detail::EntityId_s::operator ==( const EntityId_s& x) const { - return (m_value == x.m_value); } @@ -121,43 +87,6 @@ bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::EntityId_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::EntityId_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::EntityId_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - - -} - -void eprosima::fastdds::statistics::detail::EntityId_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value @@ -197,29 +126,8 @@ std::array& eprosima::fastdds::statistics::detail::EntityId_s::value } -size_t eprosima::fastdds::statistics::detail::EntityId_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::EntityId_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::EntityId_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s() { - // octet m_value - memset(&m_value, 0, (12) * 1); } @@ -234,7 +142,7 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( } eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept + GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); } @@ -260,7 +168,6 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statisti bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator ==( const GuidPrefix_s& x) const { - return (m_value == x.m_value); } @@ -270,43 +177,6 @@ bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += ((12) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::GuidPrefix_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - - -} - -void eprosima::fastdds::statistics::detail::GuidPrefix_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value @@ -346,38 +216,13 @@ std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::va } -size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::GuidPrefix_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::GuidPrefix_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::detail::GUID_s::GUID_s() { - // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix - - // eprosima::fastdds::statistics::detail::EntityId_s m_entityId - } eprosima::fastdds::statistics::detail::GUID_s::~GUID_s() { - - } eprosima::fastdds::statistics::detail::GUID_s::GUID_s( @@ -388,7 +233,7 @@ eprosima::fastdds::statistics::detail::GUID_s::GUID_s( } eprosima::fastdds::statistics::detail::GUID_s::GUID_s( - GUID_s&& x) noexcept + GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); @@ -417,8 +262,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::de bool eprosima::fastdds::statistics::detail::GUID_s::operator ==( const GUID_s& x) const { - - return (m_guidPrefix == x.m_guidPrefix && m_entityId == x.m_entityId); + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); } bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( @@ -427,44 +272,6 @@ bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GUID_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize(data.guidPrefix(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize(data.entityId(), current_alignment); - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::GUID_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_guidPrefix; - scdr << m_entityId; - -} - -void eprosima::fastdds::statistics::detail::GUID_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_guidPrefix; - dcdr >> m_entityId; -} - /*! * @brief This function copies the value in member guidPrefix * @param _guidPrefix New value to be copied in member guidPrefix @@ -502,6 +309,8 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statisti { return m_guidPrefix; } + + /*! * @brief This function copies the value in member entityId * @param _entityId New value to be copied in member entityId @@ -541,38 +350,13 @@ eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics } -size_t eprosima::fastdds::statistics::detail::GUID_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::GUID_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::GUID_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s() { - // long m_high - m_high = 0; - // unsigned long m_low - m_low = 0; } eprosima::fastdds::statistics::detail::SequenceNumber_s::~SequenceNumber_s() { - - } eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( @@ -583,7 +367,7 @@ eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( } eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept + SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; @@ -612,8 +396,8 @@ eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::stat bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator ==( const SequenceNumber_s& x) const { - - return (m_high == x.m_high && m_low == x.m_low); + return (m_high == x.m_high && + m_low == x.m_low); } bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( @@ -622,48 +406,6 @@ bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::SequenceNumber_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_high; - scdr << m_low; - -} - -void eprosima::fastdds::statistics::detail::SequenceNumber_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_high; - dcdr >> m_low; -} - /*! * @brief This function sets a value in member high * @param _high New value for member high @@ -692,6 +434,7 @@ int32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::high() return m_high; } + /*! * @brief This function sets a value in member low * @param _low New value for member low @@ -721,39 +464,13 @@ uint32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::low() } - -size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::SequenceNumber_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::SequenceNumber_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s() { - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number - } eprosima::fastdds::statistics::detail::SampleIdentity_s::~SampleIdentity_s() { - - } eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( @@ -764,7 +481,7 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( } eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept + SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); @@ -793,8 +510,8 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::stat bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator ==( const SampleIdentity_s& x) const { - - return (m_writer_guid == x.m_writer_guid && m_sequence_number == x.m_sequence_number); + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); } bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( @@ -803,44 +520,6 @@ bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize(data.sequence_number(), current_alignment); - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::SampleIdentity_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_writer_guid; - scdr << m_sequence_number; - -} - -void eprosima::fastdds::statistics::detail::SampleIdentity_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_writer_guid; - dcdr >> m_sequence_number; -} - /*! * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid @@ -878,6 +557,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::de { return m_writer_guid; } + + /*! * @brief This function copies the value in member sequence_number * @param _sequence_number New value to be copied in member sequence_number @@ -917,41 +598,13 @@ eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::stat } -size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::SampleIdentity_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::SampleIdentity_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::detail::Locator_s::Locator_s() { - // long m_kind - m_kind = 0; - // unsigned long m_port - m_port = 0; - // octet m_address - memset(&m_address, 0, (16) * 1); } eprosima::fastdds::statistics::detail::Locator_s::~Locator_s() { - - - } eprosima::fastdds::statistics::detail::Locator_s::Locator_s( @@ -963,7 +616,7 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( } eprosima::fastdds::statistics::detail::Locator_s::Locator_s( - Locator_s&& x) noexcept + Locator_s&& x) noexcept { m_kind = x.m_kind; m_port = x.m_port; @@ -995,8 +648,9 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: bool eprosima::fastdds::statistics::detail::Locator_s::operator ==( const Locator_s& x) const { - - return (m_kind == x.m_kind && m_port == x.m_port && m_address == x.m_address); + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); } bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( @@ -1005,54 +659,6 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::Locator_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((16) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::detail::Locator_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_kind; - scdr << m_port; - scdr << m_address; - - -} - -void eprosima::fastdds::statistics::detail::Locator_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_kind; - dcdr >> m_port; - dcdr >> m_address; - -} - /*! * @brief This function sets a value in member kind * @param _kind New value for member kind @@ -1081,6 +687,7 @@ int32_t& eprosima::fastdds::statistics::detail::Locator_s::kind() return m_kind; } + /*! * @brief This function sets a value in member port * @param _port New value for member port @@ -1109,6 +716,7 @@ uint32_t& eprosima::fastdds::statistics::detail::Locator_s::port() return m_port; } + /*! * @brief This function copies the value in member address * @param _address New value to be copied in member address @@ -1148,51 +756,14 @@ std::array& eprosima::fastdds::statistics::detail::Locator_s::addre } -size_t eprosima::fastdds::statistics::detail::Locator_s::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::detail::Locator_s::isKeyDefined() -{ - return false; -} - -void eprosima::fastdds::statistics::detail::Locator_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime() { - // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid - - // unsigned long long m_time - m_time = 0; - // string m_host - m_host =""; - // string m_user - m_user =""; - // string m_process - m_process =""; } eprosima::fastdds::statistics::DiscoveryTime::~DiscoveryTime() { - - - - - - } eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( @@ -1207,7 +778,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( } eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept + DiscoveryTime&& x) noexcept { m_local_participant_guid = std::move(x.m_local_participant_guid); m_remote_entity_guid = std::move(x.m_remote_entity_guid); @@ -1248,8 +819,12 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dis bool eprosima::fastdds::statistics::DiscoveryTime::operator ==( const DiscoveryTime& x) const { - - return (m_local_participant_guid == x.m_local_participant_guid && m_remote_entity_guid == x.m_remote_entity_guid && m_time == x.m_time && m_host == x.m_host && m_user == x.m_user && m_process == x.m_process); + return (m_local_participant_guid == x.m_local_participant_guid && + m_remote_entity_guid == x.m_remote_entity_guid && + m_time == x.m_time && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); } bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( @@ -1258,61 +833,6 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::DiscoveryTime::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize( - const eprosima::fastdds::statistics::DiscoveryTime& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_participant_guid(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.remote_entity_guid(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::DiscoveryTime::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_local_participant_guid; - scdr << m_remote_entity_guid; - scdr << m_time; - scdr << m_host.c_str(); - scdr << m_user.c_str(); - scdr << m_process.c_str(); - -} - -void eprosima::fastdds::statistics::DiscoveryTime::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_local_participant_guid; - dcdr >> m_remote_entity_guid; - dcdr >> m_time; - dcdr >> m_host; - dcdr >> m_user; - dcdr >> m_process; -} - /*! * @brief This function copies the value in member local_participant_guid * @param _local_participant_guid New value to be copied in member local_participant_guid @@ -1350,6 +870,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di { return m_local_participant_guid; } + + /*! * @brief This function copies the value in member remote_entity_guid * @param _remote_entity_guid New value to be copied in member remote_entity_guid @@ -1387,6 +909,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di { return m_remote_entity_guid; } + + /*! * @brief This function sets a value in member time * @param _time New value for member time @@ -1415,6 +939,7 @@ uint64_t& eprosima::fastdds::statistics::DiscoveryTime::time() return m_time; } + /*! * @brief This function copies the value in member host * @param _host New value to be copied in member host @@ -1452,6 +977,8 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::host() { return m_host; } + + /*! * @brief This function copies the value in member user * @param _user New value to be copied in member user @@ -1489,6 +1016,8 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::user() { return m_user; } + + /*! * @brief This function copies the value in member process * @param _process New value to be copied in member process @@ -1528,44 +1057,13 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::process() } -size_t eprosima::fastdds::statistics::DiscoveryTime::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::DiscoveryTime::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::DiscoveryTime::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_local_participant_guid.serialize(scdr); - m_remote_entity_guid.serialize(scdr); - - - - -} - - eprosima::fastdds::statistics::EntityCount::EntityCount() { - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // unsigned long long m_count - m_count = 0; } eprosima::fastdds::statistics::EntityCount::~EntityCount() { - - } eprosima::fastdds::statistics::EntityCount::EntityCount( @@ -1576,7 +1074,7 @@ eprosima::fastdds::statistics::EntityCount::EntityCount( } eprosima::fastdds::statistics::EntityCount::EntityCount( - EntityCount&& x) noexcept + EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; @@ -1605,8 +1103,8 @@ eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Entit bool eprosima::fastdds::statistics::EntityCount::operator ==( const EntityCount& x) const { - - return (m_guid == x.m_guid && m_count == x.m_count); + return (m_guid == x.m_guid && + m_count == x.m_count); } bool eprosima::fastdds::statistics::EntityCount::operator !=( @@ -1615,46 +1113,6 @@ bool eprosima::fastdds::statistics::EntityCount::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::EntityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::EntityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_guid; - scdr << m_count; - -} - -void eprosima::fastdds::statistics::EntityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_guid; - dcdr >> m_count; -} - /*! * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid @@ -1692,6 +1150,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En { return m_guid; } + + /*! * @brief This function sets a value in member count * @param _count New value for member count @@ -1721,41 +1181,13 @@ uint64_t& eprosima::fastdds::statistics::EntityCount::count() } - -size_t eprosima::fastdds::statistics::EntityCount::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::EntityCount::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::EntityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - - eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount() { - // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id - - // unsigned long long m_count - m_count = 0; } eprosima::fastdds::statistics::SampleIdentityCount::~SampleIdentityCount() { - - } eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( @@ -1766,7 +1198,7 @@ eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( } eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept + SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; @@ -1795,8 +1227,8 @@ eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistic bool eprosima::fastdds::statistics::SampleIdentityCount::operator ==( const SampleIdentityCount& x) const { - - return (m_sample_id == x.m_sample_id && m_count == x.m_count); + return (m_sample_id == x.m_sample_id && + m_count == x.m_count); } bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( @@ -1805,46 +1237,6 @@ bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::SampleIdentityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize( - const eprosima::fastdds::statistics::SampleIdentityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize(data.sample_id(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::SampleIdentityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_sample_id; - scdr << m_count; - -} - -void eprosima::fastdds::statistics::SampleIdentityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_sample_id; - dcdr >> m_count; -} - /*! * @brief This function copies the value in member sample_id * @param _sample_id New value to be copied in member sample_id @@ -1882,6 +1274,8 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::stat { return m_sample_id; } + + /*! * @brief This function sets a value in member count * @param _count New value for member count @@ -1911,50 +1305,13 @@ uint64_t& eprosima::fastdds::statistics::SampleIdentityCount::count() } - -size_t eprosima::fastdds::statistics::SampleIdentityCount::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::SampleIdentityCount::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::SampleIdentityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_sample_id.serialize(scdr); - -} - - eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic() { - // eprosima::fastdds::statistics::detail::GUID_s m_src_guid - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // unsigned long long m_packet_count - m_packet_count = 0; - // unsigned long long m_byte_count - m_byte_count = 0; - // short m_byte_magnitude_order - m_byte_magnitude_order = 0; } eprosima::fastdds::statistics::Entity2LocatorTraffic::~Entity2LocatorTraffic() { - - - - - } eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( @@ -1968,7 +1325,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( } eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept + Entity2LocatorTraffic&& x) noexcept { m_src_guid = std::move(x.m_src_guid); m_dst_locator = std::move(x.m_dst_locator); @@ -2006,8 +1363,11 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator ==( const Entity2LocatorTraffic& x) const { - - return (m_src_guid == x.m_src_guid && m_dst_locator == x.m_dst_locator && m_packet_count == x.m_packet_count && m_byte_count == x.m_byte_count && m_byte_magnitude_order == x.m_byte_magnitude_order); + return (m_src_guid == x.m_src_guid && + m_dst_locator == x.m_dst_locator && + m_packet_count == x.m_packet_count && + m_byte_count == x.m_byte_count && + m_byte_magnitude_order == x.m_byte_magnitude_order); } bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( @@ -2016,59 +1376,6 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.src_guid(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::Entity2LocatorTraffic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_src_guid; - scdr << m_dst_locator; - scdr << m_packet_count; - scdr << m_byte_count; - scdr << m_byte_magnitude_order; - -} - -void eprosima::fastdds::statistics::Entity2LocatorTraffic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_src_guid; - dcdr >> m_dst_locator; - dcdr >> m_packet_count; - dcdr >> m_byte_count; - dcdr >> m_byte_magnitude_order; -} - /*! * @brief This function copies the value in member src_guid * @param _src_guid New value to be copied in member src_guid @@ -2106,6 +1413,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En { return m_src_guid; } + + /*! * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator @@ -2143,6 +1452,8 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: { return m_dst_locator; } + + /*! * @brief This function sets a value in member packet_count * @param _packet_count New value for member packet_count @@ -2171,6 +1482,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() return m_packet_count; } + /*! * @brief This function sets a value in member byte_count * @param _byte_count New value for member byte_count @@ -2199,6 +1511,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() return m_byte_count; } + /*! * @brief This function sets a value in member byte_magnitude_order * @param _byte_magnitude_order New value for member byte_magnitude_order @@ -2228,47 +1541,13 @@ int16_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_or } - -size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::Entity2LocatorTraffic::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::Entity2LocatorTraffic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_guid.serialize(scdr); - m_dst_locator.serialize(scdr); - - - -} - - eprosima::fastdds::statistics::WriterReaderData::WriterReaderData() { - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid - - // float m_data - m_data = 0.0; } eprosima::fastdds::statistics::WriterReaderData::~WriterReaderData() { - - - } eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( @@ -2280,7 +1559,7 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( } eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept + WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_reader_guid = std::move(x.m_reader_guid); @@ -2312,8 +1591,9 @@ eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics:: bool eprosima::fastdds::statistics::WriterReaderData::operator ==( const WriterReaderData& x) const { - - return (m_writer_guid == x.m_writer_guid && m_reader_guid == x.m_reader_guid && m_data == x.m_data); + return (m_writer_guid == x.m_writer_guid && + m_reader_guid == x.m_reader_guid && + m_data == x.m_data); } bool eprosima::fastdds::statistics::WriterReaderData::operator !=( @@ -2322,49 +1602,6 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::WriterReaderData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize( - const eprosima::fastdds::statistics::WriterReaderData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.reader_guid(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::WriterReaderData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_writer_guid; - scdr << m_reader_guid; - scdr << m_data; - -} - -void eprosima::fastdds::statistics::WriterReaderData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_writer_guid; - dcdr >> m_reader_guid; - dcdr >> m_data; -} - /*! * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid @@ -2402,6 +1639,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr { return m_writer_guid; } + + /*! * @brief This function copies the value in member reader_guid * @param _reader_guid New value to be copied in member reader_guid @@ -2439,6 +1678,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr { return m_reader_guid; } + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2468,45 +1709,13 @@ float& eprosima::fastdds::statistics::WriterReaderData::data() } - -size_t eprosima::fastdds::statistics::WriterReaderData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::WriterReaderData::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::WriterReaderData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_writer_guid.serialize(scdr); - m_reader_guid.serialize(scdr); - -} - - eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData() { - // eprosima::fastdds::statistics::detail::Locator_s m_src_locator - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // float m_data - m_data = 0.0; } eprosima::fastdds::statistics::Locator2LocatorData::~Locator2LocatorData() { - - - } eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( @@ -2518,7 +1727,7 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( } eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept + Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); m_dst_locator = std::move(x.m_dst_locator); @@ -2550,8 +1759,9 @@ eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistic bool eprosima::fastdds::statistics::Locator2LocatorData::operator ==( const Locator2LocatorData& x) const { - - return (m_src_locator == x.m_src_locator && m_dst_locator == x.m_dst_locator && m_data == x.m_data); + return (m_src_locator == x.m_src_locator && + m_dst_locator == x.m_dst_locator && + m_data == x.m_data); } bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( @@ -2560,49 +1770,6 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::Locator2LocatorData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize( - const eprosima::fastdds::statistics::Locator2LocatorData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.src_locator(), current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::Locator2LocatorData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_src_locator; - scdr << m_dst_locator; - scdr << m_data; - -} - -void eprosima::fastdds::statistics::Locator2LocatorData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_src_locator; - dcdr >> m_dst_locator; - dcdr >> m_data; -} - /*! * @brief This function copies the value in member src_locator * @param _src_locator New value to be copied in member src_locator @@ -2640,6 +1807,8 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: { return m_src_locator; } + + /*! * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator @@ -2677,6 +1846,8 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: { return m_dst_locator; } + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2706,42 +1877,13 @@ float& eprosima::fastdds::statistics::Locator2LocatorData::data() } - -size_t eprosima::fastdds::statistics::Locator2LocatorData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::Locator2LocatorData::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::Locator2LocatorData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_locator.serialize(scdr); - m_dst_locator.serialize(scdr); - -} - - eprosima::fastdds::statistics::EntityData::EntityData() { - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // float m_data - m_data = 0.0; } eprosima::fastdds::statistics::EntityData::~EntityData() { - - } eprosima::fastdds::statistics::EntityData::EntityData( @@ -2752,7 +1894,7 @@ eprosima::fastdds::statistics::EntityData::EntityData( } eprosima::fastdds::statistics::EntityData::EntityData( - EntityData&& x) noexcept + EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; @@ -2781,8 +1923,8 @@ eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Entity bool eprosima::fastdds::statistics::EntityData::operator ==( const EntityData& x) const { - - return (m_guid == x.m_guid && m_data == x.m_data); + return (m_guid == x.m_guid && + m_data == x.m_data); } bool eprosima::fastdds::statistics::EntityData::operator !=( @@ -2791,46 +1933,6 @@ bool eprosima::fastdds::statistics::EntityData::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::EntityData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::EntityData::getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::EntityData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_guid; - scdr << m_data; - -} - -void eprosima::fastdds::statistics::EntityData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_guid; - dcdr >> m_data; -} - /*! * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid @@ -2868,6 +1970,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En { return m_guid; } + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2897,47 +2001,13 @@ float& eprosima::fastdds::statistics::EntityData::data() } - -size_t eprosima::fastdds::statistics::EntityData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize; -} - -bool eprosima::fastdds::statistics::EntityData::isKeyDefined() -{ - return true; -} - -void eprosima::fastdds::statistics::EntityData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - - eprosima::fastdds::statistics::PhysicalData::PhysicalData() { - // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid - - // string m_host - m_host =""; - // string m_user - m_user =""; - // string m_process - m_process =""; } eprosima::fastdds::statistics::PhysicalData::~PhysicalData() { - - - - } eprosima::fastdds::statistics::PhysicalData::PhysicalData( @@ -2950,7 +2020,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( } eprosima::fastdds::statistics::PhysicalData::PhysicalData( - PhysicalData&& x) noexcept + PhysicalData&& x) noexcept { m_participant_guid = std::move(x.m_participant_guid); m_host = std::move(x.m_host); @@ -2985,8 +2055,10 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Phys bool eprosima::fastdds::statistics::PhysicalData::operator ==( const PhysicalData& x) const { - - return (m_participant_guid == x.m_participant_guid && m_host == x.m_host && m_user == x.m_user && m_process == x.m_process); + return (m_participant_guid == x.m_participant_guid && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); } bool eprosima::fastdds::statistics::PhysicalData::operator !=( @@ -2995,53 +2067,6 @@ bool eprosima::fastdds::statistics::PhysicalData::operator !=( return !(*this == x); } -size_t eprosima::fastdds::statistics::PhysicalData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; -} - -size_t eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize( - const eprosima::fastdds::statistics::PhysicalData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.participant_guid(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::PhysicalData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_participant_guid; - scdr << m_host.c_str(); - scdr << m_user.c_str(); - scdr << m_process.c_str(); - -} - -void eprosima::fastdds::statistics::PhysicalData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_participant_guid; - dcdr >> m_host; - dcdr >> m_user; - dcdr >> m_process; -} - /*! * @brief This function copies the value in member participant_guid * @param _participant_guid New value to be copied in member participant_guid @@ -3079,6 +2104,8 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Ph { return m_participant_guid; } + + /*! * @brief This function copies the value in member host * @param _host New value to be copied in member host @@ -3116,6 +2143,8 @@ std::string& eprosima::fastdds::statistics::PhysicalData::host() { return m_host; } + + /*! * @brief This function copies the value in member user * @param _user New value to be copied in member user @@ -3153,6 +2182,8 @@ std::string& eprosima::fastdds::statistics::PhysicalData::user() { return m_user; } + + /*! * @brief This function copies the value in member process * @param _process New value to be copied in member process @@ -3192,97 +2223,73 @@ std::string& eprosima::fastdds::statistics::PhysicalData::process() } -size_t eprosima::fastdds::statistics::PhysicalData::getKeyMaxCdrSerializedSize( - size_t current_alignment) + +eprosima::fastdds::statistics::Data::Data() { - static_cast(current_alignment); - return eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize; + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; } -bool eprosima::fastdds::statistics::PhysicalData::isKeyDefined() +eprosima::fastdds::statistics::Data::~Data() { - return true; } -void eprosima::fastdds::statistics::PhysicalData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const +eprosima::fastdds::statistics::Data::Data( + const Data& x) { - (void) scdr; - m_participant_guid.serialize(scdr); - - - -} + m__d = x.m__d; + switch (m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; -eprosima::fastdds::statistics::Data::Data() -{ - m__d = HISTORY2HISTORY_LATENCY; - // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; - // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data - // eprosima::fastdds::statistics::EntityData m_entity_data + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; - // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic - // eprosima::fastdds::statistics::EntityCount m_entity_count + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; - // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time - // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; - // eprosima::fastdds::statistics::PhysicalData m_physical_data -} + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; -eprosima::fastdds::statistics::Data::~Data() -{ -} -eprosima::fastdds::statistics::Data::Data( - const Data& x) -{ - m__d = x.m__d; + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; - switch(m__d) - { - case HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - case NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - case RTPS_SENT: - case RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - case DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - case SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - case PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; default: - break; + break; } } @@ -3291,43 +2298,66 @@ eprosima::fastdds::statistics::Data::Data( { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - break; - case NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - break; - case RTPS_SENT: - case RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - break; - case DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - break; - case SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - break; - case PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - break; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + default: - break; + break; } } @@ -3336,43 +2366,58 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - case NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - case RTPS_SENT: - case RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - case DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - case SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - case PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; + default: - break; + break; } return *this; @@ -3383,43 +2428,66 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - break; - case NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - break; - case RTPS_SENT: - case RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - break; - case DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - break; - case SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - break; - case PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - break; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + default: - break; + break; } return *this; @@ -3433,43 +2501,58 @@ bool eprosima::fastdds::statistics::Data::operator ==( return false; } - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: return (m_writer_reader_data == x.m_writer_reader_data); break; - case NETWORK_LATENCY: + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: return (m_locator2locator_data == x.m_locator2locator_data); break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: return (m_entity_data == x.m_entity_data); break; - case RTPS_SENT: - case RTPS_LOST: + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: return (m_entity2locator_traffic == x.m_entity2locator_traffic); break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: return (m_entity_count == x.m_entity_count); break; - case DISCOVERED_ENTITY: + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: return (m_discovery_time == x.m_discovery_time); break; - case SAMPLE_DATAS: + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: return (m_sample_identity_count == x.m_sample_identity_count); break; - case PHYSICAL_DATA: + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: return (m_physical_data == x.m_physical_data); break; + default: - break; + break; } return false; } @@ -3485,109 +2568,124 @@ void eprosima::fastdds::statistics::Data::_d( { bool b = false; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - switch(__d) - { - case HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - break; - case NETWORK_LATENCY: - switch(__d) - { - case NETWORK_LATENCY: - b = true; - break; - default: - break; - } - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - switch(__d) - { - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - b = true; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + switch (__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } break; - default: - break; - } - break; - case RTPS_SENT: - case RTPS_LOST: - switch(__d) - { - case RTPS_SENT: - case RTPS_LOST: - b = true; - break; - default: - break; - } - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - switch(__d) - { - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - b = true; - break; - default: + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + switch (__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } break; - } - break; - case DISCOVERED_ENTITY: - switch(__d) - { - case DISCOVERED_ENTITY: - b = true; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + switch (__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } break; - default: + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + switch (__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } break; - } - break; - case SAMPLE_DATAS: - switch(__d) - { - case SAMPLE_DATAS: - b = true; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + switch (__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } break; - default: + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + switch (__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } break; - } - break; - case PHYSICAL_DATA: - switch(__d) - { - case PHYSICAL_DATA: - b = true; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + switch (__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } break; - default: + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + switch (__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } break; - } - break; + } - if(!b) + if (!b) { throw BadParamException("Discriminator doesn't correspond with the selected union member"); } @@ -3609,31 +2707,34 @@ void eprosima::fastdds::statistics::Data::writer_reader_data( const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) { m_writer_reader_data = _writer_reader_data; - m__d = HISTORY2HISTORY_LATENCY; + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + } void eprosima::fastdds::statistics::Data::writer_reader_data( eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) { m_writer_reader_data = std::move(_writer_reader_data); - m__d = HISTORY2HISTORY_LATENCY; + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + } const eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::Data::writer_reader_data() const { bool b = false; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - b = true; - break; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_writer_reader_data; @@ -3643,50 +2744,56 @@ eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics:: { bool b = false; - switch(m__d) + switch (m__d) { - case HISTORY2HISTORY_LATENCY: - b = true; - break; + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_writer_reader_data; } + + void eprosima::fastdds::statistics::Data::locator2locator_data( const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) { m_locator2locator_data = _locator2locator_data; - m__d = NETWORK_LATENCY; + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + } void eprosima::fastdds::statistics::Data::locator2locator_data( eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) { m_locator2locator_data = std::move(_locator2locator_data); - m__d = NETWORK_LATENCY; + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + } const eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Data::locator2locator_data() const { bool b = false; - switch(m__d) + switch (m__d) { - case NETWORK_LATENCY: - b = true; - break; + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_locator2locator_data; @@ -3696,51 +2803,57 @@ eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistic { bool b = false; - switch(m__d) + switch (m__d) { - case NETWORK_LATENCY: - b = true; - break; + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_locator2locator_data; } + + void eprosima::fastdds::statistics::Data::entity_data( const eprosima::fastdds::statistics::EntityData& _entity_data) { m_entity_data = _entity_data; - m__d = PUBLICATION_THROUGHPUT; + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + } void eprosima::fastdds::statistics::Data::entity_data( eprosima::fastdds::statistics::EntityData&& _entity_data) { m_entity_data = std::move(_entity_data); - m__d = PUBLICATION_THROUGHPUT; + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + } const eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data::entity_data() const { bool b = false; - switch(m__d) + switch (m__d) { - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - b = true; - break; + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity_data; @@ -3750,52 +2863,58 @@ eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data:: { bool b = false; - switch(m__d) + switch (m__d) { - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - b = true; - break; + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity_data; } + + void eprosima::fastdds::statistics::Data::entity2locator_traffic( const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) { m_entity2locator_traffic = _entity2locator_traffic; - m__d = RTPS_SENT; + m__d = eprosima::fastdds::statistics::RTPS_SENT; + } void eprosima::fastdds::statistics::Data::entity2locator_traffic( eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) { m_entity2locator_traffic = std::move(_entity2locator_traffic); - m__d = RTPS_SENT; + m__d = eprosima::fastdds::statistics::RTPS_SENT; + } const eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Data::entity2locator_traffic() const { bool b = false; - switch(m__d) + switch (m__d) { - case RTPS_SENT: - case RTPS_LOST: - b = true; - break; + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity2locator_traffic; @@ -3805,58 +2924,64 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist { bool b = false; - switch(m__d) + switch (m__d) { - case RTPS_SENT: - case RTPS_LOST: - b = true; - break; + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity2locator_traffic; } + + void eprosima::fastdds::statistics::Data::entity_count( const eprosima::fastdds::statistics::EntityCount& _entity_count) { m_entity_count = _entity_count; - m__d = RESENT_DATAS; + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + } void eprosima::fastdds::statistics::Data::entity_count( eprosima::fastdds::statistics::EntityCount&& _entity_count) { m_entity_count = std::move(_entity_count); - m__d = RESENT_DATAS; + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + } const eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data::entity_count() const { bool b = false; - switch(m__d) + switch (m__d) { - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - b = true; - break; + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity_count; @@ -3866,57 +2991,63 @@ eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data: { bool b = false; - switch(m__d) + switch (m__d) { - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - b = true; - break; + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_entity_count; } + + void eprosima::fastdds::statistics::Data::discovery_time( const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) { m_discovery_time = _discovery_time; - m__d = DISCOVERED_ENTITY; + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + } void eprosima::fastdds::statistics::Data::discovery_time( eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) { m_discovery_time = std::move(_discovery_time); - m__d = DISCOVERED_ENTITY; + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + } const eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Data::discovery_time() const { bool b = false; - switch(m__d) + switch (m__d) { - case DISCOVERED_ENTITY: - b = true; - break; + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_discovery_time; @@ -3926,50 +3057,56 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dat { bool b = false; - switch(m__d) + switch (m__d) { - case DISCOVERED_ENTITY: - b = true; - break; + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_discovery_time; } + + void eprosima::fastdds::statistics::Data::sample_identity_count( const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) { m_sample_identity_count = _sample_identity_count; - m__d = SAMPLE_DATAS; + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + } void eprosima::fastdds::statistics::Data::sample_identity_count( eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) { m_sample_identity_count = std::move(_sample_identity_count); - m__d = SAMPLE_DATAS; + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + } const eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::Data::sample_identity_count() const { bool b = false; - switch(m__d) + switch (m__d) { - case SAMPLE_DATAS: - b = true; - break; + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_sample_identity_count; @@ -3979,50 +3116,56 @@ eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistic { bool b = false; - switch(m__d) + switch (m__d) { - case SAMPLE_DATAS: - b = true; - break; + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_sample_identity_count; } + + void eprosima::fastdds::statistics::Data::physical_data( const eprosima::fastdds::statistics::PhysicalData& _physical_data) { m_physical_data = _physical_data; - m__d = PHYSICAL_DATA; + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + } void eprosima::fastdds::statistics::Data::physical_data( eprosima::fastdds::statistics::PhysicalData&& _physical_data) { m_physical_data = std::move(_physical_data); - m__d = PHYSICAL_DATA; + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + } const eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data::physical_data() const { bool b = false; - switch(m__d) + switch (m__d) { - case PHYSICAL_DATA: - b = true; - break; + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; default: - break; + break; } - if(!b) + + if (!b) { - throw BadParamException("This member is not been selected"); + throw BadParamException("This member has not been selected"); } return m_physical_data; @@ -4032,177 +3175,26 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data { bool b = false; - switch(m__d) + switch (m__d) { - case PHYSICAL_DATA: - b = true; - break; + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; default: - break; - } - if(!b) - { - throw BadParamException("This member is not been selected"); + break; } - return m_physical_data; -} - -// TODO(Ricardo) Review -size_t eprosima::fastdds::statistics::Data::getCdrSerializedSize( - const eprosima::fastdds::statistics::Data& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - switch(data.m__d) + if (!b) { - case HISTORY2HISTORY_LATENCY: - current_alignment += eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize(data.writer_reader_data(), current_alignment); - break; - case NETWORK_LATENCY: - current_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize(data.locator2locator_data(), current_alignment); - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - current_alignment += eprosima::fastdds::statistics::EntityData::getCdrSerializedSize(data.entity_data(), current_alignment); - break; - case RTPS_SENT: - case RTPS_LOST: - current_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize(data.entity2locator_traffic(), current_alignment); - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - current_alignment += eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize(data.entity_count(), current_alignment); - break; - case DISCOVERED_ENTITY: - current_alignment += eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize(data.discovery_time(), current_alignment); - break; - case SAMPLE_DATAS: - current_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize(data.sample_identity_count(), current_alignment); - break; - case PHYSICAL_DATA: - current_alignment += eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize(data.physical_data(), current_alignment); - break; - default: - break; + throw BadParamException("This member has not been selected"); } - return current_alignment - initial_alignment; -} - -void eprosima::fastdds::statistics::Data::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m__d; - - switch(m__d) - { - case HISTORY2HISTORY_LATENCY: - scdr << m_writer_reader_data; - - break; - case NETWORK_LATENCY: - scdr << m_locator2locator_data; - - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - scdr << m_entity_data; - - break; - case RTPS_SENT: - case RTPS_LOST: - scdr << m_entity2locator_traffic; - - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - scdr << m_entity_count; - - break; - case DISCOVERED_ENTITY: - scdr << m_discovery_time; - - break; - case SAMPLE_DATAS: - scdr << m_sample_identity_count; - - break; - case PHYSICAL_DATA: - scdr << m_physical_data; - - break; - default: - break; - } + return m_physical_data; } -void eprosima::fastdds::statistics::Data::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t bitmask_value = 0; - dcdr >> bitmask_value; - m__d = (eprosima::fastdds::statistics::EventKind)bitmask_value; - } - - - switch(m__d) - { - case HISTORY2HISTORY_LATENCY: - dcdr >> m_writer_reader_data; - break; - case NETWORK_LATENCY: - dcdr >> m_locator2locator_data; - break; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: - dcdr >> m_entity_data; - break; - case RTPS_SENT: - case RTPS_LOST: - dcdr >> m_entity2locator_traffic; - break; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: - dcdr >> m_entity_count; - break; - case DISCOVERED_ENTITY: - dcdr >> m_discovery_time; - break; - case SAMPLE_DATAS: - dcdr >> m_sample_identity_count; - break; - case PHYSICAL_DATA: - dcdr >> m_physical_data; - break; - default: - break; - } -} +// Include auxiliary functions like for serializing/deserializing. +#include "typesCdrAux.ipp" diff --git a/src/cpp/topic_types/types.h b/src/cpp/topic_types/types.h index e49caa5aa..fe4fbc112 100644 --- a/src/cpp/topic_types/types.h +++ b/src/cpp/topic_types/types.h @@ -16,21 +16,23 @@ * @file types.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,10 +61,12 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace eprosima { namespace fastdds { namespace statistics { @@ -153,66 +157,9 @@ namespace eprosima { */ eProsima_user_DllExport std::array& value(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::EntityId_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - std::array m_value; + std::array m_value{0}; }; /*! @@ -301,66 +248,9 @@ namespace eprosima { */ eProsima_user_DllExport std::array& value(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - std::array m_value; + std::array m_value{0}; }; /*! @@ -448,6 +338,8 @@ namespace eprosima { * @return Reference to member guidPrefix */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); + + /*! * @brief This function copies the value in member entityId * @param _entityId New value to be copied in member entityId @@ -474,63 +366,6 @@ namespace eprosima { */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GUID_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; @@ -616,6 +451,7 @@ namespace eprosima { */ eProsima_user_DllExport int32_t& high(); + /*! * @brief This function sets a value in member low * @param _low New value for member low @@ -635,68 +471,10 @@ namespace eprosima { */ eProsima_user_DllExport uint32_t& low(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - int32_t m_high; - uint32_t m_low; + int32_t m_high{0}; + uint32_t m_low{0}; }; /*! @@ -784,6 +562,8 @@ namespace eprosima { * @return Reference to member writer_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + /*! * @brief This function copies the value in member sequence_number * @param _sequence_number New value to be copied in member sequence_number @@ -810,63 +590,6 @@ namespace eprosima { */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; @@ -952,6 +675,7 @@ namespace eprosima { */ eProsima_user_DllExport int32_t& kind(); + /*! * @brief This function sets a value in member port * @param _port New value for member port @@ -971,6 +695,7 @@ namespace eprosima { */ eProsima_user_DllExport uint32_t& port(); + /*! * @brief This function copies the value in member address * @param _address New value to be copied in member address @@ -997,68 +722,11 @@ namespace eprosima { */ eProsima_user_DllExport std::array& address(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::Locator_s& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - int32_t m_kind; - uint32_t m_port; - std::array m_address; + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; }; } // namespace detail @@ -1147,6 +815,8 @@ namespace eprosima { * @return Reference to member local_participant_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); + + /*! * @brief This function copies the value in member remote_entity_guid * @param _remote_entity_guid New value to be copied in member remote_entity_guid @@ -1172,6 +842,8 @@ namespace eprosima { * @return Reference to member remote_entity_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); + + /*! * @brief This function sets a value in member time * @param _time New value for member time @@ -1191,6 +863,7 @@ namespace eprosima { */ eProsima_user_DllExport uint64_t& time(); + /*! * @brief This function copies the value in member host * @param _host New value to be copied in member host @@ -1216,6 +889,8 @@ namespace eprosima { * @return Reference to member host */ eProsima_user_DllExport std::string& host(); + + /*! * @brief This function copies the value in member user * @param _user New value to be copied in member user @@ -1241,6 +916,8 @@ namespace eprosima { * @return Reference to member user */ eProsima_user_DllExport std::string& user(); + + /*! * @brief This function copies the value in member process * @param _process New value to be copied in member process @@ -1267,68 +944,11 @@ namespace eprosima { */ eProsima_user_DllExport std::string& process(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::DiscoveryTime& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time; + uint64_t m_time{0}; std::string m_host; std::string m_user; std::string m_process; @@ -1419,6 +1039,8 @@ namespace eprosima { * @return Reference to member guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + /*! * @brief This function sets a value in member count * @param _count New value for member count @@ -1438,68 +1060,10 @@ namespace eprosima { */ eProsima_user_DllExport uint64_t& count(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityCount& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count; + uint64_t m_count{0}; }; /*! @@ -1587,6 +1151,8 @@ namespace eprosima { * @return Reference to member sample_id */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); + + /*! * @brief This function sets a value in member count * @param _count New value for member count @@ -1606,68 +1172,10 @@ namespace eprosima { */ eProsima_user_DllExport uint64_t& count(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::SampleIdentityCount& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count; + uint64_t m_count{0}; }; /*! @@ -1755,6 +1263,8 @@ namespace eprosima { * @return Reference to member src_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); + + /*! * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator @@ -1780,6 +1290,8 @@ namespace eprosima { * @return Reference to member dst_locator */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + /*! * @brief This function sets a value in member packet_count * @param _packet_count New value for member packet_count @@ -1799,6 +1311,7 @@ namespace eprosima { */ eProsima_user_DllExport uint64_t& packet_count(); + /*! * @brief This function sets a value in member byte_count * @param _byte_count New value for member byte_count @@ -1818,6 +1331,7 @@ namespace eprosima { */ eProsima_user_DllExport uint64_t& byte_count(); + /*! * @brief This function sets a value in member byte_magnitude_order * @param _byte_magnitude_order New value for member byte_magnitude_order @@ -1837,71 +1351,13 @@ namespace eprosima { */ eProsima_user_DllExport int16_t& byte_magnitude_order(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_src_guid; eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count; - uint64_t m_byte_count; - int16_t m_byte_magnitude_order; + uint64_t m_packet_count{0}; + uint64_t m_byte_count{0}; + int16_t m_byte_magnitude_order{0}; }; /*! @@ -1989,6 +1445,8 @@ namespace eprosima { * @return Reference to member writer_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + /*! * @brief This function copies the value in member reader_guid * @param _reader_guid New value to be copied in member reader_guid @@ -2014,6 +1472,8 @@ namespace eprosima { * @return Reference to member reader_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2033,69 +1493,11 @@ namespace eprosima { */ eProsima_user_DllExport float& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::WriterReaderData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data; + float m_data{0.0}; }; /*! @@ -2183,6 +1585,8 @@ namespace eprosima { * @return Reference to member src_locator */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); + + /*! * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator @@ -2208,6 +1612,8 @@ namespace eprosima { * @return Reference to member dst_locator */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2227,69 +1633,11 @@ namespace eprosima { */ eProsima_user_DllExport float& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Locator2LocatorData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::Locator_s m_src_locator; eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data; + float m_data{0.0}; }; /*! @@ -2377,6 +1725,8 @@ namespace eprosima { * @return Reference to member guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + /*! * @brief This function sets a value in member data * @param _data New value for member data @@ -2396,68 +1746,10 @@ namespace eprosima { */ eProsima_user_DllExport float& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data; + float m_data{0.0}; }; /*! @@ -2545,6 +1837,8 @@ namespace eprosima { * @return Reference to member participant_guid */ eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); + + /*! * @brief This function copies the value in member host * @param _host New value to be copied in member host @@ -2570,6 +1864,8 @@ namespace eprosima { * @return Reference to member host */ eProsima_user_DllExport std::string& host(); + + /*! * @brief This function copies the value in member user * @param _user New value to be copied in member user @@ -2595,6 +1891,8 @@ namespace eprosima { * @return Reference to member user */ eProsima_user_DllExport std::string& user(); + + /*! * @brief This function copies the value in member process * @param _process New value to be copied in member process @@ -2621,63 +1919,6 @@ namespace eprosima { */ eProsima_user_DllExport std::string& process(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::PhysicalData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; @@ -2687,10 +1928,10 @@ namespace eprosima { }; /*! - * @brief This class represents the bitmask EventKind defined by the user in the IDL file. + * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. * @ingroup types */ - enum EventKind : uint32_t + enum EventKindBits : uint32_t { HISTORY2HISTORY_LATENCY = 0x01ull << 0, NETWORK_LATENCY = 0x01ull << 1, @@ -2710,6 +1951,7 @@ namespace eprosima { SAMPLE_DATAS = 0x01ull << 15, PHYSICAL_DATA = 0x01ull << 16 }; + typedef uint32_t EventKind; /*! * @brief This class represents the union Data defined by the user in the IDL file. * @ingroup types @@ -2817,6 +2059,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); + + /*! * @brief This function copies the value in member locator2locator_data * @param _locator2locator_data New value to be copied in member locator2locator_data @@ -2844,6 +2088,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); + + /*! * @brief This function copies the value in member entity_data * @param _entity_data New value to be copied in member entity_data @@ -2871,6 +2117,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); + + /*! * @brief This function copies the value in member entity2locator_traffic * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic @@ -2898,6 +2146,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); + + /*! * @brief This function copies the value in member entity_count * @param _entity_count New value to be copied in member entity_count @@ -2925,6 +2175,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); + + /*! * @brief This function copies the value in member discovery_time * @param _discovery_time New value to be copied in member discovery_time @@ -2952,6 +2204,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); + + /*! * @brief This function copies the value in member sample_identity_count * @param _sample_identity_count New value to be copied in member sample_identity_count @@ -2979,6 +2233,8 @@ namespace eprosima { * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. */ eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); + + /*! * @brief This function copies the value in member physical_data * @param _physical_data New value to be copied in member physical_data @@ -3007,34 +2263,6 @@ namespace eprosima { */ eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Data& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - private: eprosima::fastdds::statistics::EventKind m__d; diff --git a/src/cpp/topic_types/typesCdrAux.hpp b/src/cpp/topic_types/typesCdrAux.hpp new file mode 100644 index 000000000..274084a33 --- /dev/null +++ b/src/cpp/topic_types/typesCdrAux.hpp @@ -0,0 +1,144 @@ +// 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 typesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ + +#include "types.h" + +constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize {852UL}; +constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize {56UL}; + +constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize {812UL}; +constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize {28UL}; + + +constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize {16UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize {28UL}; + +constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize {82UL}; +constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize {56UL}; + +constexpr uint32_t eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize {28UL}; + +constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize {64UL}; +constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize {56UL}; + +constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize {44UL}; + +constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize {64UL}; +constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize {56UL}; + +constexpr uint32_t eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::EntityId_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::GuidPrefix_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::GUID_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::SequenceNumber_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::Locator_s& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DiscoveryTime& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityCount& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::SampleIdentityCount& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::WriterReaderData& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Locator2LocatorData& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityData& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::PhysicalData& data); + + + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ \ No newline at end of file diff --git a/src/cpp/topic_types/typesCdrAux.ipp b/src/cpp/topic_types/typesCdrAux.ipp new file mode 100644 index 000000000..4fddae426 --- /dev/null +++ b/src/cpp/topic_types/typesCdrAux.ipp @@ -0,0 +1,1561 @@ +// 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 typesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ + +#include "typesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::EntityId_s& data, + size_t& current_alignment) +{ + 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::statistics::detail::EntityId_s& data) +{ + 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::statistics::detail::EntityId_s& data) +{ + 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::statistics::detail::EntityId_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, + size_t& current_alignment) +{ + 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::statistics::detail::GuidPrefix_s& data) +{ + 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::statistics::detail::GuidPrefix_s& data) +{ + 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::statistics::detail::GuidPrefix_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::GUID_s& data, + size_t& current_alignment) +{ + 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::statistics::detail::GUID_s& data) +{ + 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::statistics::detail::GUID_s& data) +{ + 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::statistics::detail::GUID_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, + size_t& current_alignment) +{ + 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::statistics::detail::SequenceNumber_s& data) +{ + 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::statistics::detail::SequenceNumber_s& data) +{ + 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::statistics::detail::SequenceNumber_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, + size_t& current_alignment) +{ + 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.writer_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.sequence_number(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) +{ + 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.writer_guid() + << eprosima::fastcdr::MemberId(1) << data.sequence_number() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::detail::SampleIdentity_s& data) +{ + 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.writer_guid(); + break; + + case 1: + dcdr >> data.sequence_number(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::detail::Locator_s& data, + size_t& current_alignment) +{ + 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::statistics::detail::Locator_s& data) +{ + 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::statistics::detail::Locator_s& data) +{ + 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::statistics::detail::Locator_s& data) +{ + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::DiscoveryTime& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.local_participant_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.remote_entity_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.host(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.user(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.process(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DiscoveryTime& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.local_participant_guid() + << eprosima::fastcdr::MemberId(1) << data.remote_entity_guid() + << eprosima::fastcdr::MemberId(2) << data.time() + << eprosima::fastcdr::MemberId(3) << data.host() + << eprosima::fastcdr::MemberId(4) << data.user() + << eprosima::fastcdr::MemberId(5) << data.process() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::DiscoveryTime& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.local_participant_guid(); + break; + + case 1: + dcdr >> data.remote_entity_guid(); + break; + + case 2: + dcdr >> data.time(); + break; + + case 3: + dcdr >> data.host(); + break; + + case 4: + dcdr >> data.user(); + break; + + case 5: + dcdr >> data.process(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DiscoveryTime& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.local_participant_guid(); + + scdr << data.remote_entity_guid(); + + + + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::EntityCount& data, + size_t& current_alignment) +{ + 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.guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityCount& data) +{ + 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.guid() + << eprosima::fastcdr::MemberId(1) << data.count() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::EntityCount& data) +{ + 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.guid(); + break; + + case 1: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityCount& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.guid(); + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::SampleIdentityCount& data, + size_t& current_alignment) +{ + 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.sample_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::SampleIdentityCount& data) +{ + 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.sample_id() + << eprosima::fastcdr::MemberId(1) << data.count() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::SampleIdentityCount& data) +{ + 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.sample_id(); + break; + + case 1: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::SampleIdentityCount& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.sample_id(); + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, + size_t& current_alignment) +{ + 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.src_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.dst_locator(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.packet_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.byte_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.byte_magnitude_order(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) +{ + 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.src_guid() + << eprosima::fastcdr::MemberId(1) << data.dst_locator() + << eprosima::fastcdr::MemberId(2) << data.packet_count() + << eprosima::fastcdr::MemberId(3) << data.byte_count() + << eprosima::fastcdr::MemberId(4) << data.byte_magnitude_order() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::Entity2LocatorTraffic& data) +{ + 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.src_guid(); + break; + + case 1: + dcdr >> data.dst_locator(); + break; + + case 2: + dcdr >> data.packet_count(); + break; + + case 3: + dcdr >> data.byte_count(); + break; + + case 4: + dcdr >> data.byte_magnitude_order(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.src_guid(); + + scdr << data.dst_locator(); + + + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::WriterReaderData& data, + size_t& current_alignment) +{ + 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.writer_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.reader_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::WriterReaderData& data) +{ + 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.writer_guid() + << eprosima::fastcdr::MemberId(1) << data.reader_guid() + << eprosima::fastcdr::MemberId(2) << data.data() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::WriterReaderData& data) +{ + 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.writer_guid(); + break; + + case 1: + dcdr >> data.reader_guid(); + break; + + case 2: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::WriterReaderData& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.writer_guid(); + + scdr << data.reader_guid(); + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::Locator2LocatorData& data, + size_t& current_alignment) +{ + 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.src_locator(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.dst_locator(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Locator2LocatorData& data) +{ + 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.src_locator() + << eprosima::fastcdr::MemberId(1) << data.dst_locator() + << eprosima::fastcdr::MemberId(2) << data.data() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::Locator2LocatorData& data) +{ + 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.src_locator(); + break; + + case 1: + dcdr >> data.dst_locator(); + break; + + case 2: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Locator2LocatorData& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.src_locator(); + + scdr << data.dst_locator(); + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::EntityData& data, + size_t& current_alignment) +{ + 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.guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityData& data) +{ + 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.guid() + << eprosima::fastcdr::MemberId(1) << data.data() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::EntityData& data) +{ + 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.guid(); + break; + + case 1: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::EntityData& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.guid(); + + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::PhysicalData& data, + size_t& current_alignment) +{ + 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.participant_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.host(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.user(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.process(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::PhysicalData& data) +{ + 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.participant_guid() + << eprosima::fastcdr::MemberId(1) << data.host() + << eprosima::fastcdr::MemberId(2) << data.user() + << eprosima::fastcdr::MemberId(3) << data.process() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::PhysicalData& data) +{ + 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.participant_guid(); + break; + + case 1: + dcdr >> data.host(); + break; + + case 2: + dcdr >> data.user(); + break; + + case 3: + dcdr >> data.process(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::PhysicalData& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.participant_guid(); + + + + +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::Data& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.writer_reader_data(), current_alignment); + break; + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.locator2locator_data(), current_alignment); + break; + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.entity_data(), current_alignment); + break; + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.entity2locator_traffic(), current_alignment); + break; + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.entity_count(), current_alignment); + break; + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.discovery_time(), current_alignment); + break; + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.sample_identity_count(), current_alignment); + break; + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.physical_data(), 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::statistics::Data& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + scdr << eprosima::fastcdr::MemberId(0) << data.writer_reader_data(); + break; + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + scdr << eprosima::fastcdr::MemberId(1) << data.locator2locator_data(); + break; + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + scdr << eprosima::fastcdr::MemberId(2) << data.entity_data(); + break; + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + scdr << eprosima::fastcdr::MemberId(3) << data.entity2locator_traffic(); + break; + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + scdr << eprosima::fastcdr::MemberId(4) << data.entity_count(); + break; + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + scdr << eprosima::fastcdr::MemberId(5) << data.discovery_time(); + break; + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + scdr << eprosima::fastcdr::MemberId(6) << data.sample_identity_count(); + break; + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + scdr << eprosima::fastcdr::MemberId(7) << data.physical_data(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::Data& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data._d(); + break; + default: + switch (data._d()) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + dcdr >> data.writer_reader_data(); + break; + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + dcdr >> data.locator2locator_data(); + break; + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + dcdr >> data.entity_data(); + break; + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + dcdr >> data.entity2locator_traffic(); + break; + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + dcdr >> data.entity_count(); + break; + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + dcdr >> data.discovery_time(); + break; + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + dcdr >> data.sample_identity_count(); + break; + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + dcdr >> data.physical_data(); + break; + + } + ret_value = false; + break; + } + return ret_value; + }); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ \ No newline at end of file diff --git a/src/cpp/topic_types/typesPubSubTypes.cxx b/src/cpp/topic_types/typesPubSubTypes.cxx index 0afe89a41..70cf4e481 100644 --- a/src/cpp/topic_types/typesPubSubTypes.cxx +++ b/src/cpp/topic_types/typesPubSubTypes.cxx @@ -16,17 +16,20 @@ * @file typesPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #include #include +#include #include "typesPubSubTypes.h" +#include "typesCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace eprosima { namespace fastdds { @@ -35,12 +38,11 @@ namespace eprosima { EntityId_sPubSubType::EntityId_sPubSubType() { setName("eprosima::fastdds::statistics::detail::EntityId_s"); - auto type_size = EntityId_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EntityId_s::isKeyDefined(); - size_t keyLength = EntityId_s::getKeyMaxCdrSerializedSize() > 16 ? - EntityId_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -55,22 +57,29 @@ namespace eprosima { bool EntityId_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { EntityId_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -78,7 +87,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -95,14 +104,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -113,12 +122,18 @@ namespace eprosima { } std::function EntityId_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -147,15 +162,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EntityId_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EntityId_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -175,12 +190,11 @@ namespace eprosima { GuidPrefix_sPubSubType::GuidPrefix_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GuidPrefix_s"); - auto type_size = GuidPrefix_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GuidPrefix_s::isKeyDefined(); - size_t keyLength = GuidPrefix_s::getKeyMaxCdrSerializedSize() > 16 ? - GuidPrefix_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -195,22 +209,29 @@ namespace eprosima { bool GuidPrefix_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { GuidPrefix_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -218,7 +239,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -235,14 +256,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -253,12 +274,18 @@ namespace eprosima { } std::function GuidPrefix_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -287,15 +314,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GuidPrefix_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GuidPrefix_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -315,12 +342,11 @@ namespace eprosima { GUID_sPubSubType::GUID_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GUID_s"); - auto type_size = GUID_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GUID_s::isKeyDefined(); - size_t keyLength = GUID_s::getKeyMaxCdrSerializedSize() > 16 ? - GUID_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -335,22 +361,29 @@ namespace eprosima { bool GUID_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { GUID_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -358,7 +391,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -375,14 +408,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -393,12 +426,18 @@ namespace eprosima { } std::function GUID_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -427,15 +466,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GUID_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GUID_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -455,12 +494,11 @@ namespace eprosima { SequenceNumber_sPubSubType::SequenceNumber_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SequenceNumber_s"); - auto type_size = SequenceNumber_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SequenceNumber_s::isKeyDefined(); - size_t keyLength = SequenceNumber_s::getKeyMaxCdrSerializedSize() > 16 ? - SequenceNumber_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -475,22 +513,29 @@ namespace eprosima { bool SequenceNumber_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { SequenceNumber_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -498,7 +543,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -515,14 +560,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -533,12 +578,18 @@ namespace eprosima { } std::function SequenceNumber_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -567,15 +618,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceNumber_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SequenceNumber_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -595,12 +646,11 @@ namespace eprosima { SampleIdentity_sPubSubType::SampleIdentity_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SampleIdentity_s"); - auto type_size = SampleIdentity_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SampleIdentity_s::isKeyDefined(); - size_t keyLength = SampleIdentity_s::getKeyMaxCdrSerializedSize() > 16 ? - SampleIdentity_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -615,22 +665,29 @@ namespace eprosima { bool SampleIdentity_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { SampleIdentity_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -638,7 +695,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -655,14 +712,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -673,12 +730,18 @@ namespace eprosima { } std::function SampleIdentity_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -707,15 +770,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SampleIdentity_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SampleIdentity_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -735,12 +798,11 @@ namespace eprosima { Locator_sPubSubType::Locator_sPubSubType() { setName("eprosima::fastdds::statistics::detail::Locator_s"); - auto type_size = Locator_s::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Locator_s::isKeyDefined(); - size_t keyLength = Locator_s::getKeyMaxCdrSerializedSize() > 16 ? - Locator_s::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -755,22 +817,29 @@ namespace eprosima { bool Locator_sPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { Locator_s* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -778,7 +847,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -795,14 +864,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -813,12 +882,18 @@ namespace eprosima { } std::function Locator_sPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -847,15 +922,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Locator_s::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Locator_s::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -878,12 +953,11 @@ namespace eprosima { DiscoveryTimePubSubType::DiscoveryTimePubSubType() { setName("eprosima::fastdds::statistics::DiscoveryTime"); - auto type_size = DiscoveryTime::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DiscoveryTime::isKeyDefined(); - size_t keyLength = DiscoveryTime::getKeyMaxCdrSerializedSize() > 16 ? - DiscoveryTime::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -898,22 +972,29 @@ namespace eprosima { bool DiscoveryTimePubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { DiscoveryTime* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -921,7 +1002,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -938,14 +1019,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -956,12 +1037,18 @@ namespace eprosima { } std::function DiscoveryTimePubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -990,15 +1077,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DiscoveryTime::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DiscoveryTime::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1018,12 +1105,11 @@ namespace eprosima { EntityCountPubSubType::EntityCountPubSubType() { setName("eprosima::fastdds::statistics::EntityCount"); - auto type_size = EntityCount::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EntityCount::isKeyDefined(); - size_t keyLength = EntityCount::getKeyMaxCdrSerializedSize() > 16 ? - EntityCount::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1038,22 +1124,29 @@ namespace eprosima { bool EntityCountPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { EntityCount* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1061,7 +1154,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1078,14 +1171,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1096,12 +1189,18 @@ namespace eprosima { } std::function EntityCountPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1130,15 +1229,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EntityCount::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EntityCount::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1158,12 +1257,11 @@ namespace eprosima { SampleIdentityCountPubSubType::SampleIdentityCountPubSubType() { setName("eprosima::fastdds::statistics::SampleIdentityCount"); - auto type_size = SampleIdentityCount::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SampleIdentityCount::isKeyDefined(); - size_t keyLength = SampleIdentityCount::getKeyMaxCdrSerializedSize() > 16 ? - SampleIdentityCount::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1178,22 +1276,29 @@ namespace eprosima { bool SampleIdentityCountPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { SampleIdentityCount* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1201,7 +1306,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1218,14 +1323,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1236,12 +1341,18 @@ namespace eprosima { } std::function SampleIdentityCountPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1270,15 +1381,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SampleIdentityCount::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SampleIdentityCount::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1298,12 +1409,11 @@ namespace eprosima { Entity2LocatorTrafficPubSubType::Entity2LocatorTrafficPubSubType() { setName("eprosima::fastdds::statistics::Entity2LocatorTraffic"); - auto type_size = Entity2LocatorTraffic::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Entity2LocatorTraffic::isKeyDefined(); - size_t keyLength = Entity2LocatorTraffic::getKeyMaxCdrSerializedSize() > 16 ? - Entity2LocatorTraffic::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1318,22 +1428,29 @@ namespace eprosima { bool Entity2LocatorTrafficPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { Entity2LocatorTraffic* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1341,7 +1458,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1358,14 +1475,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1376,12 +1493,18 @@ namespace eprosima { } std::function Entity2LocatorTrafficPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1410,15 +1533,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Entity2LocatorTraffic::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Entity2LocatorTraffic::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1438,12 +1561,11 @@ namespace eprosima { WriterReaderDataPubSubType::WriterReaderDataPubSubType() { setName("eprosima::fastdds::statistics::WriterReaderData"); - auto type_size = WriterReaderData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = WriterReaderData::isKeyDefined(); - size_t keyLength = WriterReaderData::getKeyMaxCdrSerializedSize() > 16 ? - WriterReaderData::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1458,22 +1580,29 @@ namespace eprosima { bool WriterReaderDataPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { WriterReaderData* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1481,7 +1610,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1498,14 +1627,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1516,12 +1645,18 @@ namespace eprosima { } std::function WriterReaderDataPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1550,15 +1685,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WriterReaderData::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || WriterReaderData::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1578,12 +1713,11 @@ namespace eprosima { Locator2LocatorDataPubSubType::Locator2LocatorDataPubSubType() { setName("eprosima::fastdds::statistics::Locator2LocatorData"); - auto type_size = Locator2LocatorData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Locator2LocatorData::isKeyDefined(); - size_t keyLength = Locator2LocatorData::getKeyMaxCdrSerializedSize() > 16 ? - Locator2LocatorData::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1598,22 +1732,29 @@ namespace eprosima { bool Locator2LocatorDataPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { Locator2LocatorData* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1621,7 +1762,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1638,14 +1779,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1656,12 +1797,18 @@ namespace eprosima { } std::function Locator2LocatorDataPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1690,15 +1837,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Locator2LocatorData::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Locator2LocatorData::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1718,12 +1865,11 @@ namespace eprosima { EntityDataPubSubType::EntityDataPubSubType() { setName("eprosima::fastdds::statistics::EntityData"); - auto type_size = EntityData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EntityData::isKeyDefined(); - size_t keyLength = EntityData::getKeyMaxCdrSerializedSize() > 16 ? - EntityData::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_EntityData_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1738,22 +1884,29 @@ namespace eprosima { bool EntityDataPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { EntityData* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1761,7 +1914,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1778,14 +1931,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1796,12 +1949,18 @@ namespace eprosima { } std::function EntityDataPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1830,15 +1989,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EntityData::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EntityData::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1858,12 +2017,11 @@ namespace eprosima { PhysicalDataPubSubType::PhysicalDataPubSubType() { setName("eprosima::fastdds::statistics::PhysicalData"); - auto type_size = PhysicalData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PhysicalData::isKeyDefined(); - size_t keyLength = PhysicalData::getKeyMaxCdrSerializedSize() > 16 ? - PhysicalData::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -1878,22 +2036,29 @@ namespace eprosima { bool PhysicalDataPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { PhysicalData* 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, eprosima::fastcdr::Cdr::DDS_CDR); + 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; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1901,7 +2066,7 @@ namespace eprosima { } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -1918,14 +2083,14 @@ namespace eprosima { 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, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -1936,12 +2101,18 @@ namespace eprosima { } std::function PhysicalDataPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + 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*/; }; } @@ -1970,15 +2141,15 @@ namespace eprosima { // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PhysicalData::getKeyMaxCdrSerializedSize()); + eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PhysicalData::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/src/cpp/topic_types/typesPubSubTypes.h b/src/cpp/topic_types/typesPubSubTypes.h index da0202c92..d44a6d6b5 100644 --- a/src/cpp/topic_types/typesPubSubTypes.h +++ b/src/cpp/topic_types/typesPubSubTypes.h @@ -16,20 +16,23 @@ * @file typesPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_PUBSUBTYPES_H_ +#include #include +#include +#include #include #include "types.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER @@ -46,31 +49,35 @@ namespace eprosima #ifndef SWIG namespace detail { - template - struct EntityId_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct EntityId_s_f + template + struct EntityId_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef std::array EntityId_s::* type; - friend constexpr type get( - EntityId_s_f); - }; + return M; + } - template struct EntityId_s_rob; + }; - template - inline size_t constexpr EntityId_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + struct EntityId_s_f + { + typedef std::array EntityId_s::* type; + friend constexpr type get( + EntityId_s_f); + }; + + template struct EntityId_s_rob; + + template + inline size_t constexpr EntityId_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type EntityId_s defined by the user in the IDL file. @@ -84,27 +91,42 @@ namespace eprosima eProsima_user_DllExport EntityId_sPubSubType(); - eProsima_user_DllExport virtual ~EntityId_sPubSubType() override; + eProsima_user_DllExport ~EntityId_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -140,38 +162,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 4ULL == (detail::EntityId_s_offset_of() + sizeof(std::array)); + return 8ULL == + (detail::EntityId_s_offset_of() + + sizeof(std::array)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct GuidPrefix_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct GuidPrefix_s_f + template + struct GuidPrefix_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef std::array GuidPrefix_s::* type; - friend constexpr type get( - GuidPrefix_s_f); - }; + return M; + } + + }; - template struct GuidPrefix_s_rob; + struct GuidPrefix_s_f + { + typedef std::array GuidPrefix_s::* type; + friend constexpr type get( + GuidPrefix_s_f); + }; - template - inline size_t constexpr GuidPrefix_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct GuidPrefix_s_rob; + + template + inline size_t constexpr GuidPrefix_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type GuidPrefix_s defined by the user in the IDL file. @@ -185,27 +214,42 @@ namespace eprosima eProsima_user_DllExport GuidPrefix_sPubSubType(); - eProsima_user_DllExport virtual ~GuidPrefix_sPubSubType() override; + eProsima_user_DllExport ~GuidPrefix_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -241,38 +285,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 12ULL == (detail::GuidPrefix_s_offset_of() + sizeof(std::array)); + return 16ULL == + (detail::GuidPrefix_s_offset_of() + + sizeof(std::array)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct GUID_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct GUID_s_f + template + struct GUID_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef eprosima::fastdds::statistics::detail::EntityId_s GUID_s::* type; - friend constexpr type get( - GUID_s_f); - }; + return M; + } - template struct GUID_s_rob; + }; - template - inline size_t constexpr GUID_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + struct GUID_s_f + { + typedef eprosima::fastdds::statistics::detail::EntityId_s GUID_s::* type; + friend constexpr type get( + GUID_s_f); + }; + + template struct GUID_s_rob; + + template + inline size_t constexpr GUID_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type GUID_s defined by the user in the IDL file. @@ -286,27 +337,42 @@ namespace eprosima eProsima_user_DllExport GUID_sPubSubType(); - eProsima_user_DllExport virtual ~GUID_sPubSubType() override; + eProsima_user_DllExport ~GUID_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -342,38 +408,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 16ULL == (detail::GUID_s_offset_of() + sizeof(eprosima::fastdds::statistics::detail::EntityId_s)); + return 28ULL == + (detail::GUID_s_offset_of() + + sizeof(eprosima::fastdds::statistics::detail::EntityId_s)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct SequenceNumber_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct SequenceNumber_s_f + template + struct SequenceNumber_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef uint32_t SequenceNumber_s::* type; - friend constexpr type get( - SequenceNumber_s_f); - }; + return M; + } - template struct SequenceNumber_s_rob; + }; - template - inline size_t constexpr SequenceNumber_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + struct SequenceNumber_s_f + { + typedef uint32_t SequenceNumber_s::* type; + friend constexpr type get( + SequenceNumber_s_f); + }; + + template struct SequenceNumber_s_rob; + + template + inline size_t constexpr SequenceNumber_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type SequenceNumber_s defined by the user in the IDL file. @@ -387,27 +460,42 @@ namespace eprosima eProsima_user_DllExport SequenceNumber_sPubSubType(); - eProsima_user_DllExport virtual ~SequenceNumber_sPubSubType() override; + eProsima_user_DllExport ~SequenceNumber_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -443,38 +531,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 8ULL == (detail::SequenceNumber_s_offset_of() + sizeof(uint32_t)); + return 12ULL == + (detail::SequenceNumber_s_offset_of() + + sizeof(uint32_t)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct SampleIdentity_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct SampleIdentity_s_f + template + struct SampleIdentity_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef eprosima::fastdds::statistics::detail::SequenceNumber_s SampleIdentity_s::* type; - friend constexpr type get( - SampleIdentity_s_f); - }; + return M; + } - template struct SampleIdentity_s_rob; + }; - template - inline size_t constexpr SampleIdentity_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + struct SampleIdentity_s_f + { + typedef eprosima::fastdds::statistics::detail::SequenceNumber_s SampleIdentity_s::* type; + friend constexpr type get( + SampleIdentity_s_f); + }; + + template struct SampleIdentity_s_rob; + + template + inline size_t constexpr SampleIdentity_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type SampleIdentity_s defined by the user in the IDL file. @@ -488,27 +583,42 @@ namespace eprosima eProsima_user_DllExport SampleIdentity_sPubSubType(); - eProsima_user_DllExport virtual ~SampleIdentity_sPubSubType() override; + eProsima_user_DllExport ~SampleIdentity_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -544,38 +654,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 24ULL == (detail::SampleIdentity_s_offset_of() + sizeof(eprosima::fastdds::statistics::detail::SequenceNumber_s)); + return 44ULL == + (detail::SampleIdentity_s_offset_of() + + sizeof(eprosima::fastdds::statistics::detail::SequenceNumber_s)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct Locator_s_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Locator_s_f + template + struct Locator_s_rob + { + friend constexpr typename Tag::type get( + Tag) { - typedef std::array Locator_s::* type; - friend constexpr type get( - Locator_s_f); - }; + return M; + } - template struct Locator_s_rob; + }; - template - inline size_t constexpr Locator_s_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + struct Locator_s_f + { + typedef std::array Locator_s::* type; + friend constexpr type get( + Locator_s_f); + }; + + template struct Locator_s_rob; + + template + inline size_t constexpr Locator_s_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type Locator_s defined by the user in the IDL file. @@ -589,27 +706,42 @@ namespace eprosima eProsima_user_DllExport Locator_sPubSubType(); - eProsima_user_DllExport virtual ~Locator_sPubSubType() override; + eProsima_user_DllExport ~Locator_sPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -645,9 +777,12 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 24ULL == (detail::Locator_s_offset_of() + sizeof(std::array)); + return 28ULL == + (detail::Locator_s_offset_of() + + sizeof(std::array)); + } - }}; + }; } /*! @@ -662,27 +797,42 @@ namespace eprosima eProsima_user_DllExport DiscoveryTimePubSubType(); - eProsima_user_DllExport virtual ~DiscoveryTimePubSubType() override; + eProsima_user_DllExport ~DiscoveryTimePubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -705,7 +855,7 @@ namespace eprosima eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } @@ -719,31 +869,35 @@ namespace eprosima #ifndef SWIG namespace detail { - template - struct EntityCount_rob + template + struct EntityCount_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct EntityCount_f - { - typedef uint64_t EntityCount::* type; - friend constexpr type get( - EntityCount_f); - }; + }; - template struct EntityCount_rob; + struct EntityCount_f + { + typedef uint64_t EntityCount::* type; + friend constexpr type get( + EntityCount_f); + }; - template - inline size_t constexpr EntityCount_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct EntityCount_rob; + + template + inline size_t constexpr EntityCount_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type EntityCount defined by the user in the IDL file. @@ -757,27 +911,42 @@ namespace eprosima eProsima_user_DllExport EntityCountPubSubType(); - eProsima_user_DllExport virtual ~EntityCountPubSubType() override; + eProsima_user_DllExport ~EntityCountPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -813,38 +982,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 24ULL == (detail::EntityCount_offset_of() + sizeof(uint64_t)); + return 40ULL == + (detail::EntityCount_offset_of() + + sizeof(uint64_t)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct SampleIdentityCount_rob + template + struct SampleIdentityCount_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct SampleIdentityCount_f - { - typedef uint64_t SampleIdentityCount::* type; - friend constexpr type get( - SampleIdentityCount_f); - }; + }; + + struct SampleIdentityCount_f + { + typedef uint64_t SampleIdentityCount::* type; + friend constexpr type get( + SampleIdentityCount_f); + }; - template struct SampleIdentityCount_rob; + template struct SampleIdentityCount_rob; - template - inline size_t constexpr SampleIdentityCount_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template + inline size_t constexpr SampleIdentityCount_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type SampleIdentityCount defined by the user in the IDL file. @@ -858,27 +1034,42 @@ namespace eprosima eProsima_user_DllExport SampleIdentityCountPubSubType(); - eProsima_user_DllExport virtual ~SampleIdentityCountPubSubType() override; + eProsima_user_DllExport ~SampleIdentityCountPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -914,38 +1105,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 32ULL == (detail::SampleIdentityCount_offset_of() + sizeof(uint64_t)); + return 56ULL == + (detail::SampleIdentityCount_offset_of() + + sizeof(uint64_t)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct Entity2LocatorTraffic_rob + template + struct Entity2LocatorTraffic_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct Entity2LocatorTraffic_f - { - typedef int16_t Entity2LocatorTraffic::* type; - friend constexpr type get( - Entity2LocatorTraffic_f); - }; + }; - template struct Entity2LocatorTraffic_rob; + struct Entity2LocatorTraffic_f + { + typedef int16_t Entity2LocatorTraffic::* type; + friend constexpr type get( + Entity2LocatorTraffic_f); + }; - template - inline size_t constexpr Entity2LocatorTraffic_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct Entity2LocatorTraffic_rob; + + template + inline size_t constexpr Entity2LocatorTraffic_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type Entity2LocatorTraffic defined by the user in the IDL file. @@ -959,27 +1157,42 @@ namespace eprosima eProsima_user_DllExport Entity2LocatorTrafficPubSubType(); - eProsima_user_DllExport virtual ~Entity2LocatorTrafficPubSubType() override; + eProsima_user_DllExport ~Entity2LocatorTrafficPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1015,38 +1228,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 58ULL == (detail::Entity2LocatorTraffic_offset_of() + sizeof(int16_t)); + return 82ULL == + (detail::Entity2LocatorTraffic_offset_of() + + sizeof(int16_t)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct WriterReaderData_rob + template + struct WriterReaderData_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct WriterReaderData_f - { - typedef float WriterReaderData::* type; - friend constexpr type get( - WriterReaderData_f); - }; + }; - template struct WriterReaderData_rob; + struct WriterReaderData_f + { + typedef float WriterReaderData::* type; + friend constexpr type get( + WriterReaderData_f); + }; - template - inline size_t constexpr WriterReaderData_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct WriterReaderData_rob; + + template + inline size_t constexpr WriterReaderData_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type WriterReaderData defined by the user in the IDL file. @@ -1060,27 +1280,42 @@ namespace eprosima eProsima_user_DllExport WriterReaderDataPubSubType(); - eProsima_user_DllExport virtual ~WriterReaderDataPubSubType() override; + eProsima_user_DllExport ~WriterReaderDataPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool deserialize( eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1116,38 +1351,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 36ULL == (detail::WriterReaderData_offset_of() + sizeof(float)); + return 64ULL == + (detail::WriterReaderData_offset_of() + + sizeof(float)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct Locator2LocatorData_rob + template + struct Locator2LocatorData_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct Locator2LocatorData_f - { - typedef float Locator2LocatorData::* type; - friend constexpr type get( - Locator2LocatorData_f); - }; + }; - template struct Locator2LocatorData_rob; + struct Locator2LocatorData_f + { + typedef float Locator2LocatorData::* type; + friend constexpr type get( + Locator2LocatorData_f); + }; - template - inline size_t constexpr Locator2LocatorData_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct Locator2LocatorData_rob; + + template + inline size_t constexpr Locator2LocatorData_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type Locator2LocatorData defined by the user in the IDL file. @@ -1161,27 +1403,42 @@ namespace eprosima eProsima_user_DllExport Locator2LocatorDataPubSubType(); - eProsima_user_DllExport virtual ~Locator2LocatorDataPubSubType() override; + eProsima_user_DllExport ~Locator2LocatorDataPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1217,38 +1474,45 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 52ULL == (detail::Locator2LocatorData_offset_of() + sizeof(float)); + return 64ULL == + (detail::Locator2LocatorData_offset_of() + + sizeof(float)); + } - }}; + }; #ifndef SWIG namespace detail { - template - struct EntityData_rob + template + struct EntityData_rob + { + friend constexpr typename Tag::type get( + Tag) { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; + return M; + } - struct EntityData_f - { - typedef float EntityData::* type; - friend constexpr type get( - EntityData_f); - }; + }; - template struct EntityData_rob; + struct EntityData_f + { + typedef float EntityData::* type; + friend constexpr type get( + EntityData_f); + }; - template - inline size_t constexpr EntityData_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } + template struct EntityData_rob; + + template + inline size_t constexpr EntityData_offset_of() + { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); } - #endif + + } // namespace detail + #endif // ifndef SWIG + /*! * @brief This class represents the TopicDataType of the type EntityData defined by the user in the IDL file. @@ -1262,27 +1526,42 @@ namespace eprosima eProsima_user_DllExport EntityDataPubSubType(); - eProsima_user_DllExport virtual ~EntityDataPubSubType() override; + eProsima_user_DllExport ~EntityDataPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1318,9 +1597,12 @@ namespace eprosima static constexpr bool is_plain_impl() { - return 20ULL == (detail::EntityData_offset_of() + sizeof(float)); + return 36ULL == + (detail::EntityData_offset_of() + + sizeof(float)); + } - }}; + }; /*! * @brief This class represents the TopicDataType of the type PhysicalData defined by the user in the IDL file. @@ -1334,27 +1616,42 @@ namespace eprosima eProsima_user_DllExport PhysicalDataPubSubType(); - eProsima_user_DllExport virtual ~PhysicalDataPubSubType() override; + eProsima_user_DllExport ~PhysicalDataPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1377,7 +1674,7 @@ namespace eprosima eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } diff --git a/test/TrafficInjector/TrafficInjector.h b/test/TrafficInjector/TrafficInjector.h index bb335db12..7f174ff38 100644 --- a/test/TrafficInjector/TrafficInjector.h +++ b/test/TrafficInjector/TrafficInjector.h @@ -47,7 +47,7 @@ using Traffic = nlohmann::ordered_json; class TrafficInjector { - using StatisticsEventKind = eprosima::fastdds::statistics::EventKind; + using StatisticsEventKind = eprosima::fastdds::statistics::EventKindBits; using StatisticsData = eprosima::fastdds::statistics::Data; class StatisticsWriterListener : public eprosima::fastdds::dds::DataWriterListener diff --git a/test/mock/dds/DataReader/fastdds/dds/subscriber/DataReader.hpp b/test/mock/dds/DataReader/fastdds/dds/subscriber/DataReader.hpp index db5b5c32c..7ef9bfc27 100644 --- a/test/mock/dds/DataReader/fastdds/dds/subscriber/DataReader.hpp +++ b/test/mock/dds/DataReader/fastdds/dds/subscriber/DataReader.hpp @@ -39,7 +39,7 @@ class DataReader { protected: - using StatisticsEventKind = eprosima::fastdds::statistics::EventKind; + using StatisticsEventKind = eprosima::fastdds::statistics::EventKindBits; using StatisticsData = eprosima::fastdds::statistics::Data; using Sample = std::pair, std::shared_ptr>; diff --git a/test/unittest/DatabaseQueue/DatabaseQueueTests.cpp b/test/unittest/DatabaseQueue/DatabaseQueueTests.cpp index d5a600741..e37043f16 100644 --- a/test/unittest/DatabaseQueue/DatabaseQueueTests.cpp +++ b/test/unittest/DatabaseQueue/DatabaseQueueTests.cpp @@ -1420,7 +1420,7 @@ TEST_F(database_queue_tests, push_history_latency) std::shared_ptr data = std::make_shared(); data->writer_reader_data(inner_data); - data->_d(EventKind::HISTORY2HISTORY_LATENCY); + data->_d(EventKindBits::HISTORY2HISTORY_LATENCY); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -1492,7 +1492,7 @@ TEST_F(database_queue_tests, push_history_latency_no_reader) std::shared_ptr data = std::make_shared(); data->writer_reader_data(inner_data); - data->_d(EventKind::HISTORY2HISTORY_LATENCY); + data->_d(EventKindBits::HISTORY2HISTORY_LATENCY); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -1549,7 +1549,7 @@ TEST_F(database_queue_tests, push_history_latency_no_writer) std::shared_ptr data = std::make_shared(); data->writer_reader_data(inner_data); - data->_d(EventKind::HISTORY2HISTORY_LATENCY); + data->_d(EventKindBits::HISTORY2HISTORY_LATENCY); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -1601,7 +1601,7 @@ TEST_F(database_queue_tests, push_network_latency) std::shared_ptr data = std::make_shared(); data->locator2locator_data(inner_data); - data->_d(EventKind::NETWORK_LATENCY); + data->_d(EventKindBits::NETWORK_LATENCY); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, src_locator_str)).Times(1) @@ -1667,7 +1667,7 @@ TEST_F(database_queue_tests, push_network_latency_no_participant) std::shared_ptr data = std::make_shared(); data->locator2locator_data(inner_data); - data->_d(EventKind::NETWORK_LATENCY); + data->_d(EventKindBits::NETWORK_LATENCY); // Precondition: The participant does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, src_locator_str)).Times(AnyNumber()) @@ -1719,7 +1719,7 @@ TEST_F(database_queue_tests, push_network_latency_wrong_participant_format) std::shared_ptr data = std::make_shared(); data->locator2locator_data(inner_data); - data->_d(EventKind::NETWORK_LATENCY); + data->_d(EventKindBits::NETWORK_LATENCY); // Precondition: The participant is not searched EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, src_locator_str)).Times(0); @@ -1770,7 +1770,7 @@ TEST_F(database_queue_tests, push_network_latency_no_destination_locator) std::shared_ptr data = std::make_shared(); data->locator2locator_data(inner_data); - data->_d(EventKind::NETWORK_LATENCY); + data->_d(EventKindBits::NETWORK_LATENCY); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, src_locator_str)).Times(AnyNumber()) @@ -1845,7 +1845,7 @@ TEST_F(database_queue_tests, push_publication_throughput) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::PUBLICATION_THROUGHPUT); + data->_d(EventKindBits::PUBLICATION_THROUGHPUT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -1900,7 +1900,7 @@ TEST_F(database_queue_tests, push_publication_throughput_no_writer) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::PUBLICATION_THROUGHPUT); + data->_d(EventKindBits::PUBLICATION_THROUGHPUT); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -1941,7 +1941,7 @@ TEST_F(database_queue_tests, push_subscription_throughput) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::SUBSCRIPTION_THROUGHPUT); + data->_d(EventKindBits::SUBSCRIPTION_THROUGHPUT); // Precondition: The reader exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(1) @@ -1996,7 +1996,7 @@ TEST_F(database_queue_tests, push_subscription_throughput_no_reder) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::SUBSCRIPTION_THROUGHPUT); + data->_d(EventKindBits::SUBSCRIPTION_THROUGHPUT); // Precondition: The reader does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(AnyNumber()) @@ -2049,7 +2049,7 @@ TEST_F(database_queue_tests, push_rtps_sent) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_SENT); + data->_d(EventKindBits::RTPS_SENT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(2) @@ -2139,7 +2139,7 @@ TEST_F(database_queue_tests, push_rtps_sent_no_writer) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_SENT); + data->_d(EventKindBits::RTPS_SENT); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2197,7 +2197,7 @@ TEST_F(database_queue_tests, push_rtps_sent_no_locator) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_SENT); + data->_d(EventKindBits::RTPS_SENT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2302,7 +2302,7 @@ TEST_F(database_queue_tests, push_rtps_lost) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_LOST); + data->_d(EventKindBits::RTPS_LOST); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(2) @@ -2392,7 +2392,7 @@ TEST_F(database_queue_tests, push_rtps_lost_no_writer) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_LOST); + data->_d(EventKindBits::RTPS_LOST); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2450,7 +2450,7 @@ TEST_F(database_queue_tests, push_rtps_lost_no_locator) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_LOST); + data->_d(EventKindBits::RTPS_LOST); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2646,7 +2646,7 @@ TEST_F(database_queue_tests, push_resent_datas) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::RESENT_DATAS); + data->_d(EventKindBits::RESENT_DATAS); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -2701,7 +2701,7 @@ TEST_F(database_queue_tests, push_resent_datas_no_writer) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::RESENT_DATAS); + data->_d(EventKindBits::RESENT_DATAS); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2742,7 +2742,7 @@ TEST_F(database_queue_tests, push_heartbeat_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::HEARTBEAT_COUNT); + data->_d(EventKindBits::HEARTBEAT_COUNT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -2797,7 +2797,7 @@ TEST_F(database_queue_tests, push_heartbeat_count_no_writer) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::HEARTBEAT_COUNT); + data->_d(EventKindBits::HEARTBEAT_COUNT); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -2838,7 +2838,7 @@ TEST_F(database_queue_tests, push_acknack_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::ACKNACK_COUNT); + data->_d(EventKindBits::ACKNACK_COUNT); // Precondition: The reader exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(1) @@ -2893,7 +2893,7 @@ TEST_F(database_queue_tests, push_acknack_count_no_reader) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::ACKNACK_COUNT); + data->_d(EventKindBits::ACKNACK_COUNT); // Precondition: The reader does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(AnyNumber()) @@ -2934,7 +2934,7 @@ TEST_F(database_queue_tests, push_nackfrag_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::NACKFRAG_COUNT); + data->_d(EventKindBits::NACKFRAG_COUNT); // Precondition: The reader exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(1) @@ -2989,7 +2989,7 @@ TEST_F(database_queue_tests, push_nackfrag_count_no_reader) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::NACKFRAG_COUNT); + data->_d(EventKindBits::NACKFRAG_COUNT); // Precondition: The reader does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAREADER, reader_guid_str)).Times(AnyNumber()) @@ -3030,7 +3030,7 @@ TEST_F(database_queue_tests, push_gap_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::GAP_COUNT); + data->_d(EventKindBits::GAP_COUNT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -3085,7 +3085,7 @@ TEST_F(database_queue_tests, push_gap_count_no_writer) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::GAP_COUNT); + data->_d(EventKindBits::GAP_COUNT); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -3126,7 +3126,7 @@ TEST_F(database_queue_tests, push_data_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::DATA_COUNT); + data->_d(EventKindBits::DATA_COUNT); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -3181,7 +3181,7 @@ TEST_F(database_queue_tests, push_data_count_no_writer) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::DATA_COUNT); + data->_d(EventKindBits::DATA_COUNT); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -3222,7 +3222,7 @@ TEST_F(database_queue_tests, push_pdp_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::PDP_PACKETS); + data->_d(EventKindBits::PDP_PACKETS); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3277,7 +3277,7 @@ TEST_F(database_queue_tests, push_pdp_count_no_participant) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::PDP_PACKETS); + data->_d(EventKindBits::PDP_PACKETS); // Precondition: The participant does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -3318,7 +3318,7 @@ TEST_F(database_queue_tests, push_edp_count) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::EDP_PACKETS); + data->_d(EventKindBits::EDP_PACKETS); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3373,7 +3373,7 @@ TEST_F(database_queue_tests, push_edp_count_no_participant) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::EDP_PACKETS); + data->_d(EventKindBits::EDP_PACKETS); // Precondition: The participant does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -3431,7 +3431,7 @@ TEST_F(database_queue_tests, push_discovery_times) std::shared_ptr data = std::make_shared(); data->discovery_time(inner_data); - data->_d(EventKind::DISCOVERED_ENTITY); + data->_d(EventKindBits::DISCOVERED_ENTITY); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3504,7 +3504,7 @@ TEST_F(database_queue_tests, push_discovery_times_no_participant) std::shared_ptr data = std::make_shared(); data->discovery_time(inner_data); - data->_d(EventKind::DISCOVERED_ENTITY); + data->_d(EventKindBits::DISCOVERED_ENTITY); // Precondition: The participant does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -3562,7 +3562,7 @@ TEST_F(database_queue_tests, push_discovery_times_no_entity) std::shared_ptr data = std::make_shared(); data->discovery_time(inner_data); - data->_d(EventKind::DISCOVERED_ENTITY); + data->_d(EventKindBits::DISCOVERED_ENTITY); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -3618,7 +3618,7 @@ TEST_F(database_queue_tests, push_sample_datas) std::shared_ptr data = std::make_shared(); data->sample_identity_count(inner_data); - data->_d(EventKind::SAMPLE_DATAS); + data->_d(EventKindBits::SAMPLE_DATAS); // Precondition: The writer exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(1) @@ -3684,7 +3684,7 @@ TEST_F(database_queue_tests, push_sample_datas_no_writer) std::shared_ptr data = std::make_shared(); data->sample_identity_count(inner_data); - data->_d(EventKind::SAMPLE_DATAS); + data->_d(EventKindBits::SAMPLE_DATAS); // Precondition: The writer does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::DATAWRITER, writer_guid_str)).Times(AnyNumber()) @@ -3735,7 +3735,7 @@ TEST_F(database_queue_tests, push_physical_data_process_exists) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3813,7 +3813,7 @@ TEST_F(database_queue_tests, push_physical_data_no_participant_exists) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant does not exist EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3891,7 +3891,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_exists) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -3982,7 +3982,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_exists_process_insert std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -4077,7 +4077,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_no_user_exists) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -4181,7 +4181,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_no_user_exists_user_i std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -4268,7 +4268,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_no_user_no_host_exist std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) @@ -4384,7 +4384,7 @@ TEST_F(database_queue_tests, push_physical_data_no_process_no_user_no_host_exist std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(AnyNumber()) @@ -4464,7 +4464,7 @@ TEST_F(database_queue_tests, push_physical_data_wrong_processname_format) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); // Precondition: The participant exists and has ID 1 EXPECT_CALL(database, get_entity_by_guid(EntityKind::PARTICIPANT, participant_guid_str)).Times(1) diff --git a/test/unittest/StatisticsReaderListener/StatisticsReaderListenerTests.cpp b/test/unittest/StatisticsReaderListener/StatisticsReaderListenerTests.cpp index 75939b435..178186636 100644 --- a/test/unittest/StatisticsReaderListener/StatisticsReaderListenerTests.cpp +++ b/test/unittest/StatisticsReaderListener/StatisticsReaderListenerTests.cpp @@ -310,7 +310,7 @@ TEST_F(statistics_reader_listener_tests, new_history_latency_received) std::shared_ptr data = std::make_shared(); data->writer_reader_data(inner_data); - data->_d(EventKind::HISTORY2HISTORY_LATENCY); + data->_d(EventKindBits::HISTORY2HISTORY_LATENCY); add_sample_to_reader_history(data, get_default_info()); @@ -378,7 +378,7 @@ TEST_F(statistics_reader_listener_tests, new_network_latency_received) std::shared_ptr data = std::make_shared(); data->locator2locator_data(inner_data); - data->_d(EventKind::NETWORK_LATENCY); + data->_d(EventKindBits::NETWORK_LATENCY); add_sample_to_reader_history(data, get_default_info()); @@ -439,7 +439,7 @@ TEST_F(statistics_reader_listener_tests, new_publication_throughput_received) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::PUBLICATION_THROUGHPUT); + data->_d(EventKindBits::PUBLICATION_THROUGHPUT); add_sample_to_reader_history(data, get_default_info()); @@ -495,7 +495,7 @@ TEST_F(statistics_reader_listener_tests, new_subscription_throughput_received) std::shared_ptr data = std::make_shared(); data->entity_data(inner_data); - data->_d(EventKind::SUBSCRIPTION_THROUGHPUT); + data->_d(EventKindBits::SUBSCRIPTION_THROUGHPUT); add_sample_to_reader_history(data, get_default_info()); @@ -563,7 +563,7 @@ TEST_F(statistics_reader_listener_tests, new_rtps_sent_received) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_SENT); + data->_d(EventKindBits::RTPS_SENT); add_sample_to_reader_history(data, get_default_info()); @@ -651,7 +651,7 @@ TEST_F(statistics_reader_listener_tests, new_rtps_lost_received) std::shared_ptr data = std::make_shared(); data->entity2locator_traffic(inner_data); - data->_d(EventKind::RTPS_LOST); + data->_d(EventKindBits::RTPS_LOST); add_sample_to_reader_history(data, get_default_info()); @@ -727,7 +727,7 @@ TEST_F(statistics_reader_listener_tests, new_resent_datas_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::RESENT_DATAS); + data->_d(EventKindBits::RESENT_DATAS); add_sample_to_reader_history(data, get_default_info()); @@ -783,7 +783,7 @@ TEST_F(statistics_reader_listener_tests, new_heartbeat_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::HEARTBEAT_COUNT); + data->_d(EventKindBits::HEARTBEAT_COUNT); add_sample_to_reader_history(data, get_default_info()); @@ -839,7 +839,7 @@ TEST_F(statistics_reader_listener_tests, new_acknack_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::ACKNACK_COUNT); + data->_d(EventKindBits::ACKNACK_COUNT); add_sample_to_reader_history(data, get_default_info()); @@ -895,7 +895,7 @@ TEST_F(statistics_reader_listener_tests, new_nackfrag_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::NACKFRAG_COUNT); + data->_d(EventKindBits::NACKFRAG_COUNT); add_sample_to_reader_history(data, get_default_info()); @@ -951,7 +951,7 @@ TEST_F(statistics_reader_listener_tests, new_gap_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::GAP_COUNT); + data->_d(EventKindBits::GAP_COUNT); add_sample_to_reader_history(data, get_default_info()); @@ -1007,7 +1007,7 @@ TEST_F(statistics_reader_listener_tests, new_data_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::DATA_COUNT); + data->_d(EventKindBits::DATA_COUNT); add_sample_to_reader_history(data, get_default_info()); @@ -1063,7 +1063,7 @@ TEST_F(statistics_reader_listener_tests, new_pdp_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::PDP_PACKETS); + data->_d(EventKindBits::PDP_PACKETS); add_sample_to_reader_history(data, get_default_info()); @@ -1119,7 +1119,7 @@ TEST_F(statistics_reader_listener_tests, new_edp_count_received) std::shared_ptr data = std::make_shared(); data->entity_count(inner_data); - data->_d(EventKind::EDP_PACKETS); + data->_d(EventKindBits::EDP_PACKETS); add_sample_to_reader_history(data, get_default_info()); @@ -1190,7 +1190,7 @@ TEST_F(statistics_reader_listener_tests, new_discovery_times_received) std::shared_ptr data = std::make_shared(); data->discovery_time(inner_data); - data->_d(EventKind::DISCOVERED_ENTITY); + data->_d(EventKindBits::DISCOVERED_ENTITY); add_sample_to_reader_history(data, get_default_info()); @@ -1262,7 +1262,7 @@ TEST_F(statistics_reader_listener_tests, new_sample_datas_received) std::shared_ptr data = std::make_shared(); data->sample_identity_count(inner_data); - data->_d(EventKind::SAMPLE_DATAS); + data->_d(EventKindBits::SAMPLE_DATAS); add_sample_to_reader_history(data, get_default_info()); @@ -1329,7 +1329,7 @@ TEST_F(statistics_reader_listener_tests, new_physical_data_received) std::shared_ptr data = std::make_shared(); data->physical_data(inner_data); - data->_d(EventKind::PHYSICAL_DATA); + data->_d(EventKindBits::PHYSICAL_DATA); add_sample_to_reader_history(data, get_default_info()); From ef6739873596b5f661d671caf76df600ea3b4180 Mon Sep 17 00:00:00 2001 From: JLBuenoLopez-eProsima Date: Tue, 19 Sep 2023 07:26:25 +0200 Subject: [PATCH 2/3] Refs #19453: explicit extensibility Signed-off-by: JLBuenoLopez-eProsima --- examples/cpp/HelloWorldExample/HelloWorld.idl | 1 + src/cpp/topic_types/types.idl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/examples/cpp/HelloWorldExample/HelloWorld.idl b/examples/cpp/HelloWorldExample/HelloWorld.idl index 0fd2c355a..dcc14b495 100644 --- a/examples/cpp/HelloWorldExample/HelloWorld.idl +++ b/examples/cpp/HelloWorldExample/HelloWorld.idl @@ -1,3 +1,4 @@ +@final struct HelloWorld { unsigned long index; diff --git a/src/cpp/topic_types/types.idl b/src/cpp/topic_types/types.idl index d5bdbf266..007b9155c 100644 --- a/src/cpp/topic_types/types.idl +++ b/src/cpp/topic_types/types.idl @@ -23,34 +23,40 @@ module statistics { module detail { + @final struct EntityId_s { octet value[4]; }; + @final struct GuidPrefix_s { octet value[12]; }; + @final struct GUID_s { GuidPrefix_s guidPrefix; EntityId_s entityId; }; + @final struct SequenceNumber_s { long high; unsigned long low; }; + @final struct SampleIdentity_s { GUID_s writer_guid; SequenceNumber_s sequence_number; }; + @final struct Locator_s { long kind; @@ -60,6 +66,7 @@ module statistics { }; // namespace detail +@final struct DiscoveryTime { @Key detail::GUID_s local_participant_guid; @@ -70,18 +77,21 @@ struct DiscoveryTime string process; }; +@final struct EntityCount { @Key detail::GUID_s guid; unsigned long long count; }; +@final struct SampleIdentityCount { @Key detail::SampleIdentity_s sample_id; unsigned long long count; }; +@final struct Entity2LocatorTraffic { @Key detail::GUID_s src_guid; @@ -91,6 +101,7 @@ struct Entity2LocatorTraffic short byte_magnitude_order; }; +@final struct WriterReaderData { @Key detail::GUID_s writer_guid; @@ -98,6 +109,7 @@ struct WriterReaderData float data; }; +@final struct Locator2LocatorData { @Key detail::Locator_s src_locator; @@ -105,12 +117,14 @@ struct Locator2LocatorData float data; }; +@final struct EntityData { @Key detail::GUID_s guid; float data; }; +@final struct PhysicalData { @Key detail::GUID_s participant_guid; @@ -119,6 +133,7 @@ struct PhysicalData string process; }; +@final @bit_bound(32) bitmask EventKind { @@ -141,6 +156,7 @@ bitmask EventKind @position(16) PHYSICAL_DATA }; +@final union Data switch(EventKind) { case HISTORY2HISTORY_LATENCY: From 9a1551815c860957f2d524b385af5296e770915d Mon Sep 17 00:00:00 2001 From: JLBuenoLopez-eProsima Date: Tue, 19 Sep 2023 07:27:57 +0200 Subject: [PATCH 3/3] Refs #19453: regenerate types using Fast DDS-Gen v3.0.0 Signed-off-by: JLBuenoLopez-eProsima --- .../HelloWorldExample/HelloWorldCdrAux.hpp | 2 +- .../HelloWorldExample/HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 2 +- .../HelloWorldExample/HelloWorldPubSubTypes.h | 7 + src/cpp/topic_types/typesCdrAux.hpp | 44 +-- src/cpp/topic_types/typesCdrAux.ipp | 90 ++--- src/cpp/topic_types/typesPubSubTypes.cxx | 28 +- src/cpp/topic_types/typesPubSubTypes.h | 326 ++++++++++++++++-- 8 files changed, 383 insertions(+), 122 deletions(-) diff --git a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp index cf39bf783..6b7c293c9 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.hpp @@ -24,7 +24,7 @@ #include "HelloWorld.h" -constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; +constexpr uint32_t HelloWorld_max_cdr_typesize {264UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; diff --git a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp index b9461ff5b..c0cabcbe4 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp @@ -45,7 +45,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -70,7 +70,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -87,7 +87,7 @@ eProsima_user_DllExport void deserialize( HelloWorld& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { diff --git a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx index f4a5ef511..26ca191ad 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -68,7 +68,7 @@ bool HelloWorldPubSubType::serialize( ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { diff --git a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h index 5b325dd1c..f6c88d5c1 100644 --- a/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.h @@ -102,6 +102,13 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType 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 diff --git a/src/cpp/topic_types/typesCdrAux.hpp b/src/cpp/topic_types/typesCdrAux.hpp index 274084a33..e26c1b178 100644 --- a/src/cpp/topic_types/typesCdrAux.hpp +++ b/src/cpp/topic_types/typesCdrAux.hpp @@ -24,48 +24,48 @@ #include "types.h" -constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize {852UL}; -constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize {820UL}; +constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize {32UL}; -constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize {812UL}; -constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize {796UL}; +constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize {16UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize {24UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize {16UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize {12UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize {24UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_cdr_typesize {36UL}; -constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize {16UL}; -constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize {82UL}; -constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize {58UL}; +constexpr uint32_t eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize {40UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize {4UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_cdr_typesize {40UL}; -constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize {16UL}; -constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize {64UL}; -constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize {32UL}; -constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize {56UL}; -constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize {24UL}; -constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize {64UL}; -constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize {52UL}; +constexpr uint32_t eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize {48UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize {16UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize {8UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize {0UL}; diff --git a/src/cpp/topic_types/typesCdrAux.ipp b/src/cpp/topic_types/typesCdrAux.ipp index 4fddae426..65d117cdd 100644 --- a/src/cpp/topic_types/typesCdrAux.ipp +++ b/src/cpp/topic_types/typesCdrAux.ipp @@ -45,7 +45,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -67,7 +67,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -83,7 +83,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::EntityId_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -122,7 +122,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -144,7 +144,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -160,7 +160,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -199,7 +199,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -224,7 +224,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -241,7 +241,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::GUID_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -284,7 +284,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -309,7 +309,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -326,7 +326,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -369,7 +369,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -394,7 +394,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -411,7 +411,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -454,7 +454,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -482,7 +482,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -500,7 +500,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::detail::Locator_s& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -548,7 +548,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -585,7 +585,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -606,7 +606,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::DiscoveryTime& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -673,7 +673,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -698,7 +698,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -715,7 +715,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::EntityCount& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -761,7 +761,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -786,7 +786,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -803,7 +803,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::SampleIdentityCount& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -849,7 +849,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -883,7 +883,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -903,7 +903,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -965,7 +965,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -993,7 +993,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -1011,7 +1011,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::WriterReaderData& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -1063,7 +1063,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -1091,7 +1091,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -1109,7 +1109,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::Locator2LocatorData& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -1161,7 +1161,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -1186,7 +1186,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -1203,7 +1203,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::EntityData& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -1249,7 +1249,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -1280,7 +1280,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr @@ -1299,7 +1299,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::PhysicalData& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { @@ -1356,7 +1356,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, current_alignment)}; @@ -1430,7 +1430,7 @@ eProsima_user_DllExport void serialize( 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_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr << eprosima::fastcdr::MemberId(0) << data._d(); @@ -1489,7 +1489,7 @@ eProsima_user_DllExport void deserialize( eprosima::fastdds::statistics::Data& data) { cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { diff --git a/src/cpp/topic_types/typesPubSubTypes.cxx b/src/cpp/topic_types/typesPubSubTypes.cxx index 70cf4e481..6a2e38359 100644 --- a/src/cpp/topic_types/typesPubSubTypes.cxx +++ b/src/cpp/topic_types/typesPubSubTypes.cxx @@ -72,7 +72,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -224,7 +224,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -376,7 +376,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -528,7 +528,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -680,7 +680,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -832,7 +832,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -987,7 +987,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1139,7 +1139,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1291,7 +1291,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1443,7 +1443,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1595,7 +1595,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1747,7 +1747,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -1899,7 +1899,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { @@ -2051,7 +2051,7 @@ namespace eprosima { ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); try { diff --git a/src/cpp/topic_types/typesPubSubTypes.h b/src/cpp/topic_types/typesPubSubTypes.h index d44a6d6b5..a6cfca0a5 100644 --- a/src/cpp/topic_types/typesPubSubTypes.h +++ b/src/cpp/topic_types/typesPubSubTypes.h @@ -140,7 +140,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -160,9 +173,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 8ULL == + return 4ULL == + (detail::EntityId_s_offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == (detail::EntityId_s_offset_of() + sizeof(std::array)); } @@ -263,7 +283,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -283,9 +316,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 16ULL == + return 12ULL == + (detail::GuidPrefix_s_offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 12ULL == (detail::GuidPrefix_s_offset_of() + sizeof(std::array)); } @@ -386,7 +426,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -406,9 +459,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 28ULL == + return 16ULL == + (detail::GUID_s_offset_of() + + sizeof(eprosima::fastdds::statistics::detail::EntityId_s)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 16ULL == (detail::GUID_s_offset_of() + sizeof(eprosima::fastdds::statistics::detail::EntityId_s)); } @@ -509,7 +569,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -529,9 +602,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 12ULL == + return 8ULL == + (detail::SequenceNumber_s_offset_of() + + sizeof(uint32_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 8ULL == (detail::SequenceNumber_s_offset_of() + sizeof(uint32_t)); } @@ -632,7 +712,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -652,9 +745,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 44ULL == + return 24ULL == + (detail::SampleIdentity_s_offset_of() + + sizeof(eprosima::fastdds::statistics::detail::SequenceNumber_s)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == (detail::SampleIdentity_s_offset_of() + sizeof(eprosima::fastdds::statistics::detail::SequenceNumber_s)); } @@ -755,7 +855,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -775,9 +888,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 28ULL == + return 24ULL == + (detail::Locator_s_offset_of() + + sizeof(std::array)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 24ULL == (detail::Locator_s_offset_of() + sizeof(std::array)); } @@ -849,6 +969,13 @@ namespace eprosima 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 @@ -960,7 +1087,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -980,9 +1120,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() + { + return 24ULL == + (detail::EntityCount_offset_of() + + sizeof(uint64_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() { - return 40ULL == + return 24ULL == (detail::EntityCount_offset_of() + sizeof(uint64_t)); } @@ -1083,7 +1230,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1103,9 +1263,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 56ULL == + return 32ULL == + (detail::SampleIdentityCount_offset_of() + + sizeof(uint64_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 32ULL == (detail::SampleIdentityCount_offset_of() + sizeof(uint64_t)); } @@ -1206,7 +1373,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1226,9 +1406,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() + { + return 58ULL == + (detail::Entity2LocatorTraffic_offset_of() + + sizeof(int16_t)); + } + + static constexpr bool is_plain_xcdrv2_impl() { - return 82ULL == + return 58ULL == (detail::Entity2LocatorTraffic_offset_of() + sizeof(int16_t)); } @@ -1329,7 +1516,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1349,9 +1549,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() + { + return 36ULL == + (detail::WriterReaderData_offset_of() + + sizeof(float)); + } + + static constexpr bool is_plain_xcdrv2_impl() { - return 64ULL == + return 36ULL == (detail::WriterReaderData_offset_of() + sizeof(float)); } @@ -1452,7 +1659,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1472,9 +1692,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() + { + return 52ULL == + (detail::Locator2LocatorData_offset_of() + + sizeof(float)); + } + + static constexpr bool is_plain_xcdrv2_impl() { - return 64ULL == + return 52ULL == (detail::Locator2LocatorData_offset_of() + sizeof(float)); } @@ -1575,7 +1802,20 @@ namespace eprosima #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1595,9 +1835,16 @@ namespace eprosima private: - static constexpr bool is_plain_impl() + static constexpr bool is_plain_xcdrv1_impl() { - return 36ULL == + return 20ULL == + (detail::EntityData_offset_of() + + sizeof(float)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 20ULL == (detail::EntityData_offset_of() + sizeof(float)); } @@ -1668,6 +1915,13 @@ namespace eprosima 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